ice: Make use of assign_bit() API
authorHongbo Li <lihongbo22@huawei.com>
Mon, 2 Sep 2024 13:14:07 +0000 (21:14 +0800)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 8 Oct 2024 21:37:15 +0000 (14:37 -0700)
We have for some time the assign_bit() API to replace open coded

    if (foo)
            set_bit(n, bar);
    else
            clear_bit(n, bar);

Use this API to clean the code. No functional change intended.

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Reviewed-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Tested-by: George Kuruvinakunnel <george.kuruvinakunnel@intel.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_main.c

index 9f6e8a5508a22f0f7ddc5c8d8a310400795b455d..255ae9325c692a0f5726385ce983fc1681012872 100644 (file)
@@ -6549,8 +6549,7 @@ ice_set_features(struct net_device *netdev, netdev_features_t features)
        if (changed & NETIF_F_HW_TC) {
                bool ena = !!(features & NETIF_F_HW_TC);
 
-               ena ? set_bit(ICE_FLAG_CLS_FLOWER, pf->flags) :
-                     clear_bit(ICE_FLAG_CLS_FLOWER, pf->flags);
+               assign_bit(ICE_FLAG_CLS_FLOWER, pf->flags, ena);
        }
 
        if (changed & NETIF_F_LOOPBACK)