mac80211: Add attribute aligned(2) to struct 'action'
authorMathieu Malaterre <malat@debian.org>
Thu, 24 Jan 2019 18:19:57 +0000 (19:19 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 25 Jan 2019 09:17:25 +0000 (10:17 +0100)
commit7c53eb5d87bc21464da4268c3c0c47457b6d9c9b
treeb260e02d210b783614705e845ce6b0c3f804a3a9
parent7ed5285396c257fd4070b1e29e7b2341aae2a1ce
mac80211: Add attribute aligned(2) to struct 'action'

During refactor in commit 9e478066eae4 ("mac80211: fix MU-MIMO
follow-MAC mode") a new struct 'action' was declared with packed
attribute as:

  struct {
          struct ieee80211_hdr_3addr hdr;
          u8 category;
          u8 action_code;
  } __packed action;

But since struct 'ieee80211_hdr_3addr' is declared with an aligned
keyword as:

  struct ieee80211_hdr {
   __le16 frame_control;
   __le16 duration_id;
   u8 addr1[ETH_ALEN];
   u8 addr2[ETH_ALEN];
   u8 addr3[ETH_ALEN];
   __le16 seq_ctrl;
   u8 addr4[ETH_ALEN];
  } __packed __aligned(2);

Solve the ambiguity of placing aligned structure in a packed one by
adding the aligned(2) attribute to struct 'action'.

This removes the following warning (W=1):

  net/mac80211/rx.c:234:2: warning: alignment 1 of 'struct <anonymous>' is less than 2 [-Wpacked-not-aligned]

Cc: Johannes Berg <johannes.berg@intel.com>
Suggested-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Mathieu Malaterre <malat@debian.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/rx.c