aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2013-09-03 10:48:26 -0400
committerJiri Kosina <jkosina@suse.cz>2013-09-04 05:42:10 -0400
commit95f712662d96ef7e50f5ca882c3f83d16f1e28f0 (patch)
tree42bf791e892dda8fba93538764f58ec8844ce0a9 /drivers/hid
parent8e22ecb603c88b7397ab2e80b7b0811b8a1318f5 (diff)
HID: hid-wiimote: print small buffers via %*phC
Instead of passing each byte through stack let's use %*phC specifier to dump buffer as a hex string. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-wiimote-core.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/hid/hid-wiimote-core.c b/drivers/hid/hid-wiimote-core.c
index d3055d1dbc06..bd2bc4a1f378 100644
--- a/drivers/hid/hid-wiimote-core.c
+++ b/drivers/hid/hid-wiimote-core.c
@@ -441,8 +441,7 @@ static __u8 wiimote_cmd_read_ext(struct wiimote_data *wdata, __u8 *rmem)
441 if (ret != 6) 441 if (ret != 6)
442 return WIIMOTE_EXT_NONE; 442 return WIIMOTE_EXT_NONE;
443 443
444 hid_dbg(wdata->hdev, "extension ID: %02x:%02x %02x:%02x %02x:%02x\n", 444 hid_dbg(wdata->hdev, "extension ID: %6phC\n", rmem);
445 rmem[0], rmem[1], rmem[2], rmem[3], rmem[4], rmem[5]);
446 445
447 if (rmem[0] == 0xff && rmem[1] == 0xff && rmem[2] == 0xff && 446 if (rmem[0] == 0xff && rmem[1] == 0xff && rmem[2] == 0xff &&
448 rmem[3] == 0xff && rmem[4] == 0xff && rmem[5] == 0xff) 447 rmem[3] == 0xff && rmem[4] == 0xff && rmem[5] == 0xff)
@@ -520,14 +519,12 @@ static bool wiimote_cmd_read_mp(struct wiimote_data *wdata, __u8 *rmem)
520 if (ret != 6) 519 if (ret != 6)
521 return false; 520 return false;
522 521
523 hid_dbg(wdata->hdev, "motion plus ID: %02x:%02x %02x:%02x %02x:%02x\n", 522 hid_dbg(wdata->hdev, "motion plus ID: %6phC\n", rmem);
524 rmem[0], rmem[1], rmem[2], rmem[3], rmem[4], rmem[5]);
525 523
526 if (rmem[5] == 0x05) 524 if (rmem[5] == 0x05)
527 return true; 525 return true;
528 526
529 hid_info(wdata->hdev, "unknown motion plus ID: %02x:%02x %02x:%02x %02x:%02x\n", 527 hid_info(wdata->hdev, "unknown motion plus ID: %6phC\n", rmem);
530 rmem[0], rmem[1], rmem[2], rmem[3], rmem[4], rmem[5]);
531 528
532 return false; 529 return false;
533} 530}
@@ -543,8 +540,7 @@ static __u8 wiimote_cmd_read_mp_mapped(struct wiimote_data *wdata)
543 if (ret != 6) 540 if (ret != 6)
544 return WIIMOTE_MP_NONE; 541 return WIIMOTE_MP_NONE;
545 542
546 hid_dbg(wdata->hdev, "mapped motion plus ID: %02x:%02x %02x:%02x %02x:%02x\n", 543 hid_dbg(wdata->hdev, "mapped motion plus ID: %6phC\n", rmem);
547 rmem[0], rmem[1], rmem[2], rmem[3], rmem[4], rmem[5]);
548 544
549 if (rmem[0] == 0xff && rmem[1] == 0xff && rmem[2] == 0xff && 545 if (rmem[0] == 0xff && rmem[1] == 0xff && rmem[2] == 0xff &&
550 rmem[3] == 0xff && rmem[4] == 0xff && rmem[5] == 0xff) 546 rmem[3] == 0xff && rmem[4] == 0xff && rmem[5] == 0xff)
@@ -1138,9 +1134,8 @@ static void wiimote_init_hotplug(struct wiimote_data *wdata)
1138 wiimote_ext_unload(wdata); 1134 wiimote_ext_unload(wdata);
1139 1135
1140 if (exttype == WIIMOTE_EXT_UNKNOWN) { 1136 if (exttype == WIIMOTE_EXT_UNKNOWN) {
1141 hid_info(wdata->hdev, "cannot detect extension; %02x:%02x %02x:%02x %02x:%02x\n", 1137 hid_info(wdata->hdev, "cannot detect extension; %6phC\n",
1142 extdata[0], extdata[1], extdata[2], 1138 extdata);
1143 extdata[3], extdata[4], extdata[5]);
1144 } else if (exttype == WIIMOTE_EXT_NONE) { 1139 } else if (exttype == WIIMOTE_EXT_NONE) {
1145 spin_lock_irq(&wdata->state.lock); 1140 spin_lock_irq(&wdata->state.lock);
1146 wdata->state.exttype = WIIMOTE_EXT_NONE; 1141 wdata->state.exttype = WIIMOTE_EXT_NONE;