summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQianfeng Rong <rongqianfeng@vivo.com>2025-07-15 20:16:51 +0800
committerJohannes Berg <johannes.berg@intel.com>2025-07-18 14:13:58 +0200
commit37fa920819363254d0701c6f3693a81538f99b2e (patch)
tree7bc4bba33d120f3c5ca9fcb9c1fbcc172af02f8c
parentb60c49590a1e268305d1da4f8593d2b54468b6c4 (diff)
wifi: mwifiex: Use max_t() to improve code
Use max_t() to reduce the code and improve its readability. Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com> Reviewed-by: Jeff Chen <jeff.chen_1@nxp.con> Link: https://patch.msgid.link/20250715121721.266713-6-rongqianfeng@vivo.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--drivers/net/wireless/marvell/mwifiex/cfg80211.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index 286378770e9e..3498743d5ec0 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -4783,10 +4783,9 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
wiphy->iface_combinations = &mwifiex_iface_comb_ap_sta;
wiphy->n_iface_combinations = 1;
- 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_t(typeof(wiphy->max_ap_assoc_sta),
+ adapter->max_sta_conn,
+ adapter->max_p2p_conn);
/* Initialize cipher suits */
wiphy->cipher_suites = mwifiex_cipher_suites;