Skip to contentSkip to conversation

scsi: fcoe: use netif_is_bond_master() instead of open code

PATCH Applied MichelleJin 3 participants 4 messages Oct 15, 2021 – Oct 21, 2021

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

PATCH 1/1 scsi: fcoe: use netif_is_bond_master() instead of open code

'netdev->priv_flags & IFF_BONDING && netdev->flags & IFF_MASTER' is defined as netif_is_bond_master() in netdevice.h. So, replace it with netif_is_bond_master() for cleaning code.

---
 drivers/scsi/fcoe/fcoe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/fcoe/fcoe.c +1 -1
index 5ae6c207d3ac..6415f88738ad 100644
@@ -307,7 +307,7 @@ static int fcoe_interface_setup(struct fcoe_interface *fcoe,
 	}
 
 	/* Do not support for bonding device */
-	if (netdev->priv_flags & IFF_BONDING && netdev->flags & IFF_MASTER) {
+	if (netif_is_bond_master(netdev)) {
 		FCOE_NETDEV_DBG(netdev, "Bonded interfaces not supported\n");
 		return -EOPNOTSUPP;
 	}
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · MichelleJin

'netdev->priv_flags & IFF_BONDING && netdev->flags & IFF_MASTER' is defined as netif_is_bond_master() in netdevice.h. So, replace it with netif_is_bond_master() for cleaning code.

---
 drivers/scsi/fcoe/fcoe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/fcoe/fcoe.c +0 -0
index 5ae6c207d3ac..6415f88738ad 100644

drivers/scsi/fcoe/fcoe.c static int fcoe_interface_setup(struct fcoe_interface *fcoe, · line 313

Quoted 8 lines
drivers/scsi/fcoe/fcoe.c +1 -1
@@ -307,7 +307,7 @@ static int fcoe_interface_setup(struct fcoe_interface *fcoe,
 	}
 
 	/* Do not support for bonding device */
-	if (netdev->priv_flags & IFF_BONDING && netdev->flags & IFF_MASTER) {
+	if (netif_is_bond_master(netdev)) {
 		FCOE_NETDEV_DBG(netdev, "Bonded interfaces not supported\n");
 		return -EOPNOTSUPP;
 	}
#2 lore raw
In reply to MichelleJin
Quoted 4 lines

'netdev->priv_flags & IFF_BONDING && netdev->flags & IFF_MASTER' is defined as netif_is_bond_master() in netdevice.h. So, replace it with netif_is_bond_master() for cleaning code.

Applied to 5.16/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#3 lore raw
In reply to MichelleJin
Quoted 5 lines · MichelleJin

'netdev->priv_flags & IFF_BONDING && netdev->flags & IFF_MASTER' is defined as netif_is_bond_master() in netdevice.h. So, replace it with netif_is_bond_master() for cleaning code.

Applied to 5.16/scsi-queue, thanks!

[1/1] scsi: fcoe: use netif_is_bond_master() instead of open code

      https://git.kernel.org/mkp/scsi/c/b3ef4a0e40df
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering