summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/realtek/rtw89/rtw8852b.c
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavoars@kernel.org>2022-11-15 15:55:34 -0600
committerKalle Valo <kvalo@kernel.org>2022-11-22 12:14:17 +0200
commit633a9b6f514c12b3ee42b3a4e647f137aca1e198 (patch)
tree34f670274025aa1cd91a998651a475fb5c9c69ab /drivers/net/wireless/realtek/rtw89/rtw8852b.c
parent0001650b3d89683bbea0cc3262c2a509dac9e78e (diff)
wifi: brcmfmac: Use struct_size() in code ralated to struct brcmf_dload_data_le
Prefer struct_size() over open-coded versions of idiom: sizeof(struct-with-flex-array) + sizeof(typeof-flex-array-elements) * count where count is the max number of items the flexible array is supposed to contain. In this particular case, in the open-coded version sizeof(typeof-flex-array-elements) is implicit in _count_ because the type of the flex array data is u8: drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h:941: 941 struct brcmf_dload_data_le { 942 __le16 flag; 943 __le16 dload_type; 944 __le32 len; 945 __le32 crc; 946 u8 data[]; 947 }; Link: https://github.com/KSPP/linux/issues/160 Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/41845ad3660ed4375f0c03fd36a67b2e12fafed5.1668548907.git.gustavoars@kernel.org
Diffstat (limited to 'drivers/net/wireless/realtek/rtw89/rtw8852b.c')
0 files changed, 0 insertions, 0 deletions