Skip to content

Commit

Permalink
staging: vt665x: fix alignment constraints
Browse files Browse the repository at this point in the history
multiple structures contains a ieee80211_rts structure, which is required to
have at least two byte alignment, but are annotated with a __packed attribute
to force single-byte alignment:

staging/vt6656/rxtx.h:98:1: warning: alignment 1 of 'struct vnt_rts_g' is less than 2 [-Wpacked-not-aligned]
staging/vt6656/rxtx.h:106:1: warning: alignment 1 of 'struct vnt_rts_ab' is less than 2 [-Wpacked-not-aligned]
staging/vt6656/rxtx.h:116:1: warning: alignment 1 of 'struct vnt_cts' is less than 2 [-Wpacked-not-aligned]

I see no reason why the structure itself would be misaligned, and all members
have at least two-byte alignment within the structure, so use the same
constraint on the sturcture itself.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20210204162731.3132069-1-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Arnd Bergmann authored and Greg Kroah-Hartman committed Feb 6, 2021
1 parent f1bfe09 commit 2faf12c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions drivers/staging/vt6655/rxtx.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ struct vnt_rts_g {
__le16 duration_bb;
u16 reserved;
struct ieee80211_rts data;
} __packed;
} __packed __aligned(2);

struct vnt_rts_g_fb {
struct vnt_phy_field b;
Expand All @@ -125,14 +125,14 @@ struct vnt_rts_g_fb {
__le16 rts_duration_ba_f1;
__le16 rts_duration_aa_f1;
struct ieee80211_rts data;
} __packed;
} __packed __aligned(2);

struct vnt_rts_ab {
struct vnt_phy_field ab;
__le16 duration;
u16 reserved;
struct ieee80211_rts data;
} __packed;
} __packed __aligned(2);

struct vnt_rts_a_fb {
struct vnt_phy_field a;
Expand All @@ -141,7 +141,7 @@ struct vnt_rts_a_fb {
__le16 rts_duration_f0;
__le16 rts_duration_f1;
struct ieee80211_rts data;
} __packed;
} __packed __aligned(2);

/* CTS buffer header */
struct vnt_cts {
Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/vt6656/rxtx.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ struct vnt_rts_g {
u16 wReserved;
struct ieee80211_rts data;
struct vnt_tx_datahead_g data_head;
} __packed;
} __packed __aligned(2);

struct vnt_rts_ab {
struct vnt_phy_field ab;
__le16 duration;
u16 wReserved;
struct ieee80211_rts data;
struct vnt_tx_datahead_ab data_head;
} __packed;
} __packed __aligned(2);

/* CTS buffer header */
struct vnt_cts {
Expand All @@ -113,7 +113,7 @@ struct vnt_cts {
struct ieee80211_cts data;
u16 reserved2;
struct vnt_tx_datahead_g data_head;
} __packed;
} __packed __aligned(2);

union vnt_tx_data_head {
/* rts g */
Expand Down

0 comments on commit 2faf12c

Please sign in to comment.