Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1355308 > unrolled thread

[PATCH] kcm: mark helper functions inline

Started byArnd Bergmann <arnd@arndb.de>
First post2016-03-10 19:40 +0100
Last post2016-03-10 20:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] kcm: mark helper functions inline Arnd Bergmann <arnd@arndb.de> - 2016-03-10 19:40 +0100
    Re: [PATCH] kcm: mark helper functions inline David Miller <davem@davemloft.net> - 2016-03-10 20:50 +0100

#1355308 — [PATCH] kcm: mark helper functions inline

FromArnd Bergmann <arnd@arndb.de>
Date2016-03-10 19:40 +0100
Subject[PATCH] kcm: mark helper functions inline
Message-ID<rbdF8-2tR-3@gated-at.bofh.it>
The stub helper functions for the newly added kcm_proc_init/exit interfaces
are defined as 'static' in a header file, which leads to build warnings for
each file that includes them without calling them:

include/net/kcm.h:183:12: error: 'kcm_proc_init' defined but not used [-Werror=unused-function]
include/net/kcm.h:184:13: error: 'kcm_proc_exit' defined but not used [-Werror=unused-function]

This marks the two functions as 'static inline' instead, which avoids the
warnings and is obviously what was meant here.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: cd6e111bf5be ("kcm: Add statistics and proc interfaces")
---
 include/net/kcm.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/net/kcm.h b/include/net/kcm.h
index 95c425ca97b6..2840b5825dcc 100644
--- a/include/net/kcm.h
+++ b/include/net/kcm.h
@@ -180,8 +180,8 @@ struct kcm_mux {
 int kcm_proc_init(void);
 void kcm_proc_exit(void);
 #else
-static int kcm_proc_init(void) { return 0; }
-static void kcm_proc_exit(void) { }
+static inline int kcm_proc_init(void) { return 0; }
+static inline void kcm_proc_exit(void) { }
 #endif
 
 static inline void aggregate_psock_stats(struct kcm_psock_stats *stats,
-- 
2.7.0

[toc] | [next] | [standalone]


#1355350

FromDavid Miller <davem@davemloft.net>
Date2016-03-10 20:50 +0100
Message-ID<rbeKS-37I-5@gated-at.bofh.it>
In reply to#1355308
From: Arnd Bergmann <arnd@arndb.de>
Date: Thu, 10 Mar 2016 19:31:12 +0100

> The stub helper functions for the newly added kcm_proc_init/exit interfaces
> are defined as 'static' in a header file, which leads to build warnings for
> each file that includes them without calling them:
> 
> include/net/kcm.h:183:12: error: 'kcm_proc_init' defined but not used [-Werror=unused-function]
> include/net/kcm.h:184:13: error: 'kcm_proc_exit' defined but not used [-Werror=unused-function]
> 
> This marks the two functions as 'static inline' instead, which avoids the
> warnings and is obviously what was meant here.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: cd6e111bf5be ("kcm: Add statistics and proc interfaces")

Applied, thanks Arnd.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web