Skip to contentSkip to conversation

ARM: samsung warning fixes

PATCH In review Arnd Bergmann 2 participants 13 messages Jan 29, 2016 – Feb 1, 2016

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

cover ARM: samsung warning fixes

These are all patches addressing harmless warnings I found in my randconfig tests. Please merge into the samsung fixes branch for 4.6.

Arnd

#1 lore raw

PATCH 1/6 ARM: s3c24xx: don't select EEPROM_AT24

EEPROM_AT24 depends on both I2C and SYSFS. We have in the past added I2C 'select' statements to avoid build problems with the first, but we still get a warning because of the second:

warning: (MACH_DAVINCI_EVM && MACH_SFFSDR && MACH_DAVINCI_DM6467_EVM && MACH_DAVINCI_DM365_EVM && MACH_DAVINCI_DA830_EVM && MACH_MITYOMAPL138 && MACH_MINI2440) selects EEPROM_AT24 which has unmet direct dependencies (I2C && SYSFS)

This removes the 'select' statements again, and forces users to enable the driver in their configuration files, as we do for most other drivers.

---
 arch/arm/configs/mini2440_defconfig | 1 +
 arch/arm/configs/s3c2410_defconfig  | 1 +
 arch/arm/mach-s3c24xx/Kconfig       | 1 -
 3 files changed, 2 insertions(+), 1 deletion(-)
arch/arm/configs/mini2440_defconfig +1 -0
index 9c93f5655248..0b02e4f43c6a 100644
@@ -158,6 +158,7 @@ CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_S3C2410=y
 CONFIG_I2C_SIMTEC=y
+CONFIG_EEPROM_AT24=y
 CONFIG_SPI=y
 CONFIG_SPI_S3C24XX=y
 CONFIG_SPI_SPIDEV=y
arch/arm/configs/s3c2410_defconfig +1 -0
index f3142369f594..b3ade552a2a5 100644
@@ -290,6 +290,7 @@ CONFIG_HW_RANDOM=y
 CONFIG_I2C_CHARDEV=m
 CONFIG_I2C_S3C2410=y
 CONFIG_I2C_SIMTEC=y
+CONFIG_EEPROM_AT24=y
 CONFIG_SPI=y
 CONFIG_SPI_GPIO=m
 CONFIG_SPI_S3C24XX=m
arch/arm/mach-s3c24xx/Kconfig +0 -1
index ef68ecb27396..c94ef77405ed 100644
@@ -460,7 +460,6 @@ config MACH_AT2440EVB
 
 config MACH_MINI2440
 	bool "MINI2440 development board"
-	select EEPROM_AT24 if I2C
 	select LEDS_CLASS
 	select LEDS_TRIGGERS
 	select LEDS_TRIGGER_BACKLIGHT
Signature · 1 line
2.7.0
Reviewed-by on v1 1/6
#2 lore raw

Re: [PATCH 1/6] ARM: s3c24xx: don't select EEPROM_AT24

Quoted 10 lines · Arnd Bergmann

EEPROM_AT24 depends on both I2C and SYSFS. We have in the past added I2C 'select' statements to avoid build problems with the first, but we still get a warning because of the second:

warning: (MACH_DAVINCI_EVM && MACH_SFFSDR && MACH_DAVINCI_DM6467_EVM && MACH_DAVINCI_DM365_EVM && MACH_DAVINCI_DA830_EVM && MACH_MITYOMAPL138 && MACH_MINI2440) selects EEPROM_AT24 which has unmet direct dependencies (I2C && SYSFS)

This removes the 'select' statements again, and forces users to enable the driver in their configuration files, as we do for most other drivers.

Quoted 6 lines
---
 arch/arm/configs/mini2440_defconfig | 1 +
 arch/arm/configs/s3c2410_defconfig  | 1 +
 arch/arm/mach-s3c24xx/Kconfig       | 1 -
 3 files changed, 2 insertions(+), 1 deletion(-)

Best regards,
Krzysztof

#3 lore raw

PATCH 2/6 ARM: s3c24xx: allow selecting S3C2440_XTAL_16934400 for s3c2442

In reply to Arnd Bergmann

The S3C2440_XTAL_16934400 and S3C2440_XTAL_12000000 symbols are used for both s3c2442 and s3c2440, but Kconfig only allows it to be selected if CPU_S3C2440 is enabled, which can lead to a warning otherwise:

warning: (MACH_RX1950) selects S3C2440_XTAL_16934400 which has unmet direct dependencies (ARCH_S3C24XX && CPU_S3C2440)

This changes the dependencies to make it possible also for CPU_S3C2442-only configurations.

---
 arch/arm/mach-s3c24xx/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm/mach-s3c24xx/Kconfig +4 -1
index c94ef77405ed..5884bbb7952e 100644
@@ -405,7 +405,7 @@ config MACH_S3C2416_DT
 
 endif	# CPU_S3C2416
 
-if CPU_S3C2440
+if CPU_S3C2440 || CPU_S3C2442
 
 config S3C2440_XTAL_12000000
 	bool
@@ -432,6 +432,9 @@ config S3C2440_PLL_16934400
 	default y if S3C24XX_PLL
 	help
 	  PLL tables for S3C2440 or S3C2442 CPUs with 16.934MHz crystals.
+endif
+
+if CPU_S3C2440
 
 comment "S3C2440 Boards"
 
Signature · 1 line
2.7.0
Reviewed-by on v1 2/6
#4 lore raw

Re: [PATCH 2/6] ARM: s3c24xx: allow selecting S3C2440_XTAL_16934400 for s3c2442

Quoted 6 lines · Arnd Bergmann

The S3C2440_XTAL_16934400 and S3C2440_XTAL_12000000 symbols are used for both s3c2442 and s3c2440, but Kconfig only allows it to be selected if CPU_S3C2440 is enabled, which can lead to a warning otherwise:

warning: (MACH_RX1950) selects S3C2440_XTAL_16934400 which has unmet direct dependencies (ARCH_S3C24XX && CPU_S3C2440)

Quoted 7 lines

This changes the dependencies to make it possible also for CPU_S3C2442-only configurations.

---
 arch/arm/mach-s3c24xx/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Best regards,
Krzysztof

#5 lore raw

PATCH 3/6 ARM: s3c24xx: fix unused gta02_configure_pmu_for_charger warning

In reply to Arnd Bergmann

gta02_configure_pmu_for_charger is only used when CONFIG_PCF50633_ADC is set, and otherwise we get a warning about an unused symbol:

arch/arm/mach-s3c24xx/mach-gta02.c:158:1: warning: 'gta02_configure_pmu_for_charger' defined but not used [-Wunused-function]
gta02_configure_pmu_for_charger(struct pcf50633 *pcf, void *unused, int res)

This adds an #ifdef to shut up the warning.

---
 arch/arm/mach-s3c24xx/mach-gta02.c | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-s3c24xx/mach-gta02.c +2 -0
index 6d1e0b9c5b27..27ae6877550f 100644
@@ -154,6 +154,7 @@ static struct s3c2410_uartcfg gta02_uartcfgs[] = {
 #define ADC_NOM_CHG_DETECT_1A 6
 #define ADC_NOM_CHG_DETECT_USB 43
 
+#ifdef CONFIG_PCF50633_ADC
 static void
 gta02_configure_pmu_for_charger(struct pcf50633 *pcf, void *unused, int res)
 {
@@ -174,6 +175,7 @@ gta02_configure_pmu_for_charger(struct pcf50633 *pcf, void *unused, int res)
 
 	pcf50633_mbc_usb_curlim_set(pcf, ma);
 }
+#endif
 
 static struct delayed_work gta02_charger_work;
 static int gta02_usb_vbus_draw;
Signature · 1 line
2.7.0
Reviewed-by on v1 3/6
#6 lore raw

Re: [PATCH 3/6] ARM: s3c24xx: fix unused gta02_configure_pmu_for_charger warning

Quoted 6 lines · Arnd Bergmann

gta02_configure_pmu_for_charger is only used when CONFIG_PCF50633_ADC is set, and otherwise we get a warning about an unused symbol:

arch/arm/mach-s3c24xx/mach-gta02.c:158:1: warning: 'gta02_configure_pmu_for_charger' defined but not used [-Wunused-function]
gta02_configure_pmu_for_charger(struct pcf50633 *pcf, void *unused, int res)

Quoted 6 lines

This adds an #ifdef to shut up the warning.

---
 arch/arm/mach-s3c24xx/mach-gta02.c | 2 ++
 1 file changed, 2 insertions(+)

Best regards,
Krzysztof

#7 lore raw

PATCH 4/6 ARM: s3c24xx: don't select RFKILL if CONFIG_NET is disabled

In reply to Arnd Bergmann

Bluetooth is only supported when network support is part of the kernel, so it is a bit pointless to build the hi1940-bt support without networking. If we try anyway, we get a Kconfig warning:

warning: (TOSA_BT && H1940BT) selects RFKILL which has unmet direct dependencies (NET)

This adds a dependency on CONFIG_NET to avoid that case.

---
 arch/arm/mach-s3c24xx/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-s3c24xx/Kconfig +1 -1
index 5884bbb7952e..bf66c8334822 100644
@@ -227,7 +227,7 @@ config ARCH_H1940
 
 config H1940BT
 	tristate "Control the state of H1940 bluetooth chip"
-	depends on ARCH_H1940
+	depends on ARCH_H1940 && NET
 	select RFKILL
 	help
 	  This is a simple driver that is able to control
Signature · 1 line
2.7.0
#8 lore raw

Re: [PATCH 4/6] ARM: s3c24xx: don't select RFKILL if CONFIG_NET is disabled

Quoted 18 lines · Arnd Bergmann

Bluetooth is only supported when network support is part of the kernel, so it is a bit pointless to build the hi1940-bt support without networking. If we try anyway, we get a Kconfig warning:

warning: (TOSA_BT && H1940BT) selects RFKILL which has unmet direct dependencies (NET)

This adds a dependency on CONFIG_NET to avoid that case.

---
 arch/arm/mach-s3c24xx/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-s3c24xx/Kconfig +0 -0
index 5884bbb7952e..bf66c8334822 100644

arch/arm/mach-s3c24xx/Kconfig config ARCH_H1940 · line 233

Quoted 8 lines
arch/arm/mach-s3c24xx/Kconfig +1 -1
@@ -227,7 +227,7 @@ config ARCH_H1940
 
 config H1940BT
 	tristate "Control the state of H1940 bluetooth chip"
-	depends on ARCH_H1940
+	depends on ARCH_H1940 && NET
 	select RFKILL
 	help
 	  This is a simple driver that is able to control

I think there shouldn't be a reverse dependency for RFKILL but instead just:

	depends on ARCH_H1940 && RFKILL

This makes it simpler and RFKILL is a user-visible symbol.

Best regards,
Krzysztof

#9 lore raw

PATCH 5/6 ARM: s3c64xx: mark regulator init data as unused

In reply to Arnd Bergmann

The smdk6410 board defines lots of regulator settings, but uses most of them only in certain configurations, and otherwise leaves them without any references, so we get lots of randconfig warnings about them:

mach-s3c64xx/mach-smdk6410.c:303:35: error: 'smdk6410_vddarm' defined but not used [-Werror=unused-variable] mach-s3c64xx/mach-smdk6410.c:316:35: error: 'smdk6410_vddint' defined but not used [-Werror=unused-variable] mach-s3c64xx/mach-smdk6410.c:327:35: error: 'smdk6410_vddhi' defined but not used [-Werror=unused-variable] mach-s3c64xx/mach-smdk6410.c:335:35: error: 'smdk6410_vddpll' defined but not used [-Werror=unused-variable] mach-s3c64xx/mach-smdk6410.c:343:35: error: 'smdk6410_vdduh_mmc' defined but not used [-Werror=unused-variable]

This marks all regulator_init_data structures in this file as __maybe_unused, indicating that we don't care whether there are any references or not in a given configuration.

---
 arch/arm/mach-s3c64xx/mach-smdk6410.c | 38 +++++++++++++++++------------------
 1 file changed, 19 insertions(+), 19 deletions(-)
arch/arm/mach-s3c64xx/mach-smdk6410.c +19 -19
index 8a894ee3ee76..92ec8c3b42b9 100644
@@ -216,7 +216,7 @@ static struct regulator_consumer_supply smdk6410_b_pwr_5v_consumers[] = {
 	REGULATOR_SUPPLY("AVDD", "0-001b"),
 };
 
-static struct regulator_init_data smdk6410_b_pwr_5v_data = {
+static struct regulator_init_data __maybe_unused smdk6410_b_pwr_5v_data = {
 	.constraints = {
 		.always_on = 1,
 	},
@@ -300,7 +300,7 @@ static struct regulator_consumer_supply smdk6410_vddarm_consumers[] = {
 };
 
 /* VDDARM, BUCK1 on J5 */
-static struct regulator_init_data smdk6410_vddarm = {
+static struct regulator_init_data __maybe_unused smdk6410_vddarm = {
 	.constraints = {
 		.name = "PVDD_ARM",
 		.min_uV = 1000000,
@@ -313,7 +313,7 @@ static struct regulator_init_data smdk6410_vddarm = {
 };
 
 /* VDD_INT, BUCK2 on J5 */
-static struct regulator_init_data smdk6410_vddint = {
+static struct regulator_init_data __maybe_unused smdk6410_vddint = {
 	.constraints = {
 		.name = "PVDD_INT",
 		.min_uV = 1000000,
@@ -324,7 +324,7 @@ static struct regulator_init_data smdk6410_vddint = {
 };
 
 /* VDD_HI, LDO3 on J5 */
-static struct regulator_init_data smdk6410_vddhi = {
+static struct regulator_init_data __maybe_unused smdk6410_vddhi = {
 	.constraints = {
 		.name = "PVDD_HI",
 		.always_on = 1,
@@ -332,7 +332,7 @@ static struct regulator_init_data smdk6410_vddhi = {
 };
 
 /* VDD_PLL, LDO2 on J5 */
-static struct regulator_init_data smdk6410_vddpll = {
+static struct regulator_init_data __maybe_unused smdk6410_vddpll = {
 	.constraints = {
 		.name = "PVDD_PLL",
 		.always_on = 1,
@@ -340,7 +340,7 @@ static struct regulator_init_data smdk6410_vddpll = {
 };
 
 /* VDD_UH_MMC, LDO5 on J5 */
-static struct regulator_init_data smdk6410_vdduh_mmc = {
+static struct regulator_init_data __maybe_unused smdk6410_vdduh_mmc = {
 	.constraints = {
 		.name = "PVDD_UH+PVDD_MMC",
 		.always_on = 1,
@@ -348,7 +348,7 @@ static struct regulator_init_data smdk6410_vdduh_mmc = {
 };
 
 /* VCCM3BT, LDO8 on J5 */
-static struct regulator_init_data smdk6410_vccmc3bt = {
+static struct regulator_init_data __maybe_unused smdk6410_vccmc3bt = {
 	.constraints = {
 		.name = "PVCCM3BT",
 		.always_on = 1,
@@ -356,7 +356,7 @@ static struct regulator_init_data smdk6410_vccmc3bt = {
 };
 
 /* VCCM2MTV, LDO11 on J5 */
-static struct regulator_init_data smdk6410_vccm2mtv = {
+static struct regulator_init_data __maybe_unused smdk6410_vccm2mtv = {
 	.constraints = {
 		.name = "PVCCM2MTV",
 		.always_on = 1,
@@ -364,7 +364,7 @@ static struct regulator_init_data smdk6410_vccm2mtv = {
 };
 
 /* VDD_LCD, LDO12 on J5 */
-static struct regulator_init_data smdk6410_vddlcd = {
+static struct regulator_init_data __maybe_unused smdk6410_vddlcd = {
 	.constraints = {
 		.name = "PVDD_LCD",
 		.always_on = 1,
@@ -372,7 +372,7 @@ static struct regulator_init_data smdk6410_vddlcd = {
 };
 
 /* VDD_OTGI, LDO9 on J5 */
-static struct regulator_init_data smdk6410_vddotgi = {
+static struct regulator_init_data __maybe_unused smdk6410_vddotgi = {
 	.constraints = {
 		.name = "PVDD_OTGI",
 		.always_on = 1,
@@ -380,7 +380,7 @@ static struct regulator_init_data smdk6410_vddotgi = {
 };
 
 /* VDD_OTG, LDO14 on J5 */
-static struct regulator_init_data smdk6410_vddotg = {
+static struct regulator_init_data __maybe_unused smdk6410_vddotg = {
 	.constraints = {
 		.name = "PVDD_OTG",
 		.always_on = 1,
@@ -388,7 +388,7 @@ static struct regulator_init_data smdk6410_vddotg = {
 };
 
 /* VDD_ALIVE, LDO15 on J5 */
-static struct regulator_init_data smdk6410_vddalive = {
+static struct regulator_init_data __maybe_unused smdk6410_vddalive = {
 	.constraints = {
 		.name = "PVDD_ALIVE",
 		.always_on = 1,
@@ -396,7 +396,7 @@ static struct regulator_init_data smdk6410_vddalive = {
 };
 
 /* VDD_AUDIO, VLDO_AUDIO on J5 */
-static struct regulator_init_data smdk6410_vddaudio = {
+static struct regulator_init_data __maybe_unused smdk6410_vddaudio = {
 	.constraints = {
 		.name = "PVDD_AUDIO",
 		.always_on = 1,
@@ -406,7 +406,7 @@ static struct regulator_init_data smdk6410_vddaudio = {
 
 #ifdef CONFIG_SMDK6410_WM1190_EV1
 /* S3C64xx internal logic & PLL */
-static struct regulator_init_data wm8350_dcdc1_data = {
+static struct regulator_init_data __maybe_unused wm8350_dcdc1_data = {
 	.constraints = {
 		.name = "PVDD_INT+PVDD_PLL",
 		.min_uV = 1200000,
@@ -417,7 +417,7 @@ static struct regulator_init_data wm8350_dcdc1_data = {
 };
 
 /* Memory */
-static struct regulator_init_data wm8350_dcdc3_data = {
+static struct regulator_init_data __maybe_unused wm8350_dcdc3_data = {
 	.constraints = {
 		.name = "PVDD_MEM",
 		.min_uV = 1800000,
@@ -437,7 +437,7 @@ static struct regulator_consumer_supply wm8350_dcdc4_consumers[] = {
 	REGULATOR_SUPPLY("DVDD", "0-001b"),
 };
 
-static struct regulator_init_data wm8350_dcdc4_data = {
+static struct regulator_init_data __maybe_unused wm8350_dcdc4_data = {
 	.constraints = {
 		.name = "PVDD_HI+PVDD_EXT+PVDD_SYS+PVCCM2MTV",
 		.min_uV = 3000000,
@@ -449,7 +449,7 @@ static struct regulator_init_data wm8350_dcdc4_data = {
 };
 
 /* OTGi/1190-EV1 HPVDD & AVDD */
-static struct regulator_init_data wm8350_ldo4_data = {
+static struct regulator_init_data __maybe_unused wm8350_ldo4_data = {
 	.constraints = {
 		.name = "PVDD_OTGI+HPVDD+AVDD",
 		.min_uV = 1200000,
@@ -537,7 +537,7 @@ static struct wm831x_backlight_pdata wm1192_backlight_pdata = {
 	.max_uA = 27554,
 };
 
-static struct regulator_init_data wm1192_dcdc3 = {
+static struct regulator_init_data __maybe_unused wm1192_dcdc3 = {
 	.constraints = {
 		.name = "PVDD_MEM+PVDD_GPS",
 		.always_on = 1,
@@ -548,7 +548,7 @@ static struct regulator_consumer_supply wm1192_ldo1_consumers[] = {
 	REGULATOR_SUPPLY("DVDD", "0-001b"),   /* WM8580 */
 };
 
-static struct regulator_init_data wm1192_ldo1 = {
+static struct regulator_init_data __maybe_unused wm1192_ldo1 = {
 	.constraints = {
 		.name = "PVDD_LCD+PVDD_EXT",
 		.always_on = 1,
Signature · 1 line
2.7.0
Reviewed-by on v1 5/6
#10 lore raw

Re: [PATCH 5/6] ARM: s3c64xx: mark regulator init data as unused

Quoted 11 lines · Arnd Bergmann

The smdk6410 board defines lots of regulator settings, but uses most of them only in certain configurations, and otherwise leaves them without any references, so we get lots of randconfig warnings about them:

mach-s3c64xx/mach-smdk6410.c:303:35: error: 'smdk6410_vddarm' defined but not used [-Werror=unused-variable] mach-s3c64xx/mach-smdk6410.c:316:35: error: 'smdk6410_vddint' defined but not used [-Werror=unused-variable] mach-s3c64xx/mach-smdk6410.c:327:35: error: 'smdk6410_vddhi' defined but not used [-Werror=unused-variable] mach-s3c64xx/mach-smdk6410.c:335:35: error: 'smdk6410_vddpll' defined but not used [-Werror=unused-variable] mach-s3c64xx/mach-smdk6410.c:343:35: error: 'smdk6410_vdduh_mmc' defined but not used [-Werror=unused-variable]

Quoted 9 lines

This marks all regulator_init_data structures in this file as __maybe_unused, indicating that we don't care whether there are any references or not in a given configuration.

---
 arch/arm/mach-s3c64xx/mach-smdk6410.c | 38 +++++++++++++++++------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

Best regards,
Krzysztof

#11 lore raw

PATCH 6/6 ARM: exynos: select THERMAL_OF

In reply to Arnd Bergmann

We cannot select a symbol that has disabled dependencies, so we get a warning if we ever enable EXYNOS_THERMAL without also turning on THERMAL_OF:

warning: (ARCH_EXYNOS) selects EXYNOS_THERMAL which has unmet direct dependencies (THERMAL && (ARCH_EXYNOS || COMPILE_TEST) && THERMAL_OF)

This adds another 'select' in the platform code to avoid that case. Alternatively, we could decide to not select EXYNOS_THERMAL here and instead make it a user option.

---
 arch/arm/mach-exynos/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-exynos/Kconfig +1 -0
index 652a0bb11578..5189bcecad12 100644
@@ -27,6 +27,7 @@ menuconfig ARCH_EXYNOS
 	select S5P_DEV_MFC
 	select SRAM
 	select THERMAL
+	select THERMAL_OF
 	select MFD_SYSCON
 	select CLKSRC_EXYNOS_MCT
 	select POWER_RESET
Signature · 1 line
2.7.0
Reviewed-by on v1 6/6
#12 lore raw

Re: [PATCH 6/6] ARM: exynos: select THERMAL_OF

Quoted 9 lines · Arnd Bergmann

We cannot select a symbol that has disabled dependencies, so we get a warning if we ever enable EXYNOS_THERMAL without also turning on THERMAL_OF:

warning: (ARCH_EXYNOS) selects EXYNOS_THERMAL which has unmet direct dependencies (THERMAL && (ARCH_EXYNOS || COMPILE_TEST) && THERMAL_OF)

This adds another 'select' in the platform code to avoid that case. Alternatively, we could decide to not select EXYNOS_THERMAL here and instead make it a user option.

We want EXYNOS_THERMAL because we are using boost cpufreq on Exynos4x12 (through turbo frequencies in DTS and cpufreq-dt) so your current solution is a proper fix for:

Fixes f87e6bd3f740 ("thermal: exynos: Add the dependency of

CONFIG_THERMAL_OF instead of CONFIG_OF")

Best regards,
Krzysztof

Quoted 19 lines
---
 arch/arm/mach-exynos/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-exynos/Kconfig +1 -0
index 652a0bb11578..5189bcecad12 100644
@@ -27,6 +27,7 @@ menuconfig ARCH_EXYNOS
 	select S5P_DEV_MFC
 	select SRAM
 	select THERMAL
+	select THERMAL_OF
 	select MFD_SYSCON
 	select CLKSRC_EXYNOS_MCT
 	select POWER_RESET