Skip to contentSkip to conversation

ssb: mark ssb_bus_register as __maybe_unused

PATCH Superseded Arnd Bergmann 3 participants 5 messages Nov 3, 2015

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ssb: mark ssb_bus_register as __maybe_unused

The SoC variant of the ssb code is now optional like the other ones, which means we can build the framwork without any front-end, but that results in a warning:

drivers/ssb/main.c:616:12: warning: 'ssb_bus_register' defined but not used [-Wunused-function]

This annotates the ssb_bus_register function as __maybe_unused to shut up the warning. A configuration like this will not work on any hardware of course, but we still want this to silently build without warnings if the configuration is allowed in the first place.

Fixes 845da6e58e19 ("ssb: add Kconfig entry for compiling SoC related code")

----
This showed up on ARM at91_defconfig and sama5_defconfig, so we should probably change those configurations as well. I can't see why they enable CONFIG_SSB when they do not use any drivers for this framework.

drivers/ssb/main.c +4 -3
index 5d1e9a0fc389..e2ff6b5b2094 100644
@@ -613,9 +613,10 @@ out:
 	return err;
 }
 
-static int ssb_bus_register(struct ssb_bus *bus,
-			    ssb_invariants_func_t get_invariants,
-			    unsigned long baseaddr)
+static int __maybe_unused
+ssb_bus_register(struct ssb_bus *bus,
+		 ssb_invariants_func_t get_invariants,
+		 unsigned long baseaddr)
 {
 	int err;
 
#1 lore raw

PATCH 1/1 ARM: at91/defconfig: remove CONFIG_SSB from Atmel defconfigs

This "Sonics Silicon Backplane" support is not needed on Atmel SoCs: remove it.

---
Arnd,

Here is the patch that fixes what you highlighted in your patch "[PATCH] ssb:
mark ssb_bus_register as __maybe_unused". Indeed, there is no reason for enabling this option.

Thanks for the heads up, bye,
Nicolas.

 arch/arm/configs/at91_dt_defconfig | 1 -
 arch/arm/configs/sama5_defconfig   | 1 -
 2 files changed, 2 deletions(-)
arch/arm/configs/at91_dt_defconfig +0 -1
index 1b1e5acd76e2..e4b1be66b3f5 100644
@@ -125,7 +125,6 @@ CONFIG_POWER_RESET=y
 # CONFIG_HWMON is not set
 CONFIG_WATCHDOG=y
 CONFIG_AT91SAM9X_WATCHDOG=y
-CONFIG_SSB=m
 CONFIG_MFD_ATMEL_HLCDC=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
arch/arm/configs/sama5_defconfig +0 -1
index a0c57ac88b27..63f7e6ce649a 100644
@@ -129,7 +129,6 @@ CONFIG_GPIO_SYSFS=y
 CONFIG_POWER_SUPPLY=y
 CONFIG_POWER_RESET=y
 # CONFIG_HWMON is not set
-CONFIG_SSB=m
 CONFIG_MFD_ATMEL_FLEXCOM=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
Signature · 1 line
2.1.3
maintainer
#2 lore raw
In reply to Arnd Bergmann
Quoted 11 lines · On Tue, 03 Nov 2015 16:05:51 +0100 Arnd Bergmann <[email protected]> wrote:

The SoC variant of the ssb code is now optional like the other ones, which means we can build the framwork without any front-end, but that results in a warning:

drivers/ssb/main.c:616:12: warning: 'ssb_bus_register' defined but not used [-Wunused-function]

This annotates the ssb_bus_register function as __maybe_unused to shut up the warning. A configuration like this will not work on any hardware of course, but we still want this to silently build without warnings if the configuration is allowed in the first place.

Is there a simple way to disallow this configuration?

Signature · 1 line
Michael
#3 lore raw
Quoted 9 lines · On Tuesday 03 November 2015 17:27:21 Michael Büsch wrote:
Quoted 6 lines · On Tue, 03 Nov 2015 16:05:51 +0100 Arnd Bergmann <[email protected]> wrote:

The SoC variant of the ssb code is now optional like the other ones, which means we can build the framwork without any front-end, but that results in a warning:

drivers/ssb/main.c:616:12: warning: 'ssb_bus_register' defined but not used [-Wunused-function]

Quoted 8 lines
Quoted 5 lines

This annotates the ssb_bus_register function as __maybe_unused to shut up the warning. A configuration like this will not work on any hardware of course, but we still want this to silently build without warnings if the configuration is allowed in the first place.

Is there a simple way to disallow this configuration?

I could not come up with a simple one. We could turn 'CONFIG_SSB' into a silent option and have it selected by each bus specific driver, but then we also have to change all the device drivers (usb and wireless I guess) to use 'depends on' rather than 'select'.

Arnd

maintainer Acked-by
#4 lore raw
Quoted 17 lines · On Tue, 03 Nov 2015 17:42:26 +0100 Arnd Bergmann <[email protected]> wrote:
Quoted 16 lines · On Tuesday 03 November 2015 17:27:21 Michael Büsch wrote:
Quoted 11 lines · On Tue, 03 Nov 2015 16:05:51 +0100 Arnd Bergmann <[email protected]> wrote:

The SoC variant of the ssb code is now optional like the other ones, which means we can build the framwork without any front-end, but that results in a warning:

drivers/ssb/main.c:616:12: warning: 'ssb_bus_register' defined but not used [-Wunused-function]

This annotates the ssb_bus_register function as __maybe_unused to shut up the warning. A configuration like this will not work on any hardware of course, but we still want this to silently build without warnings if the configuration is allowed in the first place.

Quoted 6 lines
Quoted 1 line

Is there a simple way to disallow this configuration?

I could not come up with a simple one. We could turn 'CONFIG_SSB' into a silent option and have it selected by each bus specific driver, but then we also have to change all the device drivers (usb and wireless I guess) to use 'depends on' rather than 'select'.

The other way around?
The drivers already select SSB. However I think we should have SSB selectable by user for the embedded case.

But well, I can live with this patch then. Kalle, you might apply it with

Signature · 1 line
Michael