Re: [PATCH v2] fusion: fix if-statement empty body warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/8/20 6:01 AM, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
> 
> When driver debugging is not enabled, change the debug print macros
> to use the no_printk() macro.
> 
> This fixes a gcc warning when -Wextra is set:
> ../drivers/message/fusion/mptlan.c:266:39: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
> 
> I have verified that there is very little object code change (with
> gcc 7.5.0). There are a few changes like:
>   cmp %a,%b
>   jl $1
> to
>   cmp %b,%a
>   jg $1
> 
> Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
> Cc: Sathya Prakash <sathya.prakash@xxxxxxxxxxxx>
> Cc: Chaitra P B <chaitra.basappa@xxxxxxxxxxxx>
> Cc: Suganath Prabu Subramani <suganath-prabu.subramani@xxxxxxxxxxxx>
> Cc: MPT-FusionLinux.pdl@xxxxxxxxxxxx
> Cc: linux-scsi@xxxxxxxxxxxxxxx
> Cc: "Martin K. Petersen" <martin.petersen@xxxxxxxxxx>
> Cc: "James E.J. Bottomley" <jejb@xxxxxxxxxxxxx>
> Cc: Bart Van Assche <bvanassche@xxxxxxx>
> Reviewed-by: Bart van Assche <bvanassche@xxxxxxx>
> ---
> v2: use no_printk() macro instead of an empty do-while loop (Bart)
> 
>  drivers/message/fusion/mptlan.h |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> --- linux-next-20200306.orig/drivers/message/fusion/mptlan.h
> +++ linux-next-20200306/drivers/message/fusion/mptlan.h
> @@ -64,6 +64,7 @@
>  #include <linux/if_arp.h>
>  #include <linux/init.h>
>  #include <linux/kernel.h>
> +#include <linux/printk.h>
>  #include <linux/slab.h>
>  #include <linux/spinlock.h>
>  #include <linux/workqueue.h>
> @@ -111,13 +112,13 @@ MODULE_DESCRIPTION(LANAME);
>  #ifdef MPT_LAN_IO_DEBUG
>  #define dioprintk(x)  printk x
>  #else
> -#define dioprintk(x)
> +#define dioprintk(x)  no_printk x
>  #endif
>  
>  #ifdef MPT_LAN_DEBUG
>  #define dlprintk(x)  printk x
>  #else
> -#define dlprintk(x)
> +#define dlprintk(x)  no_printk x
>  #endif
>  
>  #define NETDEV_TO_LANPRIV_PTR(d)	((struct mpt_lan_priv *)netdev_priv(d))
> 
> 
Reviewed-by: Hannes Reinecke <hare@xxxxxxx>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		           Kernel Storage Architect
hare@xxxxxxx			                  +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), GF: Felix Imendörffer



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux