[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1c94956e-4105-4a01-9f47-6abd18a97ec9@vivo.com>
Date: Wed, 9 Jul 2025 14:42:33 +0800
From: Qianfeng Rong <rongqianfeng@...o.com>
To: Jeff Chen <jeff.chen_1@....com>
Cc: Brian Norris <briannorris@...omium.org>,
Francesco Dolcini <francesco@...cini.it>,
Johannes Berg <johannes.berg@...el.com>,
Sascha Hauer <s.hauer@...gutronix.de>, Kalle Valo <kvalo@...nel.org>,
David Lin <yu-hao.lin@....com>, Aditya Kumar Singh <quic_adisi@...cinc.com>,
Dan Carpenter <dan.carpenter@...aro.org>,
"open list:MARVELL MWIFIEX WIRELESS DRIVER"
<linux-wireless@...r.kernel.org>, open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 10/12] wifi: mwifiex: Use max() to improve code
在 2025/7/9 13:42, Jeff Chen 写道:
> - if (adapter->max_sta_conn > adapter->max_p2p_conn)
> - wiphy->max_ap_assoc_sta = adapter->max_sta_conn;
> - else
> - wiphy->max_ap_assoc_sta = adapter->max_p2p_conn;
> + wiphy->max_ap_assoc_sta = max(adapter->max_sta_conn,
> + adapter->max_p2p_conn);
> adapter->max_sta_conn and adapter->max_p2p_conn are u8, and wiphy->max_ap_assoc_sta is u16.
> To ensure type safety and maintainability, I recommend using max_t() with typeof():
> wiphy->max_ap_assoc_sta = max_t(typeof(wiphy->max_ap_assoc_sta),
> adapter->max_sta_conn,
> adapter->max_p2p_conn);
>
Thanks for taking the time to reply.
I will try to do this in the next version.
Best regards,
Qianfeng
>
Powered by blists - more mailing lists