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-next>] [day] [month] [year] [list]
Date:   Thu, 27 Feb 2020 18:09:44 -0800
From:   Randy Dunlap <rdunlap@...radead.org>
To:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        David Miller <davem@...emloft.net>
Cc:     Chas Williams <3chas3@...il.com>,
        linux-atm-general@...ts.sourceforge.net
Subject: [PATCH] atm: nicstar: fix if-statement empty body warning

From: Randy Dunlap <rdunlap@...radead.org>

When debugging via PRINTK() is not enabled, make the PRINTK()
macro be an empty do-while block.

Thix fixes a gcc warning when -Wextra is set:
../drivers/atm/nicstar.c:1819:23: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]

I have verified that there is no object code change (with gcc 7.5.0).

Signed-off-by: Randy Dunlap <rdunlap@...radead.org>
Cc: Chas Williams <3chas3@...il.com>
Cc: linux-atm-general@...ts.sourceforge.net
Cc: netdev@...r.kernel.org
Cc: David S. Miller <davem@...emloft.net>
---
 drivers/atm/nicstar.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20200225.orig/drivers/atm/nicstar.c
+++ linux-next-20200225/drivers/atm/nicstar.c
@@ -91,7 +91,7 @@
 #ifdef GENERAL_DEBUG
 #define PRINTK(args...) printk(args)
 #else
-#define PRINTK(args...)
+#define PRINTK(args...) do {} while (0)
 #endif /* GENERAL_DEBUG */
 
 #ifdef EXTRA_DEBUG

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ