From: Behan Webster <behanw@converseincode.com>
To: torvalds@linux-foundation.org
Cc: behanw@converseincode.com, linux-kernel@vger.kernel.org,
Arnd Bergmann <arnd@arndb.de>,
"Christopher Li" <sparse@chrisli.org>
Subject: [PATCH] Mark inline functions as __maybe_unused
Date: Tue, 27 Jan 2015 21:26:19 -0800 [thread overview]
Message-ID: <1422422779-3876-1-git-send-email-behanw@converseincode.com> (raw)
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@converseincode.com>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "Christopher Li" <sparse@chrisli.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
next reply other threads:[~2015-01-28 5:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-28 5:26 Behan Webster [this message]
2015-01-28 10:04 ` Måns Rullgård
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1422422779-3876-1-git-send-email-behanw@converseincode.com \
--to=behanw@converseincode.com \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=sparse@chrisli.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®