diff mbox series

[RFCv2,net-next,020/167] net: qlogic: convert the prototype of qlcnic_process_flags

Message ID 20210929155334.12454-21-shenjian15@huawei.com (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series net: extend the netdev_features_t | expand

Commit Message

shenjian (K) Sept. 29, 2021, 3:51 p.m. UTC
For the origin type for netdev_features_t would be changed to
be unsigned long * from u64, so changes the prototype of
qlcnic_process_flags for adaption.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
---
 .../net/ethernet/qlogic/qlcnic/qlcnic_hw.c    | 24 +++++++++----------
 1 file changed, 11 insertions(+), 13 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
index e6ed7f8413b4..2367923e3e3f 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
@@ -1020,37 +1020,35 @@  int qlcnic_change_mtu(struct net_device *netdev, int mtu)
 	return rc;
 }
 
-static netdev_features_t qlcnic_process_flags(struct qlcnic_adapter *adapter,
-					      netdev_features_t features)
+static void qlcnic_process_flags(struct qlcnic_adapter *adapter,
+				 netdev_features_t *features)
 {
 	u32 offload_flags = adapter->offload_flags;
 
 	if (offload_flags & BIT_0) {
-		features |= NETIF_F_RXCSUM | NETIF_F_IP_CSUM |
-			    NETIF_F_IPV6_CSUM;
+		*features |= NETIF_F_RXCSUM | NETIF_F_IP_CSUM |
+			     NETIF_F_IPV6_CSUM;
 		adapter->rx_csum = 1;
 		if (QLCNIC_IS_TSO_CAPABLE(adapter)) {
 			if (!(offload_flags & BIT_1))
-				features &= ~NETIF_F_TSO;
+				*features &= ~NETIF_F_TSO;
 			else
-				features |= NETIF_F_TSO;
+				*features |= NETIF_F_TSO;
 
 			if (!(offload_flags & BIT_2))
-				features &= ~NETIF_F_TSO6;
+				*features &= ~NETIF_F_TSO6;
 			else
-				features |= NETIF_F_TSO6;
+				*features |= NETIF_F_TSO6;
 		}
 	} else {
-		features &= ~(NETIF_F_RXCSUM |
+		*features &= ~(NETIF_F_RXCSUM |
 			      NETIF_F_IP_CSUM |
 			      NETIF_F_IPV6_CSUM);
 
 		if (QLCNIC_IS_TSO_CAPABLE(adapter))
-			features &= ~(NETIF_F_TSO | NETIF_F_TSO6);
+			*features &= ~(NETIF_F_TSO | NETIF_F_TSO6);
 		adapter->rx_csum = 0;
 	}
-
-	return features;
 }
 
 void qlcnic_fix_features(struct net_device *netdev, netdev_features_t *features)
@@ -1061,7 +1059,7 @@  void qlcnic_fix_features(struct net_device *netdev, netdev_features_t *features)
 	if (qlcnic_82xx_check(adapter) &&
 	    (adapter->flags & QLCNIC_ESWITCH_ENABLED)) {
 		if (adapter->flags & QLCNIC_APP_CHANGED_FLAGS) {
-			*features = qlcnic_process_flags(adapter, *features);
+			qlcnic_process_flags(adapter, features);
 		} else {
 			changed = *features ^ netdev->features;
 			*features ^= changed & (NETIF_F_RXCSUM |