diff mbox series

[net-next,v2] memory-provider: fix compilation issue without SYSFS

Message ID 20240913032824.2117095-1-almasrymina@google.com (mailing list archive)
State Accepted
Commit 52fa3b6532ec6f3a1e39bf869b304d3560dd983b
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v2] memory-provider: fix compilation issue without SYSFS | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 16 this patch: 16
netdev/build_tools success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers fail 2 blamed authors not CCed: asml.silence@gmail.com willemb@google.com; 7 maintainers not CCed: willemb@google.com daniel@iogearbox.net bpf@vger.kernel.org ast@kernel.org asml.silence@gmail.com hawk@kernel.org john.fastabend@gmail.com
netdev/build_clang success Errors and warnings before: 16 this patch: 16
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 39 this patch: 39
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Mina Almasry Sept. 13, 2024, 3:28 a.m. UTC
When CONFIG_SYSFS is not set, the kernel fails to compile:

     net/core/page_pool_user.c:368:45: error: implicit declaration of function 'get_netdev_rx_queue_index' [-Werror=implicit-function-declaration]
      368 |                 if (pool->slow.queue_idx == get_netdev_rx_queue_index(rxq)) {
          |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~

When CONFIG_SYSFS is not set, get_netdev_rx_queue_index() is not defined
as well.

Fix by removing the ifdef around get_netdev_rx_queue_index(). It is not
needed anymore after commit e817f85652c1 ("xdp: generic XDP handling of
xdp_rxq_info") removed most of the CONFIG_SYSFS ifdefs.

Fixes: 0f9214046893 ("memory-provider: dmabuf devmem memory provider")
Cc: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Mina Almasry <almasrymina@google.com>

---

v2:

- I (mina) sent v2 of Matthieu's fix.
- Remove the ifdef around the function definition. It's not needed
  anymore (Jakub)
---
 include/net/netdev_rx_queue.h | 2 --
 1 file changed, 2 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Sept. 13, 2024, 4:10 a.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 13 Sep 2024 03:28:24 +0000 you wrote:
> When CONFIG_SYSFS is not set, the kernel fails to compile:
> 
>      net/core/page_pool_user.c:368:45: error: implicit declaration of function 'get_netdev_rx_queue_index' [-Werror=implicit-function-declaration]
>       368 |                 if (pool->slow.queue_idx == get_netdev_rx_queue_index(rxq)) {
>           |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~
> 
> When CONFIG_SYSFS is not set, get_netdev_rx_queue_index() is not defined
> as well.
> 
> [...]

Here is the summary with links:
  - [net-next,v2] memory-provider: fix compilation issue without SYSFS
    https://git.kernel.org/netdev/net-next/c/52fa3b6532ec

You are awesome, thank you!
diff mbox series

Patch

diff --git a/include/net/netdev_rx_queue.h b/include/net/netdev_rx_queue.h
index ac34f5fb4f71..596836abf7bf 100644
--- a/include/net/netdev_rx_queue.h
+++ b/include/net/netdev_rx_queue.h
@@ -45,7 +45,6 @@  __netif_get_rx_queue(struct net_device *dev, unsigned int rxq)
 	return dev->_rx + rxq;
 }
 
-#ifdef CONFIG_SYSFS
 static inline unsigned int
 get_netdev_rx_queue_index(struct netdev_rx_queue *queue)
 {
@@ -55,7 +54,6 @@  get_netdev_rx_queue_index(struct netdev_rx_queue *queue)
 	BUG_ON(index >= dev->num_rx_queues);
 	return index;
 }
-#endif
 
 int netdev_rx_queue_restart(struct net_device *dev, unsigned int rxq);