Skip to content

Commit

Permalink
scsi: fusion: fix if-statement empty body warning
Browse files Browse the repository at this point in the history
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/[email protected]
Cc: Bart Van Assche <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Suganath Prabu Subramani <[email protected]>
Cc: Chaitra P B <[email protected]>
Cc: Sathya Prakash <[email protected]>
Reviewed-by: Bart van Assche <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Randy Dunlap <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
rddunlap authored and martinkpetersen committed Mar 12, 2020
1 parent cc6b32e commit 5848fe9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/message/fusion/mptlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 5848fe9

Please sign in to comment.