[PATCH] printk: add CONFIG_PRINTK dependency for netconsole

Arnd Bergmann posted 1 patch 1 month, 2 weeks ago
drivers/net/Kconfig | 1 +
1 file changed, 1 insertion(+)
[PATCH] printk: add CONFIG_PRINTK dependency for netconsole
Posted by Arnd Bergmann 1 month, 2 weeks ago
From: Arnd Bergmann <arnd@arndb.de>

The 'select PRINTK_EXECUTION_CTX' line now causes a harmless warning
when NETCONSOLE_DYNAMIC is enabled but PRINTK is not:

WARNING: unmet direct dependencies detected for PRINTK_EXECUTION_CTX
  Depends on [n]: PRINTK [=n]
  Selected by [y]:
  - NETCONSOLE_DYNAMIC [=y] && NETDEVICES [=y] && NET_CORE [=y] && NETCONSOLE [=y] && SYSFS [=y] && CONFIGFS_FS [=y] && (NETCONSOLE [=y]!=y [=y] || CONFIGFS_FS [=y]!=m [=m])

In that configuration, the netconsole driver is useless anyway, so
avoid this with an added dependency that prevents CONFIG_NETCONSOLE
to be enabled without CONFIG_PRINTK.

Fixes: 60325c27d3cf ("printk: Add execution context (task name/CPU) to printk_info")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 4154a6f98c74..93d78b201d63 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -333,6 +333,7 @@ config MACSEC
 
 config NETCONSOLE
 	tristate "Network console logging support"
+	depends on PRINTK
 	help
 	  If you want to log kernel messages over the network, enable this.
 	  See <file:Documentation/networking/netconsole.rst> for details.
-- 
2.39.5
Re: [PATCH] printk: add CONFIG_PRINTK dependency for netconsole
Posted by Simon Horman 1 month, 2 weeks ago
On Fri, Feb 13, 2026 at 08:44:00AM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The 'select PRINTK_EXECUTION_CTX' line now causes a harmless warning
> when NETCONSOLE_DYNAMIC is enabled but PRINTK is not:
> 
> WARNING: unmet direct dependencies detected for PRINTK_EXECUTION_CTX
>   Depends on [n]: PRINTK [=n]
>   Selected by [y]:
>   - NETCONSOLE_DYNAMIC [=y] && NETDEVICES [=y] && NET_CORE [=y] && NETCONSOLE [=y] && SYSFS [=y] && CONFIGFS_FS [=y] && (NETCONSOLE [=y]!=y [=y] || CONFIGFS_FS [=y]!=m [=m])
> 
> In that configuration, the netconsole driver is useless anyway, so
> avoid this with an added dependency that prevents CONFIG_NETCONSOLE
> to be enabled without CONFIG_PRINTK.
> 
> Fixes: 60325c27d3cf ("printk: Add execution context (task name/CPU) to printk_info")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Simon Horman <horms@kernel.org>