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

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>

authored by

Jesper Dangaard Brouer and committed by
David S. Miller
497ad9f5 84ce4d0f

+4 -4
+4 -4
include/net/page_pool.h
··· 156 156 bool __page_pool_request_shutdown(struct page_pool *pool); 157 157 static inline bool page_pool_request_shutdown(struct page_pool *pool) 158 158 { 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 + 162 161 #ifdef CONFIG_PAGE_POOL 163 - return __page_pool_request_shutdown(pool); 162 + safe_to_remove = __page_pool_request_shutdown(pool); 164 163 #endif 164 + return safe_to_remove; 165 165 } 166 166 167 167 /* Disconnects a page (from a page_pool). API users can have a need