Skip to contentSkip to conversation

platform/x86: int3472/discrete: set variable skl_int3472_regulator_second_sensor storage-class-specifier to static

PATCH In review Tom Rix 2 participants 2 messages Jul 2, 2023 – Jul 11, 2023

Subsystems (2)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 platform/x86: int3472/discrete: set variable skl_int3472_regulator_second_sensor storage-class-specifier to static

smatch reports drivers/platform/x86/intel/int3472/clk_and_regulator.c:263:28: warning: symbol
'skl_int3472_regulator_second_sensor' was not declared. Should it be static?

This variable is only used in its defining file, so it should be static.

---
 drivers/platform/x86/intel/int3472/clk_and_regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/intel/int3472/clk_and_regulator.c +1 -1
index 61aeca804ba2..ef4b3141efcd 100644
@@ -260,7 +260,7 @@ static_assert(ARRAY_SIZE(skl_int3472_regulator_map_supplies) ==
  * This DMI table contains the name of the second sensor. This is used to add
  * entries for the second sensor to the supply_map.
  */
-const struct dmi_system_id skl_int3472_regulator_second_sensor[] = {
+static const struct dmi_system_id skl_int3472_regulator_second_sensor[] = {
 	{
 		/* Lenovo Miix 510-12IKB */
 		.matches = {
Signature · 1 line
2.27.0
#1 lore raw

Hi,

Quoted 16 lines · Tom Rix

smatch reports drivers/platform/x86/intel/int3472/clk_and_regulator.c:263:28: warning: symbol
'skl_int3472_regulator_second_sensor' was not declared. Should it be static?

This variable is only used in its defining file, so it should be static.

---
 drivers/platform/x86/intel/int3472/clk_and_regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/intel/int3472/clk_and_regulator.c +0 -0
index 61aeca804ba2..ef4b3141efcd 100644

drivers/platform/x86/intel/int3472/clk_and_regulator.c static_assert(ARRAY_SIZE(skl_int3472_regulator_map_supplies) == · line 266

Quoted 8 lines
drivers/platform/x86/intel/int3472/clk_and_regulator.c +1 -1
@@ -260,7 +260,7 @@ static_assert(ARRAY_SIZE(skl_int3472_regulator_map_supplies) ==
  * This DMI table contains the name of the second sensor. This is used to add
  * entries for the second sensor to the supply_map.
  */
-const struct dmi_system_id skl_int3472_regulator_second_sensor[] = {
+static const struct dmi_system_id skl_int3472_regulator_second_sensor[] = {
 	{
 		/* Lenovo Miix 510-12IKB */
 		.matches = {

Thank you for your patch, I've applied this patch to my fixes branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=fixes

Note it will show up in my fixes branch once I've pushed my local branch there, which might take a while.

I will include this patch in my next fixes pull-req to Linus for the current kernel development cycle.

Regards,

Hans