diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2015-07-16 08:42:14 -0400 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-08-16 03:22:10 -0400 |
commit | 3cd6e2f768851a760c072f0f84b9688b1755d24d (patch) | |
tree | 9fd3eda40b400b02b77a44adf50a811c15d5539d /drivers/net/wireless/iwlwifi/mvm/debugfs.c | |
parent | 1be5d8cc165d56b7267f5adc96d496a33c33219e (diff) |
iwlwifi: convert hex_dump_to_buffer() to %*ph
There is no need to use hex_dump_to_buffer() in the cases like this:
hexdump_to_buffer(buf, len, 16, 1, outbuf, outlen, false); /* len <= 16 */
sprintf("%s\n", outbuf);
since it maybe easily converted to simple:
sprintf("%*ph\n", len, buf);
Note: it seems in one case the output is groupped by 2 bytes and looks like a
typo. Thus, patch changes that to plain byte stream.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/debugfs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/debugfs.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/iwlwifi/mvm/debugfs.c index 17d7a05006fa..ca4a1f8f82a5 100644 --- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c +++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c | |||
@@ -1200,12 +1200,7 @@ static ssize_t iwl_dbgfs_d3_sram_read(struct file *file, char __user *user_buf, | |||
1200 | if (ptr) { | 1200 | if (ptr) { |
1201 | for (ofs = 0; ofs < len; ofs += 16) { | 1201 | for (ofs = 0; ofs < len; ofs += 16) { |
1202 | pos += scnprintf(buf + pos, bufsz - pos, | 1202 | pos += scnprintf(buf + pos, bufsz - pos, |
1203 | "0x%.4x ", ofs); | 1203 | "0x%.4x %16ph\n", ofs, ptr + ofs); |
1204 | hex_dump_to_buffer(ptr + ofs, 16, 16, 1, buf + pos, | ||
1205 | bufsz - pos, false); | ||
1206 | pos += strlen(buf + pos); | ||
1207 | if (bufsz - pos > 0) | ||
1208 | buf[pos++] = '\n'; | ||
1209 | } | 1204 | } |
1210 | } else { | 1205 | } else { |
1211 | pos += scnprintf(buf + pos, bufsz - pos, | 1206 | pos += scnprintf(buf + pos, bufsz - pos, |