diff mbox series

[1/1] platform/mellanox: Remove unused variable.

Message ID 20220511195043.54853-1-michaelsh@nvidia.com (mailing list archive)
State Accepted, archived
Headers show
Series [1/1] platform/mellanox: Remove unused variable. | expand

Commit Message

Michael Shych May 11, 2022, 7:50 p.m. UTC
From: Michael Shych <michaelsh@nvidia.com>

Fix problem of set but unused variable.

Fixes: 9e267f050444f ("platform/mellanox: Add support for new SN2201 system")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Michael Shych <michaelsh@nvidia.com>
---
 drivers/platform/mellanox/nvsw-sn2201.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Hans de Goede May 12, 2022, 1:35 p.m. UTC | #1
Hi,

On 5/11/22 21:50, michaelsh@nvidia.com wrote:
> From: Michael Shych <michaelsh@nvidia.com>
> 
> Fix problem of set but unused variable.
> 
> Fixes: 9e267f050444f ("platform/mellanox: Add support for new SN2201 system")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Michael Shych <michaelsh@nvidia.com>

Thanks, note since I needed to rebase my review-hans branch for another
issue anyways I've squashed this into the original:

"platform/mellanox: Add support for new SN2201 system"

commit which introduced this problem.

Regards,

Hans


> ---
>  drivers/platform/mellanox/nvsw-sn2201.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/mellanox/nvsw-sn2201.c b/drivers/platform/mellanox/nvsw-sn2201.c
> index 6165e0154424..0bcdc7c75007 100644
> --- a/drivers/platform/mellanox/nvsw-sn2201.c
> +++ b/drivers/platform/mellanox/nvsw-sn2201.c
> @@ -939,7 +939,7 @@ static int nvsw_sn2201_config_post_init(struct nvsw_sn2201 *nvsw_sn2201)
>  	struct mlxreg_hotplug_device *sn2201_dev;
>  	struct i2c_adapter *adap;
>  	struct device *dev;
> -	int i, j, err;
> +	int i, err;
>  
>  	dev = nvsw_sn2201->dev;
>  	adap = i2c_get_adapter(nvsw_sn2201->main_mux_deferred_nr);
> @@ -952,7 +952,7 @@ static int nvsw_sn2201_config_post_init(struct nvsw_sn2201 *nvsw_sn2201)
>  
>  	/* Update board info. */
>  	sn2201_dev = nvsw_sn2201->sn2201_devs;
> -	for (i = 0, j = 0; i < nvsw_sn2201->sn2201_devs_num; i++, sn2201_dev++) {
> +	for (i = 0; i < nvsw_sn2201->sn2201_devs_num; i++, sn2201_dev++) {
>  		sn2201_dev->adapter = i2c_get_adapter(sn2201_dev->nr);
>  		if (!sn2201_dev->adapter)
>  			return -ENODEV;
Michael Shych May 12, 2022, 1:37 p.m. UTC | #2
> -----Original Message-----
> From: Hans de Goede <hdegoede@redhat.com>
> Sent: Thursday, May 12, 2022 4:35 PM
> To: Michael Shych <michaelsh@nvidia.com>
> Cc: platform-driver-x86@vger.kernel.org; Vadim Pasternak
> <vadimp@nvidia.com>
> Subject: Re: [PATCH 1/1] platform/mellanox: Remove unused variable.
> 
> Hi,
> 
> On 5/11/22 21:50, michaelsh@nvidia.com wrote:
> > From: Michael Shych <michaelsh@nvidia.com>
> >
> > Fix problem of set but unused variable.
> >
> > Fixes: 9e267f050444f ("platform/mellanox: Add support for new SN2201
> > system")
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Michael Shych <michaelsh@nvidia.com>
> 
> Thanks, note since I needed to rebase my review-hans branch for another
> issue anyways I've squashed this into the original:
> 
> "platform/mellanox: Add support for new SN2201 system"
> 
> commit which introduced this problem.
> 
> Regards,
> 
> Hans

Ack.

Thanks,
Michael.
> 
> 
> > ---
> >  drivers/platform/mellanox/nvsw-sn2201.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/platform/mellanox/nvsw-sn2201.c
> > b/drivers/platform/mellanox/nvsw-sn2201.c
> > index 6165e0154424..0bcdc7c75007 100644
> > --- a/drivers/platform/mellanox/nvsw-sn2201.c
> > +++ b/drivers/platform/mellanox/nvsw-sn2201.c
> > @@ -939,7 +939,7 @@ static int nvsw_sn2201_config_post_init(struct
> nvsw_sn2201 *nvsw_sn2201)
> >  	struct mlxreg_hotplug_device *sn2201_dev;
> >  	struct i2c_adapter *adap;
> >  	struct device *dev;
> > -	int i, j, err;
> > +	int i, err;
> >
> >  	dev = nvsw_sn2201->dev;
> >  	adap = i2c_get_adapter(nvsw_sn2201->main_mux_deferred_nr);
> > @@ -952,7 +952,7 @@ static int nvsw_sn2201_config_post_init(struct
> > nvsw_sn2201 *nvsw_sn2201)
> >
> >  	/* Update board info. */
> >  	sn2201_dev = nvsw_sn2201->sn2201_devs;
> > -	for (i = 0, j = 0; i < nvsw_sn2201->sn2201_devs_num; i++,
> sn2201_dev++) {
> > +	for (i = 0; i < nvsw_sn2201->sn2201_devs_num; i++, sn2201_dev++) {
> >  		sn2201_dev->adapter = i2c_get_adapter(sn2201_dev->nr);
> >  		if (!sn2201_dev->adapter)
> >  			return -ENODEV;
diff mbox series

Patch

diff --git a/drivers/platform/mellanox/nvsw-sn2201.c b/drivers/platform/mellanox/nvsw-sn2201.c
index 6165e0154424..0bcdc7c75007 100644
--- a/drivers/platform/mellanox/nvsw-sn2201.c
+++ b/drivers/platform/mellanox/nvsw-sn2201.c
@@ -939,7 +939,7 @@  static int nvsw_sn2201_config_post_init(struct nvsw_sn2201 *nvsw_sn2201)
 	struct mlxreg_hotplug_device *sn2201_dev;
 	struct i2c_adapter *adap;
 	struct device *dev;
-	int i, j, err;
+	int i, err;
 
 	dev = nvsw_sn2201->dev;
 	adap = i2c_get_adapter(nvsw_sn2201->main_mux_deferred_nr);
@@ -952,7 +952,7 @@  static int nvsw_sn2201_config_post_init(struct nvsw_sn2201 *nvsw_sn2201)
 
 	/* Update board info. */
 	sn2201_dev = nvsw_sn2201->sn2201_devs;
-	for (i = 0, j = 0; i < nvsw_sn2201->sn2201_devs_num; i++, sn2201_dev++) {
+	for (i = 0; i < nvsw_sn2201->sn2201_devs_num; i++, sn2201_dev++) {
 		sn2201_dev->adapter = i2c_get_adapter(sn2201_dev->nr);
 		if (!sn2201_dev->adapter)
 			return -ENODEV;