Commit 91e2e576 authored by Ben Dooks (Codethink)'s avatar Ben Dooks (Codethink) Committed by David S. Miller

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: default avatarBen Dooks (Codethink) <ben.dooks@codethink.co.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3f6b2c44
...@@ -21,9 +21,13 @@ void hwbm_buf_free(struct hwbm_pool *bm_pool, void *buf); ...@@ -21,9 +21,13 @@ void hwbm_buf_free(struct hwbm_pool *bm_pool, void *buf);
int hwbm_pool_refill(struct hwbm_pool *bm_pool, gfp_t gfp); int hwbm_pool_refill(struct hwbm_pool *bm_pool, gfp_t gfp);
int hwbm_pool_add(struct hwbm_pool *bm_pool, unsigned int buf_num); int hwbm_pool_add(struct hwbm_pool *bm_pool, unsigned int buf_num);
#else #else
void hwbm_buf_free(struct hwbm_pool *bm_pool, void *buf) {} static inline void hwbm_buf_free(struct hwbm_pool *bm_pool, void *buf) {}
int hwbm_pool_refill(struct hwbm_pool *bm_pool, gfp_t gfp) { return 0; }
int hwbm_pool_add(struct hwbm_pool *bm_pool, unsigned int buf_num) static inline int hwbm_pool_refill(struct hwbm_pool *bm_pool, gfp_t gfp)
{ return 0; }
static inline int hwbm_pool_add(struct hwbm_pool *bm_pool,
unsigned int buf_num)
{ return 0; } { return 0; }
#endif /* CONFIG_HWBM */ #endif /* CONFIG_HWBM */
#endif /* _HWBM_H */ #endif /* _HWBM_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment