]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
staging: rtl8723bs: modernize hex output in rtw_report_sec_ie
authorLuka Gejak <lukagejak5@gmail.com>
Fri, 30 Jan 2026 18:56:57 +0000 (19:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Feb 2026 13:08:38 +0000 (14:08 +0100)
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>
drivers/staging/rtl8723bs/core/rtw_mlme.c

index 5693afabda2e8f65b52fa0b590827e9fd2963f7a..b3a9e40054a7f9e89ced806dbc351cf7544e5fe9 100644 (file)
@@ -2055,7 +2055,7 @@ static int rtw_append_pmkid(struct adapter *Adapter, int iEntry, u8 *ie, uint ie
 static void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
 {
        uint    len;
-       u8 *buff, *p, i;
+       u8 *buff, *p;
        union iwreq_data wrqu;
 
        buff = NULL;
@@ -2071,8 +2071,7 @@ static void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
                len = sec_ie[1] + 2;
                len = (len < IW_CUSTOM_MAX) ? len : IW_CUSTOM_MAX;
 
-               for (i = 0; i < len; i++)
-                       p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), "%02x", sec_ie[i]);
+               p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), " %*ph", len, sec_ie);
 
                p += scnprintf(p, IW_CUSTOM_MAX - (p - buff), ")");