wifi: nxpwifi: use str_on_off() for carrier state

Both carrier prints open code the on/off ternary. Use the helper from
string_choices.h instead. No change in output.

Signed-off-by: Aryan Sinha <sinha.aryan03@gmail.com>
Signed-off-by: Jeff Chen <jeff.chen_1@nxp.com>
This commit is contained in:
Aryan Sinha 2026-10-14 00:16:25 +05:30 committed by Jeff Chen
parent f86bc8a742
commit 12af2f77de
2 changed files with 6 additions and 4 deletions

View File

@ -6,6 +6,7 @@
*/
#include <linux/debugfs.h>
#include <linux/string_choices.h>
#include "main.h"
#include "cmdevt.h"
@ -98,8 +99,8 @@ nxpwifi_info_read(struct file *file, char __user *ubuf,
p += sprintf(p, "num_rx_pkts_dropped = %lu\n", priv->stats.rx_dropped);
p += sprintf(p, "num_tx_pkts_err = %lu\n", priv->stats.tx_errors);
p += sprintf(p, "num_rx_pkts_err = %lu\n", priv->stats.rx_errors);
p += sprintf(p, "carrier %s\n", ((netif_carrier_ok(priv->netdev))
? "on" : "off"));
p += sprintf(p, "carrier %s\n",
str_on_off(netif_carrier_ok(priv->netdev)));
p += sprintf(p, "tx queue");
for (i = 0; i < netdev->num_tx_queues; i++) {
txq = netdev_get_tx_queue(netdev, i);

View File

@ -5,6 +5,7 @@
* Copyright 2011-2024 NXP
*/
#include <linux/string_choices.h>
#include <linux/suspend.h>
#include "main.h"
@ -1094,8 +1095,8 @@ void nxpwifi_drv_info_dump(struct nxpwifi_adapter *adapter)
atomic_read(&priv->wmm_tx_pending[3]));
p += sprintf(p, "media_state=\"%s\"\n", !priv->media_connected ?
"Disconnected" : "Connected");
p += sprintf(p, "carrier %s\n", (netif_carrier_ok(priv->netdev)
? "on" : "off"));
p += sprintf(p, "carrier %s\n",
str_on_off(netif_carrier_ok(priv->netdev)));
for (idx = 0; idx < priv->netdev->num_tx_queues; idx++) {
txq = netdev_get_tx_queue(priv->netdev, idx);
p += sprintf(p, "tx queue %d:%s ", idx,