From 6277fbfdd29ca2fbf5da33e3931087b5356c770b Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Thu, 19 Aug 2021 10:45:36 -0700 Subject: staging: wlan-ng: Remove pointless a3/a4 union There is no need for the a3/a4 union. The two structs are identical except for the addition of a4. Excepting one place, the structs are only ever used in the union, and the union is always allocated at full size. The one instance of the a3-specific struct can be replaced with the full version, as no sizing information is used. Replace the union with the a4 version of the struct. "diffoscope" reports there are no object code differences after this change. Cc: Allen Pais Cc: Romain Perier Cc: Chen Lin Cc: Ivan Safonov Cc: Arnd Bergmann Cc: linux-staging@lists.linux.dev Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210819174537.3499227-2-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/p80211hdr.h | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'drivers/staging/wlan-ng/p80211hdr.h') diff --git a/drivers/staging/wlan-ng/p80211hdr.h b/drivers/staging/wlan-ng/p80211hdr.h index 6564810fd026..93dd8ff1940c 100644 --- a/drivers/staging/wlan-ng/p80211hdr.h +++ b/drivers/staging/wlan-ng/p80211hdr.h @@ -148,16 +148,7 @@ /* Generic 802.11 Header types */ -struct p80211_hdr_a3 { - __le16 fc; - u16 dur; - u8 a1[ETH_ALEN]; - u8 a2[ETH_ALEN]; - u8 a3[ETH_ALEN]; - u16 seq; -} __packed; - -struct p80211_hdr_a4 { +struct p80211_hdr { u16 fc; u16 dur; u8 a1[ETH_ALEN]; @@ -167,11 +158,6 @@ struct p80211_hdr_a4 { u8 a4[ETH_ALEN]; } __packed; -union p80211_hdr { - struct p80211_hdr_a3 a3; - struct p80211_hdr_a4 a4; -} __packed; - /* Frame and header length macros */ static inline u16 wlan_ctl_framelen(u16 fstype) -- cgit v1.2.3