summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesper Dangaard Brouer <brouer@redhat.com>2019-06-20 00:15:52 +0200
committerDavid S. Miller <davem@davemloft.net>2019-06-19 21:26:06 -0400
commit497ad9f5b2dc86b733761b9afa44ecfa2f17be65 (patch)
tree7c6f7680246219995492146e79ae3832d118a422
parent84ce4d0f9f55b4f4ca4d4edcbb54a23d9dad1aae (diff)
downloadlinux-497ad9f5b2dc86b733761b9afa44ecfa2f17be65.tar.bz2
page_pool: fix compile warning when CONFIG_PAGE_POOL is disabled
Kbuild test robot reported compile warning: warning: no return statement in function returning non-void in function page_pool_request_shutdown, when CONFIG_PAGE_POOL is disabled. The fix makes the code a little more verbose, with a descriptive variable. Fixes: 99c07c43c4ea ("xdp: tracking page_pool resources and safe removal") Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/page_pool.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/net/page_pool.h b/include/net/page_pool.h
index f09b3f1994e6..f07c518ef8a5 100644
--- a/include/net/page_pool.h
+++ b/include/net/page_pool.h
@@ -156,12 +156,12 @@ static inline void page_pool_recycle_direct(struct page_pool *pool,
bool __page_pool_request_shutdown(struct page_pool *pool);
static inline bool page_pool_request_shutdown(struct page_pool *pool)
{
- /* When page_pool isn't compiled-in, net/core/xdp.c doesn't
- * allow registering MEM_TYPE_PAGE_POOL, but shield linker.
- */
+ bool safe_to_remove = false;
+
#ifdef CONFIG_PAGE_POOL
- return __page_pool_request_shutdown(pool);
+ safe_to_remove = __page_pool_request_shutdown(pool);
#endif
+ return safe_to_remove;
}
/* Disconnects a page (from a page_pool). API users can have a need