[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fce3814c-6516-f5cb-5adf-84f4af2c89bf@mailbox.org>
Date: Wed, 23 Nov 2016 20:00:45 +0100
From: Markus Böhme <markus.boehme@...lbox.org>
To: Sergio Paracuellos <sergio.paracuellos@...il.com>,
gregkh@...uxfoundation.org
Cc: devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
liodot@...il.com
Subject: Re: [PATCH 2/2] staging: slicoss: replace UPDATE_STATS_GB macro into
an inline function
On 11/23/2016 07:10 PM, Sergio Paracuellos wrote:
> This patch replaces UPDATE_STATS_GB macro in slic.h header file
> into an inline function. This provides type safety and readability.
>
> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@...il.com>
> ---
> drivers/staging/slicoss/slic.h | 6 ++---
> drivers/staging/slicoss/slicoss.c | 56 ++++++++++++++++++++-------------------
> 2 files changed, 32 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
> index 2c05868..b19ddc9 100644
> --- a/drivers/staging/slicoss/slic.h
> +++ b/drivers/staging/slicoss/slic.h
> @@ -548,9 +548,9 @@ 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)); \
> +static inline u64 update_stats_gb(const u64 newstat, const u64 oldstat)
> +{
> + return (newstat - oldstat);
> }
>
I suggest dropping the parentheses here. They are unnecessary and likely
to lead to a cleanup patch.
Regards,
Markus
Powered by blists - more mailing lists