]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ip_vs.h: fix implicit use of module_get/module_put from module.h
authorPaul Gortmaker <paul.gortmaker@windriver.com>
Mon, 29 Aug 2011 16:40:15 +0000 (12:40 -0400)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Thu, 6 Oct 2011 18:10:19 +0000 (14:10 -0400)
This file was using the module get/put functions in two simple inline
functions.  But module_get/put were only within scope because of
the implicit presence of module.h being everywhere.

Rather than add module.h to another file in include/  -- which is
exactly the thing we are trying to avoid, simply convert these
one-line functions into a define, as per what was done for the
device_schedule_callback() in commit 523ded71de0c5e669733.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
include/net/ip_vs.h

index 1aaf915656f3930b0b04253cd9171b3ba49a4d9c..1448d022a52256804e6cedfb6cafe22313b48be6 100644 (file)
@@ -1125,17 +1125,16 @@ int unregister_ip_vs_pe(struct ip_vs_pe *pe);
 struct ip_vs_pe *ip_vs_pe_getbyname(const char *name);
 struct ip_vs_pe *__ip_vs_pe_getbyname(const char *pe_name);
 
-static inline void ip_vs_pe_get(const struct ip_vs_pe *pe)
-{
-       if (pe && pe->module)
+/*
+ * Use a #define to avoid all of module.h just for these trivial ops
+ */
+#define ip_vs_pe_get(pe)                       \
+       if (pe && pe->module)                   \
                __module_get(pe->module);
-}
 
-static inline void ip_vs_pe_put(const struct ip_vs_pe *pe)
-{
-       if (pe && pe->module)
+#define ip_vs_pe_put(pe)                       \
+       if (pe && pe->module)                   \
                module_put(pe->module);
-}
 
 /*
  *     IPVS protocol functions (from ip_vs_proto.c)