lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 18 Sep 2018 13:27:11 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Nishad Kamdar <nishadkamdar@...il.com>
Cc:     devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
        NeilBrown <neil@...wn.name>, Joe Perches <joe@...ches.com>,
        Christian Lütke-Stetzkamp <christian@...mp.de>,
        Dan Carpenter <dan.carpenter@...cle.com>,
        John Crispin <blogic@...nwrt.org>
Subject: Re: [PATCH] staging: mt7621-mmc: Remove do {} while (0) loop for
 single statement macro

On Sat, Sep 15, 2018 at 06:47:51PM +0530, Nishad Kamdar wrote:
> This patch removes do {} while (0) loop for single statement macros.
> Issue found by checkpatch.
> 
> Signed-off-by: Nishad Kamdar <nishadkamdar@...il.com>
> ---
>  drivers/staging/mt7621-mmc/sd.c | 28 +++++++---------------------
>  1 file changed, 7 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c
> index 7474f9ed7b5b..ec12a3a5a926 100644
> --- a/drivers/staging/mt7621-mmc/sd.c
> +++ b/drivers/staging/mt7621-mmc/sd.c
> @@ -104,14 +104,10 @@ static int cd_active_low = 1;
>  /* gate means clock power down */
>  static int g_clk_gate = 0;
>  #define msdc_gate_clock(id) \
> -	do {					       \
> -		g_clk_gate &= ~(1 << ((id) + PERI_MSDC0_PDN));	\
> -	} while (0)
> +	(g_clk_gate &= ~(1 << ((id) + PERI_MSDC0_PDN)))

This should become an inline function, right?


>  /* not like power down register. 1 means clock on. */
>  #define msdc_ungate_clock(id) \
> -	do {					    \
> -		g_clk_gate |= 1 << ((id) + PERI_MSDC0_PDN);	\
> -	} while (0)
> +	(g_clk_gate |= 1 << ((id) + PERI_MSDC0_PDN))

Same here.

>  
>  // do we need sync object or not
>  void msdc_clk_status(int *status)
> @@ -170,9 +166,7 @@ static void msdc_clr_fifo(struct msdc_host *host)
>  	} while (0)
>  
>  #define msdc_irq_restore(val) \
> -	do {					\
> -		sdr_set_bits(host->base + MSDC_INTEN, val);	\
> -	} while (0)
> +	(sdr_set_bits(host->base + MSDC_INTEN, val))

Just call the one function where this is used and delete this #define.

Same type of changes for the rest of these as well.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ