Skip to content

Commit

Permalink
page_pool: fix compile warning when CONFIG_PAGE_POOL is disabled
Browse files Browse the repository at this point in the history
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: 99c07c4 ("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>
  • Loading branch information
Jesper Dangaard Brouer authored and David S. Miller committed Jun 20, 2019
1 parent 84ce4d0 commit 497ad9f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/net/page_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 497ad9f

Please sign in to comment.