Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: hwbm: if CONFIG_NET_HWBM unset, make stub functions static

If CONFIG_NET_HWBM is not set, then these stub functions in
<net/hwbm.h> should be declared static to avoid trying to
export them from any driver that includes this.

Fixes the following sparse warnings:

./include/net/hwbm.h:24:6: warning: symbol 'hwbm_buf_free' was not declared. Should it be static?
./include/net/hwbm.h:25:5: warning: symbol 'hwbm_pool_refill' was not declared. Should it be static?
./include/net/hwbm.h:26:5: warning: symbol 'hwbm_pool_add' was not declared. Should it be static?

Signed-off-by: Ben Dooks (Codethink) <ben.dooks@codethink.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Ben Dooks (Codethink) and committed by
David S. Miller
91e2e576 3f6b2c44

+7 -3
+7 -3
include/net/hwbm.h
··· 21 21 int hwbm_pool_refill(struct hwbm_pool *bm_pool, gfp_t gfp); 22 22 int hwbm_pool_add(struct hwbm_pool *bm_pool, unsigned int buf_num); 23 23 #else 24 - void hwbm_buf_free(struct hwbm_pool *bm_pool, void *buf) {} 25 - int hwbm_pool_refill(struct hwbm_pool *bm_pool, gfp_t gfp) { return 0; } 26 - int hwbm_pool_add(struct hwbm_pool *bm_pool, unsigned int buf_num) 24 + static inline void hwbm_buf_free(struct hwbm_pool *bm_pool, void *buf) {} 25 + 26 + static inline int hwbm_pool_refill(struct hwbm_pool *bm_pool, gfp_t gfp) 27 + { return 0; } 28 + 29 + static inline int hwbm_pool_add(struct hwbm_pool *bm_pool, 30 + unsigned int buf_num) 27 31 { return 0; } 28 32 #endif /* CONFIG_HWBM */ 29 33 #endif /* _HWBM_H */