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]
Message-Id: <1422422779-3876-1-git-send-email-behanw@converseincode.com>
Date:	Tue, 27 Jan 2015 21:26:19 -0800
From:	Behan Webster <behanw@...verseincode.com>
To:	torvalds@...ux-foundation.org
Cc:	behanw@...verseincode.com, linux-kernel@...r.kernel.org,
	Arnd Bergmann <arnd@...db.de>,
	"Christopher Li" <sparse@...isli.org>
Subject: [PATCH] Mark inline functions as __maybe_unused

clang warns if inline functions aren't used. By making them __maybe_unused
there is no warning for either gcc nor clang.

Signed-off-by: Behan Webster <behanw@...verseincode.com>
Suggested-by: Arnd Bergmann <arnd@...db.de>
Cc: Arnd Bergmann <arnd@...db.de>
Cc: "Christopher Li" <sparse@...isli.org>
---
 include/linux/compiler-gcc.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 02ae99e..c7b98fb 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -53,14 +53,14 @@
  */
 #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
     !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4)
-# define inline		inline		__attribute__((always_inline)) notrace
-# define __inline__	__inline__	__attribute__((always_inline)) notrace
-# define __inline	__inline	__attribute__((always_inline)) notrace
+# define inline		inline		__attribute__((always_inline)) notrace __maybe_unused
+# define __inline__	__inline__	__attribute__((always_inline)) notrace __maybe_unused
+# define __inline	__inline	__attribute__((always_inline)) notrace __maybe_unused
 #else
 /* A lot of inline functions can cause havoc with function tracing */
-# define inline		inline		notrace
-# define __inline__	__inline__	notrace
-# define __inline	__inline	notrace
+# define inline		inline		notrace __maybe_unused
+# define __inline__	__inline__	notrace __maybe_unused
+# define __inline	__inline	notrace __maybe_unused
 #endif
 
 #define __deprecated			__attribute__((deprecated))
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ