rtl8xxxu: tuse %*ph to dump buffers
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 9 Jun 2016 18:38:49 +0000 (14:38 -0400)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 29 Jun 2016 15:44:32 +0000 (18:44 +0300)
Use %*ph specifier to dump small buffers in hex format instead of doing this
byte-by-byte.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c

index 2c86b5599a309b262acd005811066223c5d49a47..eefb7ca3a35a85e5e62ae9daf97a1617afa7cef8 100644 (file)
@@ -413,13 +413,8 @@ static int rtl8192cu_parse_efuse(struct rtl8xxxu_priv *priv)
                dev_info(&priv->udev->dev,
                         "%s: dumping efuse (0x%02zx bytes):\n",
                         __func__, sizeof(struct rtl8192cu_efuse));
-               for (i = 0; i < sizeof(struct rtl8192cu_efuse); i += 8) {
-                       dev_info(&priv->udev->dev, "%02x: "
-                                "%02x %02x %02x %02x %02x %02x %02x %02x\n", i,
-                                raw[i], raw[i + 1], raw[i + 2],
-                                raw[i + 3], raw[i + 4], raw[i + 5],
-                                raw[i + 6], raw[i + 7]);
-               }
+               for (i = 0; i < sizeof(struct rtl8192cu_efuse); i += 8)
+                       dev_info(&priv->udev->dev, "%02x: %8ph\n", i, &raw[i]);
        }
        return 0;
 }
index fe19ace0d6a01bf75ff0f6e2d9ba38b6c32b2de3..65c079afb11b33aa78f64a247af8938a253ff9cb 100644 (file)
@@ -622,13 +622,8 @@ static int rtl8192eu_parse_efuse(struct rtl8xxxu_priv *priv)
                dev_info(&priv->udev->dev,
                         "%s: dumping efuse (0x%02zx bytes):\n",
                         __func__, sizeof(struct rtl8192eu_efuse));
-               for (i = 0; i < sizeof(struct rtl8192eu_efuse); i += 8) {
-                       dev_info(&priv->udev->dev, "%02x: "
-                                "%02x %02x %02x %02x %02x %02x %02x %02x\n", i,
-                                raw[i], raw[i + 1], raw[i + 2],
-                                raw[i + 3], raw[i + 4], raw[i + 5],
-                                raw[i + 6], raw[i + 7]);
-               }
+               for (i = 0; i < sizeof(struct rtl8192eu_efuse); i += 8)
+                       dev_info(&priv->udev->dev, "%02x: %8ph\n", i, &raw[i]);
        }
        return 0;
 }
index 4186e7cf0ddf8a7480d960d2f8d96939be732084..9d45afb0e3fd79180e49f807c8ae698f49ff3dd8 100644 (file)
@@ -466,13 +466,8 @@ static int rtl8723bu_parse_efuse(struct rtl8xxxu_priv *priv)
                dev_info(&priv->udev->dev,
                         "%s: dumping efuse (0x%02zx bytes):\n",
                         __func__, sizeof(struct rtl8723bu_efuse));
-               for (i = 0; i < sizeof(struct rtl8723bu_efuse); i += 8) {
-                       dev_info(&priv->udev->dev, "%02x: "
-                                "%02x %02x %02x %02x %02x %02x %02x %02x\n", i,
-                                raw[i], raw[i + 1], raw[i + 2],
-                                raw[i + 3], raw[i + 4], raw[i + 5],
-                                raw[i + 6], raw[i + 7]);
-               }
+               for (i = 0; i < sizeof(struct rtl8723bu_efuse); i += 8)
+                       dev_info(&priv->udev->dev, "%02x: %8ph\n", i, &raw[i]);
        }
 
        return 0;