Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

OLPC: Use %*ph specifier instead of passing direct values

The %*ph specifier allows to dump small buffers in hex format. Let's use it
instead of passing direct values via stack.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Paul Fox <pgf@laptop.org>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>

authored by

Andy Shevchenko and committed by
Darren Hart
7d3777d1 3a4bceef

+5 -8
+5 -8
drivers/platform/olpc/olpc-ec.c
··· 192 192 for (i = 0; i <= ec_cmd_bytes; i++) 193 193 ec_cmd[i] = ec_cmd_int[i]; 194 194 195 - pr_debug("olpc-ec: debugfs cmd 0x%02x with %d args %02x %02x %02x %02x %02x, want %d returns\n", 196 - ec_cmd[0], ec_cmd_bytes, ec_cmd[1], ec_cmd[2], 197 - ec_cmd[3], ec_cmd[4], ec_cmd[5], ec_dbgfs_resp_bytes); 195 + pr_debug("olpc-ec: debugfs cmd 0x%02x with %d args %5ph, want %d returns\n", 196 + ec_cmd[0], ec_cmd_bytes, ec_cmd + 1, 197 + ec_dbgfs_resp_bytes); 198 198 199 199 olpc_ec_cmd(ec_cmd[0], (ec_cmd_bytes == 0) ? NULL : &ec_cmd[1], 200 200 ec_cmd_bytes, ec_dbgfs_resp, ec_dbgfs_resp_bytes); 201 201 202 - pr_debug("olpc-ec: response %02x %02x %02x %02x %02x %02x %02x %02x (%d bytes expected)\n", 203 - ec_dbgfs_resp[0], ec_dbgfs_resp[1], ec_dbgfs_resp[2], 204 - ec_dbgfs_resp[3], ec_dbgfs_resp[4], ec_dbgfs_resp[5], 205 - ec_dbgfs_resp[6], ec_dbgfs_resp[7], 206 - ec_dbgfs_resp_bytes); 202 + pr_debug("olpc-ec: response %8ph (%d bytes expected)\n", 203 + ec_dbgfs_resp, ec_dbgfs_resp_bytes); 207 204 208 205 out: 209 206 mutex_unlock(&ec_dbgfs_lock);