]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: wlan-ng: use GENMASK macro in two bitwise operations in prism2sta.c
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Thu, 10 Nov 2016 18:16:42 +0000 (19:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Nov 2016 14:43:19 +0000 (15:43 +0100)
This patch replace actual mask stuff using BIT macros with
or operators to make use of GENMASK macro which simplifies
code clearity and readibility.

It applies for two bitwise operations included in prism2sta.c source file.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/prism2sta.c

index 351f08d6a5d94553cc7f62afd0df7c9d8e0800a6..984804b92e054934e51785f828c9b5a7ee7bc1eb 100644 (file)
@@ -654,8 +654,8 @@ static int prism2sta_getcardinfo(struct wlandevice *wlandev)
        hw->ident_sta_fw.minor = le16_to_cpu(hw->ident_sta_fw.minor);
 
        /* strip out the 'special' variant bits */
-       hw->mm_mods = hw->ident_sta_fw.variant & (BIT(14) | BIT(15));
-       hw->ident_sta_fw.variant &= ~((u16)(BIT(14) | BIT(15)));
+       hw->mm_mods = hw->ident_sta_fw.variant & GENMASK(15, 14);
+       hw->ident_sta_fw.variant &= ~((u16)GENMASK(15, 14));
 
        if (hw->ident_sta_fw.id == 0x1f) {
                netdev_info(wlandev->netdev,