[PATCH] ppp: dead code cleanup in Kconfig

Julian Braha posted 1 patch 1 day, 10 hours ago
drivers/net/ppp/Kconfig | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
[PATCH] ppp: dead code cleanup in Kconfig
Posted by Julian Braha 1 day, 10 hours ago
There is already an 'if PPP' condition wrapping several config options
e.g. PPP_MPPE and PPPOE, making the 'depends on PPP' statement for each of
these a duplicate dependency (dead code).

I propose leaving the outer 'if PPP...endif' and removing the individual
'depends on PPP' statement from each option.

This dead code was found by kconfirm, a static analysis tool for Kconfig.

Signed-off-by: Julian Braha <julianbraha@gmail.com>
---
 drivers/net/ppp/Kconfig | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ppp/Kconfig b/drivers/net/ppp/Kconfig
index a1806b4b84be..f57fba84fe55 100644
--- a/drivers/net/ppp/Kconfig
+++ b/drivers/net/ppp/Kconfig
@@ -37,7 +37,6 @@ if PPP
 
 config PPP_BSDCOMP
 	tristate "PPP BSD-Compress compression"
-	depends on PPP
 	help
 	  Support for the BSD-Compress compression method for PPP, which uses
 	  the LZW compression method to compress each PPP packet before it is
@@ -56,7 +55,6 @@ config PPP_BSDCOMP
 
 config PPP_DEFLATE
 	tristate "PPP Deflate compression"
-	depends on PPP
 	select ZLIB_INFLATE
 	select ZLIB_DEFLATE
 	help
@@ -71,7 +69,6 @@ config PPP_DEFLATE
 
 config PPP_FILTER
 	bool "PPP filtering"
-	depends on PPP
 	help
 	  Say Y here if you want to be able to filter the packets passing over
 	  PPP interfaces.  This allows you to control which packets count as
@@ -84,7 +81,6 @@ config PPP_FILTER
 
 config PPP_MPPE
 	tristate "PPP MPPE compression (encryption)"
-	depends on PPP
 	select CRYPTO_LIB_ARC4
 	select CRYPTO_LIB_SHA1
 	help
@@ -96,7 +92,6 @@ config PPP_MPPE
 
 config PPP_MULTILINK
 	bool "PPP multilink support"
-	depends on PPP
 	help
 	  PPP multilink is a protocol (defined in RFC 1990) which allows you
 	  to combine several (logical or physical) lines into one logical PPP
@@ -109,7 +104,7 @@ config PPP_MULTILINK
 
 config PPPOATM
 	tristate "PPP over ATM"
-	depends on ATM && PPP
+	depends on ATM
 	help
 	  Support PPP (Point to Point Protocol) encapsulated in ATM frames.
 	  This implementation does not yet comply with section 8 of RFC2364,
@@ -118,7 +113,6 @@ config PPPOATM
 
 config PPPOE
 	tristate "PPP over Ethernet"
-	depends on PPP
 	help
 	  Support for PPP over Ethernet.
 
@@ -164,7 +158,7 @@ config PPPOE_HASH_BITS
 
 config PPTP
 	tristate "PPP over IPv4 (PPTP)"
-	depends on PPP && NET_IPGRE_DEMUX
+	depends on NET_IPGRE_DEMUX
 	help
 	  Support for PPP over IPv4.(Point-to-Point Tunneling Protocol)
 
@@ -175,7 +169,7 @@ config PPTP
 
 config PPPOL2TP
 	tristate "PPP over L2TP"
-	depends on L2TP && PPP
+	depends on L2TP
 	help
 	  Support for PPP-over-L2TP socket family. L2TP is a protocol
 	  used by ISPs and enterprises to tunnel PPP traffic over UDP
@@ -184,7 +178,6 @@ if TTY
 
 config PPP_ASYNC
 	tristate "PPP support for async serial ports"
-	depends on PPP
 	select CRC_CCITT
 	help
 	  Say Y (or M) here if you want to be able to use PPP over standard
@@ -198,7 +191,6 @@ config PPP_ASYNC
 
 config PPP_SYNC_TTY
 	tristate "PPP support for sync tty ports"
-	depends on PPP
 	help
 	  Say Y (or M) here if you want to be able to use PPP over synchronous
 	  (HDLC) tty devices, such as the SyncLink adapter. These devices
-- 
2.51.2
Re: [PATCH] ppp: dead code cleanup in Kconfig
Posted by Qingfang Deng 1 day, 2 hours ago
On Mon, 30 Mar 2026 22:32:58 +0100, Julian Braha wrote:
> There is already an 'if PPP' condition wrapping several config options
> e.g. PPP_MPPE and PPPOE, making the 'depends on PPP' statement for each of
> these a duplicate dependency (dead code).
> 
> I propose leaving the outer 'if PPP...endif' and removing the individual
> 'depends on PPP' statement from each option.
> 
> This dead code was found by kconfirm, a static analysis tool for Kconfig.
> 
> Signed-off-by: Julian Braha <julianbraha@gmail.com>

Reviewed-by: Qingfang Deng <dqfext@gmail.com>