From patchwork Mon Jul 3 06:01:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riwen Lu X-Patchwork-Id: 13299597 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A45CEB64DC for ; Mon, 3 Jul 2023 06:01:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229482AbjGCGBR (ORCPT ); Mon, 3 Jul 2023 02:01:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbjGCGBP (ORCPT ); Mon, 3 Jul 2023 02:01:15 -0400 Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01olkn2107.outbound.protection.outlook.com [40.92.99.107]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8876AB6; Sun, 2 Jul 2023 23:01:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jU1RcN1vZWW8xl9i/gtBCNGj9VyQy5A2GJsUktZeQdzZ+Fs7Il+7QlKzJvJbLhbj9NjJM4k7K41Q2nnMzdl1uP9zVwWUQTuwYSAXhI+xVcbIuIH86Vh1TCvewDb/7jLckxhfoFTCau8+3MnU+cpJ23synCs2PaJu2Inh6BqMWBNXzwIDGQkLL7wWwJAvGsL4zq2TBJpWHiLi3PJjfwtqj+dPURe9GYu/NaLQ9GHE1Clk9y7REGAkF1OU79owWT5s66SGQ6VzRAyh8sdR3jJcz5ERLEk03gzkhWh+tCcWRlliH/VSA/tbOsJsfHu7edvdFxKxvkOLiPsEjPnp4G+5Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4AaBpr/rGzMU/eCVW1j4z5uShwgdW5zkI90l+rqm+24=; b=hTuSG0Y0zwS+ElIhOksXhnlFVtOmRNNbJq+aA/BvSvKEitllRMiDY6olktmo7wv+FsfTW7/s3K6T21TLDrcC9Xi7ptIpsM15Z1bFMrPSLb6kglpuqD8fRLKT78aISJLWpdSyrOIJrbQXjbfcQmeLePcQDUrOZBDVBSCmo9bzMiFlJ2CJZ9GUs/M4a4Wrx+Xk/Uk2J5BCjaLGYR1UJYijl0gJ9BVuKooYg4ucEFKaG7QKHa70XdDqat7sC1YYyl6T8izCkPiW2cawHWrC5HHb5128hAaEUG4RmJ7GtokIzwMg482qTOx1tbAClPZOq4hZP2Tv1MqCodPzFCvqXqcipg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4AaBpr/rGzMU/eCVW1j4z5uShwgdW5zkI90l+rqm+24=; b=WWOXIT33itR1KI2+L0ffM+B1F9wY6gLiAOkB4zc1Ik9B6f9okZtjTWx8R9RzO0oX03CLBgVSuWo2rNjCc/Mz6tzdCHMuHp0BKNjZa0khX9BRrndtk8jTwXIZlDU+ZUhX/3oZowTiGP8YMl7HnB7ey+c8gtXKpm0SUWoTa7KwpmpBsZpDpi5L8qbgixN1flgSuASaWRZR/CG14F34iNz/D3rjxM/GhqdUw2J3NeC5O+aaiixDd1VZXdM0DpGhwJbgKviYm7aRx9ehXcfDF05JNNvXSGkalNqIjU7/nXhOyp+Mo2SrWy79aR1ypa8M1P14rqZiCPCXKD3Zx7pBHHvJ5w== Received: from TYCP286MB2607.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:242::11) by TYCP286MB3500.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3ab::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.19; Mon, 3 Jul 2023 06:01:10 +0000 Received: from TYCP286MB2607.JPNP286.PROD.OUTLOOK.COM ([fe80::75d1:d30d:7d07:903b]) by TYCP286MB2607.JPNP286.PROD.OUTLOOK.COM ([fe80::75d1:d30d:7d07:903b%6]) with mapi id 15.20.6544.024; Mon, 3 Jul 2023 06:01:10 +0000 From: Riwen Lu To: 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 Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Riwen Lu Subject: [PATCH v1] HID: i2c-hid: use print_hex_dump_debug to print report descriptor Date: Mon, 3 Jul 2023 14:01:00 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 X-TMN: [M7+xyUHamD/eX9Uc563d2Ii0v0/TFAIw] X-ClientProxiedBy: TYCP286CA0283.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c9::11) To TYCP286MB2607.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:242::11) X-Microsoft-Original-Message-ID: <20230703060100.1877782-1-luriwen@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCP286MB2607:EE_|TYCP286MB3500:EE_ X-MS-Office365-Filtering-Correlation-Id: 7c186320-a883-4999-eae5-08db7b8ae662 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wCnaTCq/aGWwY32hIKIkVR4twvXcakOg4mWqT9nVq+JcFn8HJVZ08Cm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Ijwvs5z8BlFEiw+nMXNWyGMetrZnoc09EwQTivRKN26uGM1YF1QDzKgC2kT/E8QBZqhOZ+IBJMQV/iMad87baiQLqwthqFHcSp7cFKePe6mI/MDRjJravbsWGGVfEIFTUbwia18nBR1dOEsnWx6EUNGDcELEfV/h6NAc1sVnSJcJ7/NIFfVRsUdS0aIT6khQWT20WIaxeRTtAdUgD6PGsObG/rkT+GwY7sNdmC6qzCzxrHmRooCMVJwB3UDPQsjbmqb6bWGx52i98zL44lff/cl/FT3aaPfCW//6hJqyA3rR4pdlpg5UDwHjU3R+iQBd+pP5IrBQ9fizNpWnyMqZ3povLd3hacTyDC2eaIxzKb4XGvDoolkFH4U9zsXxCZ4Xv7L/aT6JO+VGjY8dkT3yxVOqo9WiqoYulloetniO9mQJgR51gHe5FuWv28eAkKnBjvvNMoNKWji6XzV54JrdT1jrtepDRRaaYfC1OBB9ZJ2+SIunQP0ZNrRRSZXKnuPyC5UjkoMTiPF7WF19OxP/jJIbV0ZC2NURdCHoLuniXpQWU6sGVMZX2pfze7HlQsAlLrW0X0sY4lPFrRZFOIl8yaKr0R1j2XXhJGAUTN7z3LVLvGw+3UCMB5vR+XfHE3CUF4sgJ851eFQvRkz/zij8QxtGB1/vpbH/j1EQZHuUNuWMEC3STG/cDmtdQiEnZY1O8AvKNKBWPSifVAcUi4QFrl28A== X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-05f45.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 7c186320-a883-4999-eae5-08db7b8ae662 X-MS-Exchange-CrossTenant-AuthSource: TYCP286MB2607.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2023 06:01:10.7751 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCP286MB3500 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Riwen Lu 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 --- 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)