linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] HID: i2c-hid: use print_hex_dump_debug to print report descriptor
@ 2023-07-03  6:01 Riwen Lu
  2023-08-14  9:26 ` Jiri Kosina
  0 siblings, 1 reply; 11+ messages in thread
From: Riwen Lu @ 2023-07-03  6:01 UTC (permalink / raw)
  To: jikos, benjamin.tissoires, dmitry.torokhov, linux, hdegoede,
	rrangel, u.kleine-koenig
  Cc: linux-input, linux-kernel, Riwen Lu

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>
---
 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..8e97fc01c852 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("  ", DUMP_PREFIX_OFFSET, 16, 1,
+			rdesc, rsize, false);
 
 	ret = hid_parse_report(hid, rdesc, rsize);
 	if (!use_override)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-09-01 15:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-03  6:01 [PATCH v1] HID: i2c-hid: use print_hex_dump_debug to print report descriptor Riwen Lu
2023-08-14  9:26 ` Jiri Kosina
2023-08-15  6:02   ` Riwen Lu
2023-08-15  6:35     ` Rahul Rameshbabu
2023-08-15  6:58       ` Riwen Lu
2023-08-16  8:38         ` [PATCH v2] " Riwen Lu
2023-08-17  4:25           ` Rahul Rameshbabu
2023-08-23  8:03             ` Riwen Lu
2023-08-26 17:26               ` Rahul Rameshbabu
2023-09-01  8:33                 ` [PATCH v3] " Riwen Lu
2023-09-01 15:59                   ` Rahul Rameshbabu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).