wifi: brcmfmac: fwsignal: Use struct_size() to simplify brcmf_fws_rxreorder()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 21 Jul 2024 07:40:19 +0000 (09:40 +0200)
committerKalle Valo <kvalo@kernel.org>
Sun, 4 Aug 2024 09:08:52 +0000 (12:08 +0300)
commit16b31ecb802946f1855259a2006c32c8d340ea5c
treeddb1658491eb0877eae277653721a783b21d2293
parent9588469d06977bc8ff2c131c4eb589c6477c3b7c
wifi: brcmfmac: fwsignal: Use struct_size() to simplify brcmf_fws_rxreorder()

In the "struct brcmf_ampdu_rx_reorder", change the 'pktslots' field into
flexible array.

It saves the size of a pointer when the memory is allocated and avoids
an indirection when the array is used.
It also removes the usage of a pointer arithmetic and saves a few lines of
code.

Finally, struct_size() can be used. It is not a must have here, because
it is easy to see that buf_size can not overflow, but still, it is a good
practice.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/f4ca6b887ca1290c71e76247218adea4d1c42442.1721547559.git.christophe.jaillet@wanadoo.fr
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c