lkml.org 
[lkml]   [2023]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] HID: i2c-hid: use print_hex_dump_debug to print report descriptor
Date
From: Riwen Lu <luriwen@kylinos.cn>

The format '%*ph' print up to 64 bytes long as a hex string with ' '
sepatator. Usually the size of report descriptor is larger than 64
bytes, so consider using print_hex_dump_debug to print out all of it for
better debugging.

Signed-off-by: Riwen Lu <luriwen@kylinos.cn>

---
v1->v2:
- Add a prefix for the hex dump.
---
drivers/hid/i2c-hid/i2c-hid-core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
index efbba0465eef..fd82e9042da5 100644
--- a/drivers/hid/i2c-hid/i2c-hid-core.c
+++ b/drivers/hid/i2c-hid/i2c-hid-core.c
@@ -772,7 +772,9 @@ static int i2c_hid_parse(struct hid_device *hid)
}
}

- i2c_hid_dbg(ihid, "Report Descriptor: %*ph\n", rsize, rdesc);
+ i2c_hid_dbg(ihid, "Report Descriptor\n");
+ print_hex_dump_debug("Report Descriptor: ", DUMP_PREFIX_OFFSET, 16, 1,
+ rdesc, rsize, false);

ret = hid_parse_report(hid, rdesc, rsize);
if (!use_override)
--
2.25.1
\
 
 \ /
  Last update: 2023-08-16 10:49    [W:0.151 / U:0.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site