platform/x86: mlx-platform: remove an unused variable
PATCH 1/1 platform/x86: mlx-platform: remove an unused variable
From: Arnd Bergmann <[email protected]>
The only reference to the mlxplat_mlxcpld_psu[] array got removed, so there is now a warning from clang:
drivers/platform/x86/mlx-platform.c:322:30: error: variable 'mlxplat_mlxcpld_psu' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] static struct i2c_board_info mlxplat_mlxcpld_psu[] = {
Remove the array as well and adapt the ARRAY_SIZE() call accordingly.
--- drivers/platform/x86/mlx-platform.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
drivers/platform/x86/mlx-platform.c +2 -11
@@ -319,15 +319,6 @@ static struct i2c_mux_reg_platform_data mlxplat_extended_mux_data[] = { };/* Platform hotplug devices */ -static struct i2c_board_info mlxplat_mlxcpld_psu[] = { - { -I2C_BOARD_INFO ("24c02" ,0x51 ), - }, - { -I2C_BOARD_INFO ("24c02" ,0x50 ), - }, -}; -static struct i2c_board_info mlxplat_mlxcpld_pwr[] = { {I2C_BOARD_INFO ("dps460" ,0x59 ),
@@ -456,7 +447,7 @@ static struct mlxreg_core_item mlxplat_mlxcpld_default_items[] = { .aggr_mask = MLXPLAT_CPLD_AGGR_PSU_MASK_DEF, .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, .mask = MLXPLAT_CPLD_PSU_MASK, - .count = ARRAY_SIZE(mlxplat_mlxcpld_psu), + .count = ARRAY_SIZE(mlxplat_mlxcpld_default_psu_items_data), .inversed = 1, .health = false, },
@@ -495,7 +486,7 @@ static struct mlxreg_core_item mlxplat_mlxcpld_comex_items[] = { .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_CARRIER, .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, .mask = MLXPLAT_CPLD_PSU_MASK, - .count = ARRAY_SIZE(mlxplat_mlxcpld_psu), + .count = ARRAY_SIZE(mlxplat_mlxcpld_default_psu_items_data), .inversed = 1, .health = false, },
Signature · 1 line
2.27.0
Quoted 15 lines
-----Original Message-----
From: Arnd Bergmann <[email protected]>
Sent: Friday, December 04, 2020 12:31 AM
To: Vadim Pasternak <[email protected]>; Hans de Goede <[email protected]>; Mark Gross <[email protected]>; Nathan Chancellor <[email protected]>; Nick Desaulniers <[email protected]>
Cc: Arnd Bergmann <[email protected]>; Andy Shevchenko <[email protected]>; Michael Shych <[email protected]>; [email protected]; linux- [email protected]; [email protected]
Subject: [PATCH] platform/x86: mlx-platform: remove an unused variable
Quoted 1 line
From: Arnd Bergmann <[email protected]>
Quoted 63 lines
The only reference to the mlxplat_mlxcpld_psu[] array got removed, so there is now a warning from clang:
drivers/platform/x86/mlx-platform.c:322:30: error: variable 'mlxplat_mlxcpld_psu' is not needed and will not be emitted [-Werror,- Wunneeded-internal-declaration]
static structi2c_board_infomlxplat_mlxcpld_psu[] = {Remove the array as well and adapt the
ARRAY_SIZE()call accordingly.Fixes 912b341585e3 ("platform/x86: mlx-platform: Remove PSU EEPROM fromMSN274x platform configuration")
Signed-off-by Arnd Bergmann <[email protected]>--- drivers/platform/x86/mlx-platform.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)drivers/platform/x86/mlx- renamed from drivers/platform/x86/mlx-platform.c +0
-0
platform.c
index598f44558764..6a634b72bfc2100644drivers/platform/x86/mlx-platform.c +1
-10@@ -319,15 +319,6 @@ static struct i2c_mux_reg_platform_data mlxplat_extended_mux_data[] = { };/* Platform hotplug devices */ -static struct i2c_board_info mlxplat_mlxcpld_psu[] = { - { -I2C_BOARD_INFO ("24c02" ,0x51 ), - }, - { -I2C_BOARD_INFO ("24c02" ,0x50 ), - }, -}; -static struct i2c_board_info mlxplat_mlxcpld_pwr[] = { {I2C_BOARD_INFO ("dps460" ,0x59 ),@@ -456,7 +447,7 @@ static struct mlxreg_core_item mlxplat_mlxcpld_default_items[] = { .aggr_mask = MLXPLAT_CPLD_AGGR_PSU_MASK_DEF, .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, .mask = MLXPLAT_CPLD_PSU_MASK, - .count = ARRAY_SIZE(mlxplat_mlxcpld_psu), + .count = ARRAY_SIZE(mlxplat_mlxcpld_default_psu_items_data), .inversed = 1,drivers/platform/x86/mlx-platform.c +1
-1.health = false, },@@ -495,7 +486,7 @@ static struct mlxreg_core_item mlxplat_mlxcpld_comex_items[] = { .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_CARRIER, .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, .mask = MLXPLAT_CPLD_PSU_MASK, - .count = ARRAY_SIZE(mlxplat_mlxcpld_psu), + .count = ARRAY_SIZE(mlxplat_mlxcpld_default_psu_items_data), .inversed = 1,drivers/platform/x86/mlx-platform.c +0
-1.health = false, }, --2.27.0
Hans de Goede
AppliedHi,
Quoted 5 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The only reference to the mlxplat_mlxcpld_psu[] array got removed, so there is now a warning from clang:
Quoted 8 lines
drivers/platform/x86/mlx-platform.c:322:30: error: variable 'mlxplat_mlxcpld_psu' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] static structi2c_board_infomlxplat_mlxcpld_psu[] = {Remove the array as well and adapt the
ARRAY_SIZE()call accordingly.Fixes 912b341585e3 ("platform/x86: mlx-platform: Remove PSU EEPROM from MSN274x platform configuration")Signed-off-by Arnd Bergmann <[email protected]>
Thank you for your patch.
Note that there are 4 more cases where the foo1 and foo2 in:
.data = foo1 and .count = ARRAY_SIZE(foo2) are not the same.
There are 2 cases where .count is set to ARRAY_SIZE(mlxplat_mlxcpld_pwr) instead of to ARRAY_SIZE(mlxplat_mlxcpld_default_pwr_items_data)
and there are 2 cases where .count is set to ARRAY_SIZE(mlxplat_mlxcpld_fan) instead of to ARRAY_SIZE(mlxplat_mlxcpld_default_fan_items_data)
If one of the MLX people can provide a patch fixing this then that would be great.
###
I've applied this patch to my review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Note it will show up in my review-hans branch once I've pushed my local branch there, which might take a while.
Once I've run some tests on this branch the patches there will be added to the platform-drivers-x86/for-next branch and eventually will be included in the pdx86 pull-request to Linus for the next merge-window.
Regards,
Hans
Quoted 43 lines
--- drivers/platform/x86/mlx-platform.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)drivers/platform/x86/mlx-platform.c +2
-11@@ -319,15 +319,6 @@ static struct i2c_mux_reg_platform_data mlxplat_extended_mux_data[] = { };/* Platform hotplug devices */ -static struct i2c_board_info mlxplat_mlxcpld_psu[] = { - { -I2C_BOARD_INFO ("24c02" ,0x51 ), - }, - { -I2C_BOARD_INFO ("24c02" ,0x50 ), - }, -}; -static struct i2c_board_info mlxplat_mlxcpld_pwr[] = { {I2C_BOARD_INFO ("dps460" ,0x59 ),@@ -456,7 +447,7 @@ static struct mlxreg_core_item mlxplat_mlxcpld_default_items[] = { .aggr_mask = MLXPLAT_CPLD_AGGR_PSU_MASK_DEF, .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, .mask = MLXPLAT_CPLD_PSU_MASK, - .count = ARRAY_SIZE(mlxplat_mlxcpld_psu), + .count = ARRAY_SIZE(mlxplat_mlxcpld_default_psu_items_data), .inversed = 1, .health = false, },@@ -495,7 +486,7 @@ static struct mlxreg_core_item mlxplat_mlxcpld_comex_items[] = { .aggr_mask = MLXPLAT_CPLD_AGGR_MASK_CARRIER, .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, .mask = MLXPLAT_CPLD_PSU_MASK, - .count = ARRAY_SIZE(mlxplat_mlxcpld_psu), + .count = ARRAY_SIZE(mlxplat_mlxcpld_default_psu_items_data), .inversed = 1, .health = false, },
Quoted 39 lines
-----Original Message-----
From: Hans de Goede <[email protected]>
Sent: Monday, December 07, 2020 3:54 PM
To: Arnd Bergmann <[email protected]>; Vadim Pasternak <[email protected]>; Mark Gross <[email protected]>; Nathan Chancellor <[email protected]>; Nick Desaulniers <[email protected]>
Cc: Arnd Bergmann <[email protected]>; Andy Shevchenko <[email protected]>; Michael Shych <[email protected]>; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [PATCH] platform/x86: mlx-platform: remove an unused variableHi,
Quoted 10 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The only reference to the mlxplat_mlxcpld_psu[] array got removed, so there is now a warning from clang:
drivers/platform/x86/mlx-platform.c:322:30: error: variable 'mlxplat_mlxcpld_psu' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration]
static structi2c_board_infomlxplat_mlxcpld_psu[] = {Quoted 5 lines
Remove the array as well and adapt the
ARRAY_SIZE()call accordingly.Fixes 912b341585e3 ("platform/x86: mlx-platform: Remove PSU EEPROMfrom MSN274x platform configuration")
Signed-off-by Arnd Bergmann <[email protected]>Thank you for your patch.
Note that there are 4 more cases where the foo1 and foo2 in:
.data = foo1 and .count =ARRAY_SIZE(foo2)are not the same.
Quoted 8 lines
There are 2 cases where .count is set to
ARRAY_SIZE(mlxplat_mlxcpld_pwr)instead of toARRAY_SIZE(mlxplat_mlxcpld_default_pwr_items_data)and there are 2 cases where .count is set to
ARRAY_SIZE(mlxplat_mlxcpld_fan)instead of toARRAY_SIZE(mlxplat_mlxcpld_default_fan_items_data)If one of the MLX people can provide a patch fixing this then that would be great.
Hi,
I'll provide a patch.
Thanks,
Vadim.
Quoted 70 lines
###
I've applied this patch to my review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-
x86.git/log/?h=review-hansNote it will show up in my review-hans branch once I've pushed my local branch there, which might take a while.
Once I've run some tests on this branch the patches there will be added to the platform-drivers-x86/for-next branch and eventually will be included in the pdx86 pull-request to Linus for the next merge-window.
Regards,
Hans
drivers/platform/x86/mlx-platform.c static struct mlxreg_core_item
Quoted 26 lines
--- drivers/platform/x86/mlx-platform.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)drivers/platform/x86/mlx-platform.c +0
-9@@ -319,15 +319,6 @@ static struct i2c_mux_reg_platform_data mlxplat_extended_mux_data[] = { };/* Platform hotplug devices */ -static struct i2c_board_info mlxplat_mlxcpld_psu[] = { - { -I2C_BOARD_INFO ("24c02" ,0x51 ), - }, - { -I2C_BOARD_INFO ("24c02" ,0x50 ), - }, -}; -static struct i2c_board_info mlxplat_mlxcpld_pwr[] = { {I2C_BOARD_INFO ("dps460" ,0x59 ),@@ -456,7 +447,7 @@ static struct mlxreg_core_itemmlxplat_mlxcpld_default_items[] = {
drivers/platform/x86/mlx-platform.c static struct mlxreg_core_item mlxplat_mlxcpld_default_items[] = {
Quoted 5 lines
drivers/platform/x86/mlx-platform.c +1
-1.aggr_mask = MLXPLAT_CPLD_AGGR_PSU_MASK_DEF, .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, .mask = MLXPLAT_CPLD_PSU_MASK, - .count = ARRAY_SIZE(mlxplat_mlxcpld_psu), + .count =
ARRAY_SIZE(mlxplat_mlxcpld_default_psu_items_data),drivers/platform/x86/mlx-platform.c static struct mlxreg_core_item
Quoted 4 lines
drivers/platform/x86/mlx-platform.c +0
-0.inversed = 1, .health = false, },@@ -495,7 +486,7 @@ static struct mlxreg_core_itemmlxplat_mlxcpld_comex_items[] = {
drivers/platform/x86/mlx-platform.c static struct mlxreg_core_item mlxplat_mlxcpld_comex_items[] = {
Quoted 5 lines
drivers/platform/x86/mlx-platform.c +1
-1.aggr_mask = MLXPLAT_CPLD_AGGR_MASK_CARRIER, .reg = MLXPLAT_CPLD_LPC_REG_PSU_OFFSET, .mask = MLXPLAT_CPLD_PSU_MASK, - .count = ARRAY_SIZE(mlxplat_mlxcpld_psu), + .count =
ARRAY_SIZE(mlxplat_mlxcpld_default_psu_items_data),Quoted 4 lines
drivers/platform/x86/mlx-platform.c +0
-0.inversed = 1, .health = false, },