mac80211: use le16_encode_bits() instead of open-coding
authorJohannes Berg <johannes.berg@intel.com>
Fri, 31 Aug 2018 08:31:07 +0000 (11:31 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 5 Sep 2018 08:03:13 +0000 (10:03 +0200)
Instead of open-coding the equivalent of le16_encode_bits(),
just use that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/rx.c

index 355357cc7dbd0309dd79722e090544263bb98bd7..bf6b7ad7f7cdc0c3f93d96dd17d463b7bed52c61 100644 (file)
@@ -549,7 +549,7 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
 
        if (status->encoding == RX_ENC_HE &&
            status->flag & RX_FLAG_RADIOTAP_HE) {
-#define HE_PREP(f, val)        cpu_to_le16(FIELD_PREP(IEEE80211_RADIOTAP_HE_##f, val))
+#define HE_PREP(f, val)        le16_encode_bits(val, IEEE80211_RADIOTAP_HE_##f)
 
                if (status->enc_flags & RX_ENC_FLAG_STBC_MASK) {
                        he.data6 |= HE_PREP(DATA6_NSTS,