All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] fusion: fix if-statement empty body warning
@ 2020-03-08  5:01 Randy Dunlap
  2020-03-09  7:14 ` Hannes Reinecke
  2020-03-10 22:48 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Randy Dunlap @ 2020-03-08  5:01 UTC (permalink / raw
  To: linux-scsi, Martin K. Petersen, James E.J. Bottomley,
	Bart Van Assche
  Cc: Sathya Prakash, Chaitra P B, Suganath Prabu Subramani,
	MPT-FusionLinux.pdl

From: Randy Dunlap <rdunlap@infradead.org>

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@infradead.org>
Cc: Sathya Prakash <sathya.prakash@broadcom.com>
Cc: Chaitra P B <chaitra.basappa@broadcom.com>
Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
Cc: MPT-FusionLinux.pdl@broadcom.com
Cc: linux-scsi@vger.kernel.org
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Bart van Assche <bvanassche@acm.org>
---
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))



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] fusion: fix if-statement empty body warning
  2020-03-08  5:01 [PATCH v2] fusion: fix if-statement empty body warning Randy Dunlap
@ 2020-03-09  7:14 ` Hannes Reinecke
  2020-03-10 22:48 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Hannes Reinecke @ 2020-03-09  7:14 UTC (permalink / raw
  To: Randy Dunlap, linux-scsi, Martin K. Petersen,
	James E.J. Bottomley, Bart Van Assche
  Cc: Sathya Prakash, Chaitra P B, Suganath Prabu Subramani,
	MPT-FusionLinux.pdl

On 3/8/20 6:01 AM, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
> 
> 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@infradead.org>
> Cc: Sathya Prakash <sathya.prakash@broadcom.com>
> Cc: Chaitra P B <chaitra.basappa@broadcom.com>
> Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
> Cc: MPT-FusionLinux.pdl@broadcom.com
> Cc: linux-scsi@vger.kernel.org
> Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
> Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
> Cc: Bart Van Assche <bvanassche@acm.org>
> Reviewed-by: Bart van Assche <bvanassche@acm.org>
> ---
> 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@suse.de>

Cheers,

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] fusion: fix if-statement empty body warning
  2020-03-08  5:01 [PATCH v2] fusion: fix if-statement empty body warning Randy Dunlap
  2020-03-09  7:14 ` Hannes Reinecke
@ 2020-03-10 22:48 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2020-03-10 22:48 UTC (permalink / raw
  To: Randy Dunlap
  Cc: linux-scsi, Martin K. Petersen, James E.J. Bottomley,
	Bart Van Assche, Sathya Prakash, Chaitra P B,
	Suganath Prabu Subramani, MPT-FusionLinux.pdl


Randy,

> When driver debugging is not enabled, change the debug print macros to
> use the no_printk() macro.

Applied to 5.7/scsi-queue, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-10 22:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-08  5:01 [PATCH v2] fusion: fix if-statement empty body warning Randy Dunlap
2020-03-09  7:14 ` Hannes Reinecke
2020-03-10 22:48 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.