Skip to contentSkip to conversation

wifi: rtw88: debug: explicitly cast to u8 for %02x format in rtw_debugfs_get_tx_pwr_tbl()

PATCH In review Ping-Ke Shih 2 participants 3 messages Nov 18 – Nov 22 Realtek wireless driver (rtw88)

lore
Share & tools
lore

Ping-Ke Shih

author maintainer
#0 lore raw

PATCH 1/1 wifi: rtw88: debug: explicitly cast to u8 for %02x format in rtw_debugfs_get_tx_pwr_tbl()

Explicitly cast to u8 to avoid smatch (with -p=kernel) warning:

warn: argument 4 to %02x specifier has type 'schar'

---
 drivers/net/wireless/realtek/rtw88/debug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/realtek/rtw88/debug.c +2 -2
index 1061a1f4d5e9..11de50d39939 100644
@@ -739,8 +739,8 @@ static int rtw_debugfs_get_tx_pwr_tbl(struct seq_file *m, void *v)
 			seq_printf(m, "%4c ", path + 'A');
 			rtw_print_rate(m, rate);
 			seq_printf(m, " %3u(0x%02x) %4u %4d (%4d %4d %4d) %4d\n",
-				   hal->tx_pwr_tbl[path][rate],
-				   hal->tx_pwr_tbl[path][rate],
+				   (u8)hal->tx_pwr_tbl[path][rate],
+				   (u8)hal->tx_pwr_tbl[path][rate],
 				   pwr_param.pwr_base,
 				   min3(pwr_param.pwr_offset,
 					pwr_param.pwr_limit,

base-commit: 0bdc579dbfc251a6b6838ee9459b6771b948c617

Signature · 1 line
2.53.0
author maintainer
#2 lore raw
In reply to Ping-Ke Shih
Quoted 6 lines · Ping-Ke Shih

Explicitly cast to u8 to avoid smatch (with -p=kernel) warning:

warn: argument 4 to %02x specifier has type 'schar'

1 patch(es) applied to rtw-next branch of rtw.git, thanks.

770ac3b1bfb1 wifi: rtw88: debug: explicitly cast to u8 for %02x format in rtw_debugfs_get_tx_pwr_tbl()

---
https://github.com/pkshih/rtw.git