]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: brcmsmac: Use str_true_false() helper
authorLiu Song <liu.song13@zte.com.cn>
Wed, 23 Jul 2025 09:30:04 +0000 (17:30 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 23 Jul 2025 12:11:28 +0000 (14:11 +0200)
Remove hard-coded strings by using the str_true_false() helper function.

Signed-off-by: Liu Song <liu.song13@zte.com.cn>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>>
Link: https://patch.msgid.link/20250723173004776P6QSjcW7NrlpGYLTFM-yP@zte.com.cn
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c

index 8ab452cf48c45778ef59d1d86396ce90c27bbda6..aadcff1e2b5d44d7528ccb2e975b3784be77c84a 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/bcma/bcma.h>
+#include <linux/string_choices.h>
 #include <net/mac80211.h>
 #include <defs.h>
 #include "phy/phy_int.h"
@@ -540,13 +541,13 @@ static int brcms_ops_config(struct ieee80211_hw *hw, int radio_idx,
                                                   conf->listen_interval);
        }
        if (changed & IEEE80211_CONF_CHANGE_MONITOR)
-               brcms_dbg_info(core, "%s: change monitor mode: %s\n",
-                              __func__, conf->flags & IEEE80211_CONF_MONITOR ?
-                              "true" : "false");
+               brcms_dbg_info(core, "%s: change monitor mode: %s\n", __func__,
+                              str_true_false(conf->flags &
+                                             IEEE80211_CONF_MONITOR));
        if (changed & IEEE80211_CONF_CHANGE_PS)
                brcms_err(core, "%s: change power-save mode: %s (implement)\n",
-                         __func__, conf->flags & IEEE80211_CONF_PS ?
-                         "true" : "false");
+                         __func__,
+                         str_true_false(conf->flags & IEEE80211_CONF_PS));
 
        if (changed & IEEE80211_CONF_CHANGE_POWER) {
                err = brcms_c_set_tx_power(wl->wlc, conf->power_level);
@@ -697,7 +698,7 @@ brcms_ops_bss_info_changed(struct ieee80211_hw *hw,
        if (changed & BSS_CHANGED_BEACON_ENABLED) {
                /* Beaconing should be enabled/disabled (beaconing modes) */
                brcms_err(core, "%s: Beacon enabled: %s\n", __func__,
-                         info->enable_beacon ? "true" : "false");
+                         str_true_false(info->enable_beacon));
                if (info->enable_beacon &&
                    hw->wiphy->flags & WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD) {
                        brcms_c_enable_probe_resp(wl->wlc, true);
@@ -716,7 +717,7 @@ brcms_ops_bss_info_changed(struct ieee80211_hw *hw,
        if (changed & BSS_CHANGED_IBSS) {
                /* IBSS join status changed */
                brcms_err(core, "%s: IBSS joined: %s (implement)\n",
-                         __func__, vif->cfg.ibss_joined ? "true" : "false");
+                         __func__, str_true_false(vif->cfg.ibss_joined));
        }
 
        if (changed & BSS_CHANGED_ARP_FILTER) {
@@ -731,7 +732,7 @@ brcms_ops_bss_info_changed(struct ieee80211_hw *hw,
                 * Note that it is only ever disabled for station mode.
                 */
                brcms_err(core, "%s: qos enabled: %s (implement)\n",
-                         __func__, info->qos ? "true" : "false");
+                         __func__, str_true_false(info->qos));
        }
        return;
 }
@@ -908,7 +909,7 @@ static void brcms_ops_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
        struct brcms_info *wl = hw->priv;
        int ret;
 
-       no_printk("%s: drop = %s\n", __func__, drop ? "true" : "false");
+       no_printk("%s: drop = %s\n", __func__, str_true_false(drop));
 
        ret = wait_event_timeout(wl->tx_flush_wq,
                                 brcms_tx_flush_completed(wl),