lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231218115802.15859-1-lukas.bulwahn@gmail.com>
Date: Mon, 18 Dec 2023 12:58:02 +0100
From: Lukas Bulwahn <lukas.bulwahn@...il.com>
To: Rafał Miłecki <zajec5@...il.com>,
	"David S . Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>,
	Kalle Valo <kvalo@...nel.org>,
	Larry Finger <Larry.Finger@...inger.net>,
	Arend van Spriel <aspriel@...il.com>,
	Franky Lin <franky.lin@...adcom.com>,
	Hante Meuleman <hante.meuleman@...adcom.com>,
	Michael Buesch <m@...s.ch>,
	linux-wireless@...r.kernel.org,
	netdev@...r.kernel.org,
	b43-dev@...ts.infradead.org,
	brcm80211-dev-list.pdl@...adcom.com,
	SHA-cyfmac-dev-list@...ineon.com
Cc: kernel-janitors@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Lukas Bulwahn <lukas.bulwahn@...il.com>
Subject: [PATCH] bcma,ssb: simplify dependency handling for bcma and ssb drivers

The files, drivers/bcma/Kconfig and drivers/ssb/Kconfig, define two helper
config options BCMA_POSSIBLE and SSB_POSSIBLE. Both options are defined
identical:

config {BCMA_POSSIBLE,SSB_POSSIBLE}
	bool
	depends on HAS_IOMEM && HAS_DMA
	default y

While this kind of duplication might still be acceptable in order to have
both sections work independently of each other, it really gets strange when
looking how they are then used in expression where both of those configs
appear. E.g., config B43's dependency is:

  (BCMA_POSSIBLE || SSB_POSSIBLE) && MAC80211 && HAS_DMA

Note that BCMA_POSSIBLE and SSB_POSSIBLE identical and already have HAS_DMA
as condition, so that is then also another duplication.

Another example is the choice Supported bus types in B43, which already
depends on B43 and hence, we know that HAS_IOMEM && HAS_DMA holds, so all
stated dependencies in the choice are true in all cases.

Given this whole confusion around the use of these two symbols, just remove
them and replace them with the expression they intend to abbreviate.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@...il.com>
---
 drivers/bcma/Kconfig                            | 7 +------
 drivers/net/ethernet/broadcom/Kconfig           | 4 ++--
 drivers/net/wireless/broadcom/b43/Kconfig       | 5 +----
 drivers/net/wireless/broadcom/b43legacy/Kconfig | 2 +-
 drivers/net/wireless/broadcom/brcm80211/Kconfig | 3 +--
 drivers/ssb/Kconfig                             | 7 +------
 6 files changed, 7 insertions(+), 21 deletions(-)

diff --git a/drivers/bcma/Kconfig b/drivers/bcma/Kconfig
index b9558ff20830..26bb2a28c7db 100644
--- a/drivers/bcma/Kconfig
+++ b/drivers/bcma/Kconfig
@@ -1,12 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
-config BCMA_POSSIBLE
-	bool
-	depends on HAS_IOMEM && HAS_DMA
-	default y
-
 menuconfig BCMA
 	tristate "Broadcom specific AMBA"
-	depends on BCMA_POSSIBLE
+	depends on HAS_IOMEM && HAS_DMA
 	help
 	  Bus driver for Broadcom specific Advanced Microcontroller Bus
 	  Architecture.
diff --git a/drivers/net/ethernet/broadcom/Kconfig b/drivers/net/ethernet/broadcom/Kconfig
index 75ca3ddda1f5..8abbdb88459c 100644
--- a/drivers/net/ethernet/broadcom/Kconfig
+++ b/drivers/net/ethernet/broadcom/Kconfig
@@ -6,7 +6,7 @@
 config NET_VENDOR_BROADCOM
 	bool "Broadcom devices"
 	default y
-	depends on (SSB_POSSIBLE && HAS_DMA) || PCI || BCM63XX || \
+	depends on (HAS_IOMEM && HAS_DMA) || PCI || BCM63XX || \
 		   SIBYTE_SB1xxx_SOC
 	help
 	  If you have a network (Ethernet) chipset belonging to this class,
@@ -21,7 +21,7 @@ if NET_VENDOR_BROADCOM
 
 config B44
 	tristate "Broadcom 440x/47xx ethernet support"
-	depends on SSB_POSSIBLE && HAS_DMA
+	depends on HAS_IOMEM && HAS_DMA
 	select SSB
 	select MII
 	select PHYLIB
diff --git a/drivers/net/wireless/broadcom/b43/Kconfig b/drivers/net/wireless/broadcom/b43/Kconfig
index 4559549b80fe..f53eaa8b11cd 100644
--- a/drivers/net/wireless/broadcom/b43/Kconfig
+++ b/drivers/net/wireless/broadcom/b43/Kconfig
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config B43
 	tristate "Broadcom 43xx wireless support (mac80211 stack)"
-	depends on (BCMA_POSSIBLE || SSB_POSSIBLE) && MAC80211 && HAS_DMA
+	depends on HAS_IOMEM && HAS_DMA && MAC80211
 	select BCMA if B43_BCMA
 	select SSB if B43_SSB
 	select FW_LOADER
@@ -42,18 +42,15 @@ choice
 
 config B43_BUSES_BCMA_AND_SSB
 	bool "BCMA and SSB"
-	depends on BCMA_POSSIBLE && SSB_POSSIBLE
 	select B43_BCMA
 	select B43_SSB
 
 config B43_BUSES_BCMA
 	bool "BCMA only"
-	depends on BCMA_POSSIBLE
 	select B43_BCMA
 
 config B43_BUSES_SSB
 	bool "SSB only"
-	depends on SSB_POSSIBLE
 	select B43_SSB
 
 endchoice
diff --git a/drivers/net/wireless/broadcom/b43legacy/Kconfig b/drivers/net/wireless/broadcom/b43legacy/Kconfig
index e4da34ec4f5b..ff11c63b5248 100644
--- a/drivers/net/wireless/broadcom/b43legacy/Kconfig
+++ b/drivers/net/wireless/broadcom/b43legacy/Kconfig
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config B43LEGACY
 	tristate "Broadcom 43xx-legacy wireless support (mac80211 stack)"
-	depends on SSB_POSSIBLE && MAC80211 && HAS_DMA
+	depends on HAS_IOMEM && HAS_DMA && MAC80211
 	select SSB
 	select FW_LOADER
 	help
diff --git a/drivers/net/wireless/broadcom/brcm80211/Kconfig b/drivers/net/wireless/broadcom/brcm80211/Kconfig
index 3a1a35b5672f..2e1db48201ff 100644
--- a/drivers/net/wireless/broadcom/brcm80211/Kconfig
+++ b/drivers/net/wireless/broadcom/brcm80211/Kconfig
@@ -4,8 +4,7 @@ config BRCMUTIL
 
 config BRCMSMAC
 	tristate "Broadcom IEEE802.11n PCIe SoftMAC WLAN driver"
-	depends on MAC80211
-	depends on BCMA_POSSIBLE
+	depends on HAS_IOMEM && HAS_DMA && MAC80211
 	select BCMA
 	select BRCMUTIL
 	select FW_LOADER
diff --git a/drivers/ssb/Kconfig b/drivers/ssb/Kconfig
index 1cf1a98952fa..0a6d5a60b5a8 100644
--- a/drivers/ssb/Kconfig
+++ b/drivers/ssb/Kconfig
@@ -1,12 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
-config SSB_POSSIBLE
-	bool
-	depends on HAS_IOMEM && HAS_DMA
-	default y
-
 menuconfig SSB
 	tristate "Sonics Silicon Backplane support"
-	depends on SSB_POSSIBLE
+	depends on HAS_IOMEM && HAS_DMA
 	help
 	  Support for the Sonics Silicon Backplane bus.
 	  You only need to enable this option, if you are
-- 
2.17.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ