Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: fusion: fix if-statement empty body warning

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

Link: https://lore.kernel.org/r/ff9df31b-c4c1-c942-1cbf-18039e084c8e@infradead.org
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Cc: MPT-FusionLinux.pdl@broadcom.com
Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
Cc: Chaitra P B <chaitra.basappa@broadcom.com>
Cc: Sathya Prakash <sathya.prakash@broadcom.com>
Reviewed-by: Bart van Assche <bvanassche@acm.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Randy Dunlap and committed by
Martin K. Petersen
5848fe96 cc6b32ee

+3 -2
+3 -2
drivers/message/fusion/mptlan.h
··· 64 64 #include <linux/if_arp.h> 65 65 #include <linux/init.h> 66 66 #include <linux/kernel.h> 67 + #include <linux/printk.h> 67 68 #include <linux/slab.h> 68 69 #include <linux/spinlock.h> 69 70 #include <linux/workqueue.h> ··· 112 111 #ifdef MPT_LAN_IO_DEBUG 113 112 #define dioprintk(x) printk x 114 113 #else 115 - #define dioprintk(x) 114 + #define dioprintk(x) no_printk x 116 115 #endif 117 116 118 117 #ifdef MPT_LAN_DEBUG 119 118 #define dlprintk(x) printk x 120 119 #else 121 - #define dlprintk(x) 120 + #define dlprintk(x) no_printk x 122 121 #endif 123 122 124 123 #define NETDEV_TO_LANPRIV_PTR(d) ((struct mpt_lan_priv *)netdev_priv(d))