Skip to contentSkip to conversation

platform/mellanox: Remove unused variable.

PATCH In review [email protected] 2 participants 3 messages May 11, 2022 – May 12, 2022

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

PATCH 1/1 platform/mellanox: Remove unused variable.

From: Michael Shych <[email protected]>

Fix problem of set but unused variable.

Fixes 9e267f050444f ("platform/mellanox: Add support for new SN2201 system")
---
 drivers/platform/mellanox/nvsw-sn2201.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/mellanox/nvsw-sn2201.c +2 -2
index 6165e0154424..0bcdc7c75007 100644
@@ -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;
Signature · 1 line
2.14.1
#1 lore raw

Hi,

Quoted 7 lines · On 5/11/22 21:50, [email protected] wrote:

From: Michael Shych <[email protected]>

Fix problem of set but unused variable.

Fixes 9e267f050444f ("platform/mellanox: Add support for new SN2201 system")

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

Quoted 26 lines
---
 drivers/platform/mellanox/nvsw-sn2201.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/mellanox/nvsw-sn2201.c +2 -2
index 6165e0154424..0bcdc7c75007 100644
@@ -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;
#2 lore raw
Quoted 25 lines

-----Original Message-----
From: Hans de Goede <[email protected]>
Sent: Thursday, May 12, 2022 4:35 PM
To: Michael Shych <[email protected]>
Cc: [email protected]; Vadim Pasternak <[email protected]>
Subject: Re: [PATCH 1/1] platform/mellanox: Remove unused variable.

Hi,

Quoted 8 lines · On 5/11/22 21:50, [email protected] wrote:

From: Michael Shych <[email protected]>

Fix problem of set but unused variable.

Fixes 9e267f050444f ("platform/mellanox: Add support for new SN2201

system")

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

Quoted 7 lines

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

commit which introduced this problem.

Regards,

Hans

Ack.

Thanks,
Michael.

Quoted 32 lines

drivers/platform/mellanox/nvsw-sn2201.c static int nvsw_sn2201_config_post_init(struct

Quoted 12 lines

---
 drivers/platform/mellanox/nvsw-sn2201.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/mellanox/nvsw-sn2201.c +0 -0
index 6165e0154424..0bcdc7c75007 100644
@@ -939,7 +939,7 @@ static int nvsw_sn2201_config_post_init(struct

nvsw_sn2201 *nvsw_sn2201)

Quoted 9 lines
drivers/platform/mellanox/nvsw-sn2201.c +1 -1
 	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);

drivers/platform/mellanox/nvsw-sn2201.c static int nvsw_sn2201_config_post_init(struct · line 956

Quoted 5 lines
drivers/platform/mellanox/nvsw-sn2201.c +0 -1
@@ -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++) {

Quoted 4 lines
drivers/platform/mellanox/nvsw-sn2201.c +1 -0
+	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;