Skip to content

Commit

Permalink
iwlwifi: fw api: make hdr a zero-size array again
Browse files Browse the repository at this point in the history
In struct iwl_tx_cmd, there's no risk (as Arnd implied) that we
might access this as an array, as it's really not an array and
cannot be - there's only a single 802.11 header per frame. The
only reason for this member is for being able to access it a
bit more nicely.

On the other hand, this structure is used as a sub-struct in a
few places, and then some compilers (e.g. clang with certain
options) complain as you shouldn't have structs with variable-
length fields embedded in other structs.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210205110447.46cd538c90bf.I92179567d96938598806b560be59d787c2a8cc16@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
  • Loading branch information
Johannes Berg authored and Luca Coelho committed Feb 5, 2021
1 parent e497bed commit 46e64de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/intel/iwlwifi/fw/api/tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ struct iwl_tx_cmd {
__le16 pm_frame_timeout;
__le16 reserved4;
u8 payload[0];
struct ieee80211_hdr hdr[];
struct ieee80211_hdr hdr[0];
} __packed; /* TX_CMD_API_S_VER_6 */

struct iwl_dram_sec_info {
Expand Down

0 comments on commit 46e64de

Please sign in to comment.