From: Rahul Rameshbabu <sergeantsagara@protonmail.com>
To: Riwen Lu <luriwen@hotmail.com>
Cc: jikos@kernel.org, benjamin.tissoires@redhat.com,
dmitry.torokhov@gmail.com, linux@weissschuh.net,
hdegoede@redhat.com, rrangel@chromium.org,
u.kleine-koenig@pengutronix.de, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org, Riwen Lu <luriwen@kylinos.cn>
Subject: Re: [PATCH v2] HID: i2c-hid: use print_hex_dump_debug to print report descriptor
Date: Thu, 17 Aug 2023 04:25:43 +0000 [thread overview]
Message-ID: <87msyq5m7y.fsf@protonmail.com> (raw)
In-Reply-To: <OS3P286MB259916DCE3D992135FF05F4CB115A@OS3P286MB2599.JPNP286.PROD.OUTLOOK.COM>
On Wed, 16 Aug, 2023 16:38:19 +0800 "Riwen Lu" <luriwen@hotmail.com> wrote:
> 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");
Instead of just indicating that the report descriptor dump begins with
the above print, I think it makes more sense for the print to be changed
to a pair of begin/end or "cut here" prints similar to what you see in
oops messages. This will help individuals reading reports copied by bug
reporters validate that the complete descriptor dump is present.
Something along the lines of what is done in sound/soc/sof/debug.c.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/soc/sof/debug.c?id=4853c74bd7ab7fdb83f319bd9ace8a08c031e9b6#n407
> + print_hex_dump_debug("Report Descriptor: ", DUMP_PREFIX_OFFSET, 16, 1,
> + rdesc, rsize, false);
>
--
Thanks,
Rahul Rameshbabu
next prev parent reply other threads:[~2023-08-17 4:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87msyq5m7y.fsf@protonmail.com \
--to=sergeantsagara@protonmail.com \
--cc=benjamin.tissoires@redhat.com \
--cc=dmitry.torokhov@gmail.com \
--cc=hdegoede@redhat.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=luriwen@hotmail.com \
--cc=luriwen@kylinos.cn \
--cc=rrangel@chromium.org \
--cc=u.kleine-koenig@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).