Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: wlan-ng: use GENMASK macro in different defines of hfa384x.h

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 defines included in hfa384x.h header file.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Sergio Paracuellos and committed by
Greg Kroah-Hartman
d349883f 408fec3f

+8 -21
+8 -21
drivers/staging/wlan-ng/hfa384x.h
··· 137 137 #define HFA384x_DLSTATE_FLASHENABLED 2 138 138 139 139 /*--- Register Field Masks --------------------------*/ 140 - #define HFA384x_CMD_AINFO ((u16)(BIT(14) | BIT(13) \ 141 - | BIT(12) | BIT(11) \ 142 - | BIT(10) | BIT(9) \ 143 - | BIT(8))) 144 - #define HFA384x_CMD_MACPORT ((u16)(BIT(10) | BIT(9) | \ 145 - BIT(8))) 146 - #define HFA384x_CMD_PROGMODE ((u16)(BIT(9) | BIT(8))) 147 - #define HFA384x_CMD_CMDCODE ((u16)(BIT(5) | BIT(4) | \ 148 - BIT(3) | BIT(2) | \ 149 - BIT(1) | BIT(0))) 150 - 151 - #define HFA384x_STATUS_RESULT ((u16)(BIT(14) | BIT(13) \ 152 - | BIT(12) | BIT(11) \ 153 - | BIT(10) | BIT(9) \ 154 - | BIT(8))) 140 + #define HFA384x_CMD_AINFO ((u16)GENMASK(14, 8)) 141 + #define HFA384x_CMD_MACPORT ((u16)GENMASK(10, 8)) 142 + #define HFA384x_CMD_PROGMODE ((u16)GENMASK(9, 8)) 143 + #define HFA384x_CMD_CMDCODE ((u16)GENMASK(5, 0)) 144 + #define HFA384x_STATUS_RESULT ((u16)GENMASK(14, 8)) 155 145 156 146 /*--- Command Code Constants --------------------------*/ 157 147 /*--- Controller Commands --------------------------*/ ··· 501 511 #define HFA384x_TXSTATUS_AGEDERR ((u16)BIT(1)) 502 512 #define HFA384x_TXSTATUS_RETRYERR ((u16)BIT(0)) 503 513 /*-- Transmit Control Field --*/ 504 - #define HFA384x_TX_MACPORT ((u16)(BIT(10) | \ 505 - BIT(9) | BIT(8))) 506 - #define HFA384x_TX_STRUCTYPE ((u16)(BIT(4) | BIT(3))) 514 + #define HFA384x_TX_MACPORT ((u16)GENMASK(10, 8)) 515 + #define HFA384x_TX_STRUCTYPE ((u16)GENMASK(4, 3)) 507 516 #define HFA384x_TX_TXEX ((u16)BIT(2)) 508 517 #define HFA384x_TX_TXOK ((u16)BIT(1)) 509 518 /*-------------------------------------------------------------------- ··· 560 571 */ 561 572 562 573 /*-- Status Fields --*/ 563 - #define HFA384x_RXSTATUS_MACPORT ((u16)(BIT(10) | \ 564 - BIT(9) | \ 565 - BIT(8))) 574 + #define HFA384x_RXSTATUS_MACPORT ((u16)GENMASK(10, 8)) 566 575 #define HFA384x_RXSTATUS_FCSERR ((u16)BIT(0)) 567 576 /*-------------------------------------------------------------------- 568 577 * Communication Frames: Test/Get/Set Field Values for Receive Frames