Skip to content

Commit 69e7dae

Browse files
author
Paul Gortmaker
committed
ip_vs.h: fix implicit use of module_get/module_put from module.h
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 523ded7. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
1 parent 34641c6 commit 69e7dae

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

‎include/net/ip_vs.h‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,17 +1126,16 @@ int unregister_ip_vs_pe(struct ip_vs_pe *pe);
11261126
struct ip_vs_pe *ip_vs_pe_getbyname(const char *name);
11271127
struct ip_vs_pe *__ip_vs_pe_getbyname(const char *pe_name);
11281128

1129-
static inline void ip_vs_pe_get(const struct ip_vs_pe *pe)
1130-
{
1131-
if (pe && pe->module)
1129+
/*
1130+
* Use a #define to avoid all of module.h just for these trivial ops
1131+
*/
1132+
#define ip_vs_pe_get(pe) \
1133+
if (pe && pe->module) \
11321134
__module_get(pe->module);
1133-
}
11341135

1135-
static inline void ip_vs_pe_put(const struct ip_vs_pe *pe)
1136-
{
1137-
if (pe && pe->module)
1136+
#define ip_vs_pe_put(pe) \
1137+
if (pe && pe->module) \
11381138
module_put(pe->module);
1139-
}
11401139

11411140
/*
11421141
* IPVS protocol functions (from ip_vs_proto.c)

0 commit comments

Comments
 (0)