netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] page_pool: fix compile warning when CONFIG_PAGE_POOL is disabled
@ 2019-06-19 22:15 Jesper Dangaard Brouer
  2019-06-20  1:26 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jesper Dangaard Brouer @ 2019-06-19 22:15 UTC (permalink / raw)
  To: Jesper Dangaard Brouer; +Cc: netdev

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>
---
 include/net/page_pool.h |    8 ++++----
 1 file 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] page_pool: fix compile warning when CONFIG_PAGE_POOL is disabled
  2019-06-19 22:15 [PATCH] page_pool: fix compile warning when CONFIG_PAGE_POOL is disabled Jesper Dangaard Brouer
@ 2019-06-20  1:26 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-06-20  1:26 UTC (permalink / raw)
  To: brouer; +Cc: netdev

From: Jesper Dangaard Brouer <brouer@redhat.com>
Date: Thu, 20 Jun 2019 00:15:52 +0200

> 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>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-20  1:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-19 22:15 [PATCH] page_pool: fix compile warning when CONFIG_PAGE_POOL is disabled Jesper Dangaard Brouer
2019-06-20  1:26 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).