linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/x86: mlx-platform: remove an unused variable
@ 2020-12-03 22:30 Arnd Bergmann
  2020-12-03 23:17 ` Vadim Pasternak
  2020-12-07 13:53 ` Hans de Goede
  0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2020-12-03 22:30 UTC (permalink / raw)
  To: Vadim Pasternak, Hans de Goede, Mark Gross, Nathan Chancellor,
	Nick Desaulniers
  Cc: Arnd Bergmann, Andy Shevchenko, Michael Shych,
	platform-driver-x86, linux-kernel, clang-built-linux

From: Arnd Bergmann <arnd@arndb.de>

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.

Fixes: 912b341585e3 ("platform/x86: mlx-platform: Remove PSU EEPROM from MSN274x platform configuration")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/platform/x86/mlx-platform.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index 598f44558764..6a634b72bfc2 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -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,
 	},
-- 
2.27.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] platform/x86: mlx-platform: remove an unused variable
  2020-12-03 22:30 [PATCH] platform/x86: mlx-platform: remove an unused variable Arnd Bergmann
@ 2020-12-03 23:17 ` Vadim Pasternak
  2020-12-07 13:53 ` Hans de Goede
  1 sibling, 0 replies; 4+ messages in thread
From: Vadim Pasternak @ 2020-12-03 23:17 UTC (permalink / raw)
  To: Arnd Bergmann, Hans de Goede, Mark Gross, Nathan Chancellor,
	Nick Desaulniers
  Cc: Arnd Bergmann, Andy Shevchenko, Michael Shych,
	platform-driver-x86, linux-kernel, clang-built-linux



> -----Original Message-----
> From: Arnd Bergmann <arnd@kernel.org>
> Sent: Friday, December 04, 2020 12:31 AM
> To: Vadim Pasternak <vadimp@nvidia.com>; Hans de Goede
> <hdegoede@redhat.com>; Mark Gross <mgross@linux.intel.com>; Nathan
> Chancellor <natechancellor@gmail.com>; Nick Desaulniers
> <ndesaulniers@google.com>
> Cc: Arnd Bergmann <arnd@arndb.de>; Andy Shevchenko
> <andriy.shevchenko@linux.intel.com>; Michael Shych
> <michaelsh@mellanox.com>; platform-driver-x86@vger.kernel.org; linux-
> kernel@vger.kernel.org; clang-built-linux@googlegroups.com
> Subject: [PATCH] platform/x86: mlx-platform: remove an unused variable
> 
> From: Arnd Bergmann <arnd@arndb.de>

Acked-by: Vadim Pasternak <vadimp@nvidia.com>

> 
> 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.
> 
> Fixes: 912b341585e3 ("platform/x86: mlx-platform: Remove PSU EEPROM from
> MSN274x platform configuration")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/platform/x86/mlx-platform.c | 13 ++-----------
>  1 file changed, 2 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-
> platform.c
> index 598f44558764..6a634b72bfc2 100644
> --- a/drivers/platform/x86/mlx-platform.c
> +++ b/drivers/platform/x86/mlx-platform.c
> @@ -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,
>  	},
> --
> 2.27.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] platform/x86: mlx-platform: remove an unused variable
  2020-12-03 22:30 [PATCH] platform/x86: mlx-platform: remove an unused variable Arnd Bergmann
  2020-12-03 23:17 ` Vadim Pasternak
@ 2020-12-07 13:53 ` Hans de Goede
  2020-12-07 14:02   ` Vadim Pasternak
  1 sibling, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2020-12-07 13:53 UTC (permalink / raw)
  To: Arnd Bergmann, Vadim Pasternak, Mark Gross, Nathan Chancellor,
	Nick Desaulniers
  Cc: Arnd Bergmann, Andy Shevchenko, Michael Shych,
	platform-driver-x86, linux-kernel, clang-built-linux

Hi,

On 12/3/20 11:30 PM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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.
> 
> Fixes: 912b341585e3 ("platform/x86: mlx-platform: Remove PSU EEPROM from MSN274x platform configuration")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

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





> ---
>  drivers/platform/x86/mlx-platform.c | 13 ++-----------
>  1 file changed, 2 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
> index 598f44558764..6a634b72bfc2 100644
> --- a/drivers/platform/x86/mlx-platform.c
> +++ b/drivers/platform/x86/mlx-platform.c
> @@ -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,
>  	},
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] platform/x86: mlx-platform: remove an unused variable
  2020-12-07 13:53 ` Hans de Goede
@ 2020-12-07 14:02   ` Vadim Pasternak
  0 siblings, 0 replies; 4+ messages in thread
From: Vadim Pasternak @ 2020-12-07 14:02 UTC (permalink / raw)
  To: Hans de Goede, Arnd Bergmann, Mark Gross, Nathan Chancellor,
	Nick Desaulniers
  Cc: Arnd Bergmann, Andy Shevchenko, Michael Shych,
	platform-driver-x86, linux-kernel, clang-built-linux



> -----Original Message-----
> From: Hans de Goede <hdegoede@redhat.com>
> Sent: Monday, December 07, 2020 3:54 PM
> To: Arnd Bergmann <arnd@kernel.org>; Vadim Pasternak
> <vadimp@nvidia.com>; Mark Gross <mgross@linux.intel.com>; Nathan
> Chancellor <natechancellor@gmail.com>; Nick Desaulniers
> <ndesaulniers@google.com>
> Cc: Arnd Bergmann <arnd@arndb.de>; Andy Shevchenko
> <andriy.shevchenko@linux.intel.com>; Michael Shych
> <michaelsh@mellanox.com>; platform-driver-x86@vger.kernel.org; linux-
> kernel@vger.kernel.org; clang-built-linux@googlegroups.com
> Subject: Re: [PATCH] platform/x86: mlx-platform: remove an unused variable
> 
> Hi,
> 
> On 12/3/20 11:30 PM, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > 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.
> >
> > Fixes: 912b341585e3 ("platform/x86: mlx-platform: Remove PSU EEPROM
> > from MSN274x platform configuration")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> 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.

Hi,

I'll provide a patch.

Thanks,
Vadim.

> 
> ###
> 
> 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
> 
> 
> 
> 
> 
> > ---
> >  drivers/platform/x86/mlx-platform.c | 13 ++-----------
> >  1 file changed, 2 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/platform/x86/mlx-platform.c
> > b/drivers/platform/x86/mlx-platform.c
> > index 598f44558764..6a634b72bfc2 100644
> > --- a/drivers/platform/x86/mlx-platform.c
> > +++ b/drivers/platform/x86/mlx-platform.c
> > @@ -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,
> >  	},
> >


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-07 14:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03 22:30 [PATCH] platform/x86: mlx-platform: remove an unused variable Arnd Bergmann
2020-12-03 23:17 ` Vadim Pasternak
2020-12-07 13:53 ` Hans de Goede
2020-12-07 14:02   ` Vadim Pasternak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).