Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966165AbcKXTlm (ORCPT ); Thu, 24 Nov 2016 14:41:42 -0500 Received: from mx1a.mailbox.org ([80.241.60.218]:35954 "EHLO mx1a.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965378AbcKXTlk (ORCPT ); Thu, 24 Nov 2016 14:41:40 -0500 Subject: Re: [PATCH v2 2/2] staging: slicoss: remove UPDATE_STATS_GB macro and inline code To: Sergio Paracuellos , gregkh@linuxfoundation.org References: <1480015260-22515-1-git-send-email-sergio.paracuellos@gmail.com> <1480015260-22515-3-git-send-email-sergio.paracuellos@gmail.com> Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, liodot@gmail.com From: =?UTF-8?Q?Markus_B=c3=b6hme?= Message-ID: <58700ceb-5542-304d-2c7f-6c038b080798@mailbox.org> Date: Thu, 24 Nov 2016 20:41:24 +0100 MIME-Version: 1.0 In-Reply-To: <1480015260-22515-3-git-send-email-sergio.paracuellos@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4080 Lines: 114 On 11/24/2016 08:21 PM, Sergio Paracuellos wrote: > This patch removes UPDATE_STATS_GB macro in slic.h header file > and just inline code. This improve readability. > > Signed-off-by: Sergio Paracuellos > --- > drivers/staging/slicoss/slic.h | 5 ---- > drivers/staging/slicoss/slicoss.c | 52 +++++++++++++++++++-------------------- > 2 files changed, 25 insertions(+), 32 deletions(-) > > diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h > index 2c05868..2893bdf 100644 > --- a/drivers/staging/slicoss/slic.h > +++ b/drivers/staging/slicoss/slic.h > @@ -548,11 +548,6 @@ static inline void slic_flush_write(struct adapter *adapter) > ioread32(adapter->regs + SLIC_REG_HOSTID); > } > > -#define UPDATE_STATS_GB(largestat, newstat, oldstat) \ > -{ \ > - (largestat) += ((newstat) - (oldstat)); \ > -} > - > #if BITS_PER_LONG == 64 > #define SLIC_GET_ADDR_LOW(_addr) (u32)((u64)(_addr) & \ > 0x00000000FFFFFFFF) > diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c > index b6ec0a1..ffc7c45 100644 > --- a/drivers/staging/slicoss/slicoss.c > +++ b/drivers/staging/slicoss/slicoss.c > @@ -1014,45 +1014,43 @@ static void slic_upr_request_complete(struct adapter *adapter, u32 isr) > break; > } > > - UPDATE_STATS_GB(stst->tcp.xmit_tcp_segs, stats->xmit_tcp_segs, > - old->xmit_tcp_segs); > + stst->tcp.xmit_tcp_segs = > + stats->xmit_tcp_segs - old->xmit_tcp_segs; Missed this the first time, but the difference should be added to the value in stst: stst->tcp.xmit_tcp_segs += stats->xmit_tcp_segs - old->xmit_tcp_segs; The same applies to the changes below. > > - UPDATE_STATS_GB(stst->tcp.xmit_tcp_bytes, stats->xmit_tcp_bytes, > - old->xmit_tcp_bytes); > + stst->tcp.xmit_tcp_bytes = > + stats->xmit_tcp_bytes - old->xmit_tcp_bytes; > > - UPDATE_STATS_GB(stst->tcp.rcv_tcp_segs, stats->rcv_tcp_segs, > - old->rcv_tcp_segs); > + stst->tcp.rcv_tcp_segs = > + stats->rcv_tcp_segs - old->rcv_tcp_segs; > > - UPDATE_STATS_GB(stst->tcp.rcv_tcp_bytes, stats->rcv_tcp_bytes, > - old->rcv_tcp_bytes); > + stst->tcp.rcv_tcp_bytes = > + stats->rcv_tcp_bytes - old->rcv_tcp_bytes; > > - UPDATE_STATS_GB(stst->iface.xmt_bytes, stats->xmit_bytes, > - old->xmit_bytes); > + stst->iface.xmt_bytes = > + stats->xmit_bytes - old->xmit_bytes; > > - UPDATE_STATS_GB(stst->iface.xmt_ucast, stats->xmit_unicasts, > - old->xmit_unicasts); > + stst->iface.xmt_ucast = > + stats->xmit_unicasts - old->xmit_unicasts; > > - UPDATE_STATS_GB(stst->iface.rcv_bytes, stats->rcv_bytes, > - old->rcv_bytes); > + stst->iface.rcv_bytes = > + stats->rcv_bytes - old->rcv_bytes; > > - UPDATE_STATS_GB(stst->iface.rcv_ucast, stats->rcv_unicasts, > - old->rcv_unicasts); > + stst->iface.rcv_ucast = > + stats->rcv_unicasts - old->rcv_unicasts; > > - UPDATE_STATS_GB(stst->iface.xmt_errors, stats->xmit_collisions, > - old->xmit_collisions); > + stst->iface.xmt_errors = > + stats->xmit_collisions - old->xmit_collisions; > > - UPDATE_STATS_GB(stst->iface.xmt_errors, > - stats->xmit_excess_collisions, > - old->xmit_excess_collisions); > + stst->iface.xmt_errors = stats->xmit_excess_collisions - > + old->xmit_excess_collisions; > > - UPDATE_STATS_GB(stst->iface.xmt_errors, stats->xmit_other_error, > - old->xmit_other_error); > + stst->iface.xmt_errors = > + stats->xmit_other_error - old->xmit_other_error; > > - UPDATE_STATS_GB(stst->iface.rcv_errors, stats->rcv_other_error, > - old->rcv_other_error); > + stst->iface.rcv_errors = > + stats->rcv_other_error - old->rcv_other_error; > > - UPDATE_STATS_GB(stst->iface.rcv_discards, stats->rcv_drops, > - old->rcv_drops); > + stst->iface.rcv_discards = stats->rcv_drops - old->rcv_drops; > > if (stats->rcv_drops > old->rcv_drops) > adapter->rcv_drops += (stats->rcv_drops - > Regards, Markus