Skip to content

Commit 3db1248

Browse files
MocLGgregkh
authored andcommitted
staging: rtl8723bs: modernize hex output in rtw_report_sec_ie
Replace the manual hex-printing loop with the standard kernel '%*ph' format string. This simplifies the code and uses modern logging practices. Signed-off-by: Luka Gejak <lukagejak5@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://patch.msgid.link/20260130185658.207785-5-lukagejak5@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 908c03b commit 3db1248

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/staging/rtl8723bs/core/rtw_mlme.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2055,7 +2055,7 @@ static int rtw_append_pmkid(struct adapter *Adapter, int iEntry, u8 *ie, uint ie
20552055
static void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
20562056
{
20572057
uint len;
2058-
u8 *buff, *p, i;
2058+
u8 *buff, *p;
20592059
union iwreq_data wrqu;
20602060

20612061
buff = NULL;
@@ -2071,8 +2071,7 @@ static void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
20712071
len = sec_ie[1] + 2;
20722072
len = (len < IW_CUSTOM_MAX) ? len : IW_CUSTOM_MAX;
20732073

2074-
for (i = 0; i < len; i++)
2075-
p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), "%02x", sec_ie[i]);
2074+
p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), " %*ph", len, sec_ie);
20762075

20772076
p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), ")");
20782077

0 commit comments

Comments
 (0)