Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1522640
| From | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/4] staging: wlan-ng: use GENMASK macro in different defines of p80211hdr.h |
| Date | 2016-11-15 13:40 +0100 |
| Message-ID | <sDLbQ-4VX-9@gated-at.bofh.it> (permalink) |
| References | <sC278-1l5-1@gated-at.bofh.it> <sC279-1l5-39@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, Nov 10, 2016 at 07:16:40PM +0100, Sergio Paracuellos wrote: > -#define WLAN_GET_FC_FTYPE(n) ((((u16)(n)) & (BIT(2) | BIT(3))) >> 2) > -#define WLAN_GET_FC_FSTYPE(n) ((((u16)(n)) & \ > - (BIT(4) | BIT(5) | BIT(6) | BIT(7))) >> 4) > +#define WLAN_GET_FC_FTYPE(n) ((((u16)(n)) & GENMASK(3, 2)) >> 2) > +#define WLAN_GET_FC_FSTYPE(n) ((((u16)(n)) & GENMASK(7, 4)) >> 4) The casts to u16 are not needed. regards, dan carpenter
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH 2/4] staging: wlan-ng: use GENMASK macro in different defines of p80211hdr.h Dan Carpenter <dan.carpenter@oracle.com> - 2016-11-15 13:40 +0100
csiph-web