All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andrea G. Monaco" <andrea.monaco@autistici.org>
To: linux-input@vger.kernel.org
Subject: [PATCH] i2c_hid: print the full HID report descriptor when debug is on
Date: Tue, 08 Jun 2021 20:18:03 +0200	[thread overview]
Message-ID: <87im2ofcf8.fsf@autistici.org> (raw)


Hello,


right now i2c_hid uses printk to dump the HID report descriptor when
debug is on. This means that only the first 64 bytes get printed, but a
typical descriptor is bigger (mine is 665 bytes).

This patch prints the whole thing.



diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
index 46474612e73c..4512bf1bad41 100644
--- a/drivers/hid/i2c-hid/i2c-hid-core.c
+++ b/drivers/hid/i2c-hid/i2c-hid-core.c
@@ -746,7 +746,11 @@ 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:");
+
+       if (debug)
+               print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_NONE, 32, 1, rdesc, rsize, false);
+
 
        ret = hid_parse_report(hid, rdesc, rsize);
        if (!use_override)

                 reply	other threads:[~2021-06-08 18:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=87im2ofcf8.fsf@autistici.org \
    --to=andrea.monaco@autistici.org \
    --cc=linux-input@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.