Skip to content

Commit 497ad9f

Browse files
netoptimizerdavem330
authored andcommitted
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: 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>
1 parent 84ce4d0 commit 497ad9f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎include/net/page_pool.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,12 @@ static inline void page_pool_recycle_direct(struct page_pool *pool,
156156
bool __page_pool_request_shutdown(struct page_pool *pool);
157157
static inline bool page_pool_request_shutdown(struct page_pool *pool)
158158
{
159-
/* When page_pool isn't compiled-in, net/core/xdp.c doesn't
160-
* allow registering MEM_TYPE_PAGE_POOL, but shield linker.
161-
*/
159+
bool safe_to_remove = false;
160+
162161
#ifdef CONFIG_PAGE_POOL
163-
return __page_pool_request_shutdown(pool);
162+
safe_to_remove = __page_pool_request_shutdown(pool);
164163
#endif
164+
return safe_to_remove;
165165
}
166166

167167
/* Disconnects a page (from a page_pool). API users can have a need

0 commit comments

Comments
 (0)