Skip to contentSkip to conversation

RDMA/mana_ib: Fix compilation error

PATCH In review Andy Shevchenko 3 participants 6 messages Apr 23, 2024 – Apr 26, 2024

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

PATCH 1/1 RDMA/mana_ib: Fix compilation error

The compilation with CONFIG_WERROR=y is broken:

.../hw/mana/device.c:88:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]

	if (!upper_ndev) {
	    ^~~~~~~~~~~

Fix this by assigning the ret to -ENODEV in respective condition.

Fixes 8b184e4f1c32 ("RDMA/mana_ib: Enable RoCE on port 1")
---
 drivers/infiniband/hw/mana/device.c | 1 +
 1 file changed, 1 insertion(+)
drivers/infiniband/hw/mana/device.c +1 -0
index fca4d0d85c64..4c45f8681e7f 100644
@@ -88,6 +88,7 @@ static int mana_ib_probe(struct auxiliary_device *adev,
 	if (!upper_ndev) {
 		rcu_read_unlock();
 		ibdev_err(&dev->ib_dev, "Failed to get master netdev");
+		ret = -ENODEV;
 		goto free_ib_device;
 	}
 	ether_addr_copy(mac_addr, upper_ndev->dev_addr);
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines

Subject: [PATCH v1 1/1] RDMA/mana_ib: Fix compilation error

The compilation with CONFIG_WERROR=y is broken:

.../hw/mana/device.c:88:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]

Quoted 7 lines
	if (!upper_ndev) {
	    ^~~~~~~~~~~

Fix this by assigning the ret to -ENODEV in respective condition.

Fixes 8b184e4f1c32 ("RDMA/mana_ib: Enable RoCE on port 1")
Quoted 19 lines
---
 drivers/infiniband/hw/mana/device.c | 1 +
 1 file changed, 1 insertion(+)
drivers/infiniband/hw/mana/device.c +1 -1
index fca4d0d85c64..4c45f8681e7f 100644
@@ -88,6 +88,7 @@ static int mana_ib_probe(struct auxiliary_device *adev,
 	if (!upper_ndev) {
 		rcu_read_unlock();
 		ibdev_err(&dev->ib_dev, "Failed to get master netdev");
+		ret = -ENODEV;
 		goto free_ib_device;
 	}
 	ether_addr_copy(mac_addr, upper_ndev->dev_addr);
--

2.43.0.rc1.1336.g36b5255a03ac

maintainer
#2 lore raw
In reply to Andy Shevchenko
Quoted 6 lines · Andy Shevchenko

The compilation with CONFIG_WERROR=y is broken:

.../hw/mana/device.c:88:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]

	if (!upper_ndev) {
	    ^~~~~~~~~~~
Quoted 7 lines

Fix this by assigning the ret to -ENODEV in respective condition.

Fixes 8b184e4f1c32 ("RDMA/mana_ib: Enable RoCE on port 1")
---
 drivers/infiniband/hw/mana/device.c | 1 +
 1 file changed, 1 insertion(+)

This was fixed in

commit f88320b698ad099a2f742adfb9f87177bfffe0c5

Author: Konstantin Taranov <[email protected]>
Date:   Tue Apr 23 07:15:51 2024 -0700

RDMA/mana_ib: Fix missing ret value

Thanks,
Jason

#3 lore raw
Quoted 9 lines · Jason Gunthorpe
Quoted 8 lines · Andy Shevchenko

The compilation with CONFIG_WERROR=y is broken:

.../hw/mana/device.c:88:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]

	if (!upper_ndev) {
	    ^~~~~~~~~~~

Fix this by assigning the ret to -ENODEV in respective condition.

Quoted 7 lines
Quoted 5 lines
Fixes 8b184e4f1c32 ("RDMA/mana_ib: Enable RoCE on port 1")
---
 drivers/infiniband/hw/mana/device.c | 1 +
 1 file changed, 1 insertion(+)

This was fixed in

Hmm... The below patch had been sent _after_ mine. What's wrong with mine patch?

Quoted 5 lines

commit f88320b698ad099a2f742adfb9f87177bfffe0c5

Author: Konstantin Taranov <[email protected]>
Date:   Tue Apr 23 07:15:51 2024 -0700

RDMA/mana_ib: Fix missing ret value

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#4 lore raw
Quoted 16 lines · Andy Shevchenko
Quoted 15 lines · Jason Gunthorpe
Quoted 13 lines · Andy Shevchenko

The compilation with CONFIG_WERROR=y is broken:

.../hw/mana/device.c:88:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]

	if (!upper_ndev) {
	    ^~~~~~~~~~~

Fix this by assigning the ret to -ENODEV in respective condition.

Fixes 8b184e4f1c32 ("RDMA/mana_ib: Enable RoCE on port 1")
---
 drivers/infiniband/hw/mana/device.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 3 lines
Quoted 1 line

This was fixed in

Hmm... The below patch had been sent _after_ mine. What's wrong with mine patch?

Oh, my... Sorry, I missed PM, it was mine sent after that one! I guess time for weekend.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer
#5 lore raw
In reply to Andy Shevchenko
Quoted 16 lines · Andy Shevchenko
Quoted 15 lines · Jason Gunthorpe
Quoted 13 lines · Andy Shevchenko

The compilation with CONFIG_WERROR=y is broken:

.../hw/mana/device.c:88:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]

	if (!upper_ndev) {
	    ^~~~~~~~~~~

Fix this by assigning the ret to -ENODEV in respective condition.

Fixes 8b184e4f1c32 ("RDMA/mana_ib: Enable RoCE on port 1")
---
 drivers/infiniband/hw/mana/device.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 4 lines
Quoted 1 line

This was fixed in

Hmm... The below patch had been sent _after_ mine. What's wrong with mine patch?

It wasn't

Your's:
Date: Tue, 23 Apr 2024 23:42:58 +0300 [thread overview]

Konstantin's:
Date: Tue, 23 Apr 2024 07:15:51 -0700 [thread overview]

He beat you by 6 hours, which is why I took his, yours didn't exist at the time I took it.

Jason