Skip to content

Commit

Permalink
HID: thingm: simplify debug output code
Browse files Browse the repository at this point in the history
Kernel printf format %*ph allows to print small buffers up to 64 bytes.
Make use of it to simplify the debug output code.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Heiner Kallweit authored and Jiri Kosina committed Jun 20, 2016
1 parent 6be28d3 commit ddfe848
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/hid/hid-thingm.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ static int thingm_send(struct thingm_device *tdev, u8 buf[REPORT_SIZE])
{
int ret;

hid_dbg(tdev->hdev, "-> %d %c %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx\n",
buf[0], buf[1], buf[2], buf[3], buf[4],
buf[5], buf[6], buf[7], buf[8]);
hid_dbg(tdev->hdev, "-> %d %c %7ph\n", buf[0], buf[1], &buf[2]);

mutex_lock(&tdev->lock);

Expand Down Expand Up @@ -110,9 +108,7 @@ static int thingm_recv(struct thingm_device *tdev, u8 buf[REPORT_SIZE])

ret = 0;

hid_dbg(tdev->hdev, "<- %d %c %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx\n",
buf[0], buf[1], buf[2], buf[3], buf[4],
buf[5], buf[6], buf[7], buf[8]);
hid_dbg(tdev->hdev, "<- %d %c %7ph\n", buf[0], buf[1], &buf[2]);
err:
mutex_unlock(&tdev->lock);
return ret;
Expand Down

0 comments on commit ddfe848

Please sign in to comment.