Skip to contentSkip to conversation

pinctrl: qcom: sdm845: Fix CONFIG preprocessor guard

PATCH In review Nathan Chancellor 5 participants 5 messages Jun 21, 2019 – Jun 25, 2019

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

PATCH 1/1 pinctrl: qcom: sdm845: Fix CONFIG preprocessor guard

Clang warns when CONFIG_ACPI is unset:

drivers/pinctrl/qcom/pinctrl-sdm845.c:1320:5: warning: 'CONFIG_ACPI' is not defined, evaluates to 0 [-Wundef]

 #if CONFIG_ACPI
     ^

1 warning generated.

Use ifdef instead of if to resolve this.

Fixes a229105d7a1e ("pinctrl: qcom: sdm845: Provide ACPI support")
---
 drivers/pinctrl/qcom/pinctrl-sdm845.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/qcom/pinctrl-sdm845.c +1 -1
index 06790e5ece6c..39f498c09906 100644
@@ -1317,7 +1317,7 @@ static int sdm845_pinctrl_probe(struct platform_device *pdev)
 	return ret;
 }
 
-#if CONFIG_ACPI
+#ifdef CONFIG_ACPI
 static const struct acpi_device_id sdm845_pinctrl_acpi_match[] = {
 	{ "QCOM0217"},
 	{ },
Signature · 1 line
2.22.0
#1 lore raw
Quoted 1 line · Nathan Chancellor

Clang warns when CONFIG_ACPI is unset:

Any of these others need the same s/#if/#ifdef/ ?

$ git grep -P '^\s*#\s*if\s+CONFIG_[A-Z0-9_]+\s*$' *
arch/microblaze/include/asm/exceptions.h:#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
arch/microblaze/include/asm/hash.h:#if CONFIG_XILINX_MICROBLAZE0_USE_BARREL
arch/microblaze/include/asm/irqflags.h:#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
arch/microblaze/kernel/entry-nommu.S:#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
arch/microblaze/kernel/entry.S:#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
arch/microblaze/kernel/entry.S:#if CONFIG_MANUAL_RESET_VECTOR
arch/microblaze/kernel/setup.c:#if CONFIG_XILINX_MICROBLAZE0_USE_MSR_INSTR
arch/powerpc/platforms/powernv/pci.c:#if CONFIG_EEH
arch/x86/boot/compressed/misc.c:#if CONFIG_X86_NEED_RELOCS
arch/x86/boot/compressed/misc.h:#if CONFIG_RANDOMIZE_BASE
drivers/pinctrl/qcom/pinctrl-sdm845.c:#if CONFIG_ACPI
kernel/futex.c:#if CONFIG_BASE_SMALL
Reviewed-by on v1 1/1
#2 lore raw
In reply to Nathan Chancellor
Quoted 7 lines · Nathan Chancellor

Clang warns when CONFIG_ACPI is unset:

drivers/pinctrl/qcom/pinctrl-sdm845.c:1320:5: warning: 'CONFIG_ACPI' is not defined, evaluates to 0 [-Wundef]

 #if CONFIG_ACPI
     ^
Quoted 7 lines

1 warning generated.

Use ifdef instead of if to resolve this.

Fixes a229105d7a1e ("pinctrl: qcom: sdm845: Provide ACPI support")

Thanks for the patch.

Quoted 9 lines
---
 drivers/pinctrl/qcom/pinctrl-sdm845.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/qcom/pinctrl-sdm845.c +0 -0
index 06790e5ece6c..39f498c09906 100644

drivers/pinctrl/qcom/pinctrl-sdm845.c static int sdm845_pinctrl_probe(struct platform_device *pdev) · line 1320

Quoted 5 lines
drivers/pinctrl/qcom/pinctrl-sdm845.c +1 -1
@@ -1317,7 +1317,7 @@ static int sdm845_pinctrl_probe(struct platform_device *pdev)
        return ret;
 }
 
-#if CONFIG_ACPI
+#ifdef CONFIG_ACPI

Thanks,
~Nick Desaulniers

Acked-by
#3 lore raw
Quoted 11 lines · Nick Desaulniers
Quoted 9 lines · Nathan Chancellor

Clang warns when CONFIG_ACPI is unset:

drivers/pinctrl/qcom/pinctrl-sdm845.c:1320:5: warning: 'CONFIG_ACPI' is not defined, evaluates to 0 [-Wundef]

 #if CONFIG_ACPI
     ^

1 warning generated.

Quoted 8 lines
Quoted 5 lines

Use ifdef instead of if to resolve this.

Fixes a229105d7a1e ("pinctrl: qcom: sdm845: Provide ACPI support")

Thanks for the patch.

Interesting. Thanks for fixing.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#4 lore raw
In reply to Nathan Chancellor
Quoted 6 lines · Nathan Chancellor

Clang warns when CONFIG_ACPI is unset:

drivers/pinctrl/qcom/pinctrl-sdm845.c:1320:5: warning: 'CONFIG_ACPI' is not defined, evaluates to 0 [-Wundef]

 #if CONFIG_ACPI
     ^
Quoted 7 lines

1 warning generated.

Use ifdef instead of if to resolve this.

Fixes a229105d7a1e ("pinctrl: qcom: sdm845: Provide ACPI support")

Patch applied with the ACKs.
I'm sure Bjorn doesn't mind.

Yours,
Linus Walleij