[PATCH 5/5] wifi: mwifiex: use vmalloc_array() to simplify code

From: Qianfeng Rong
Date: Tue Aug 12 2025 - 09:48:25 EST


Remove array_size() calls and replace vmalloc() with vmalloc_array() to
simplify the code.

Signed-off-by: Qianfeng Rong <rongqianfeng@xxxxxxxx>
---
drivers/net/wireless/marvell/mwifiex/cfg80211.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index 3498743d5ec0..fb4183ff02a9 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -4673,8 +4673,8 @@ int mwifiex_init_channel_scan_gap(struct mwifiex_adapter *adapter)
* additional active scan request for hidden SSIDs on passive channels.
*/
adapter->num_in_chan_stats = 2 * (n_channels_bg + n_channels_a);
- adapter->chan_stats = vmalloc(array_size(sizeof(*adapter->chan_stats),
- adapter->num_in_chan_stats));
+ adapter->chan_stats = vmalloc_array(adapter->num_in_chan_stats,
+ sizeof(*adapter->chan_stats));

if (!adapter->chan_stats)
return -ENOMEM;
--
2.34.1