From patchwork Fri Sep 1 08:33:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riwen Lu X-Patchwork-Id: 13372255 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 251F8CA0FE6 for ; Fri, 1 Sep 2023 08:34:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234450AbjIAIeP (ORCPT ); Fri, 1 Sep 2023 04:34:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232145AbjIAIeO (ORCPT ); Fri, 1 Sep 2023 04:34:14 -0400 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01olkn2105.outbound.protection.outlook.com [40.92.98.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FC30E49; Fri, 1 Sep 2023 01:34:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UdbKmTVvNn09S43yrY807h5l/wNPX835vpPEJXVAqDugjY2wWMgge1aJRduAVhF+E8GRr2Pbz76wxMvSkkpyyiIulLn+sO1Dd83Xj6nyY2bbGnIT4JZ/8iTV1uwIua2RyQ/rt1TTxZaKwkXKd/HfOpPWGrZqKJMdRhKkTCk56qhDZitymH04eRqRpkYBI9CFeNXqXJXacuJmRve4qPP8lWsRMvP9DuRc4kqm7DWQFsGz2jBmJ4PVJ1hspD9wjs2CDQsSpiJdY5YLhX9ytpu5MRlQnyfGRdc038PJ+MbWoz/C++o6x4KLoabTvlW8DK40/FyR5OhjRMFqZDtu3KtARw== 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=1maS6Ie4blYrsUMWoXT0H9fmf9lpQ9Tur2lK0t5dStA=; b=e8NXR1HEuAlLQgCUv3wWaIKp2009l3dQR6slhsm3pFUOSD8S52bT57jAiEXyf0rRpOZy1TquKV+OqtpN916mOzkC78tz/KgWHmR4GcaB0QjPMKAsUVzkpXLeUiUGQGV4PVfw0jq27O3yseSbLG9TveqLvHoKTypJ/caD87K64Y38UXNWnjFkjsnyhWSfD50rgg7eRmV0XSzWE/ajjaFUzrY8PL2LhX9+7y3Gt0ni+BGe50fyEcNCXTG7L7vX01AvzmYzqCtrIOiBP37wT5AA5qN+skEMYeDUQRO1WGmw6GZn2xEBOYSYAWtQlG/Gtbe8512ZRijZclS3alflRY915g== 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=1maS6Ie4blYrsUMWoXT0H9fmf9lpQ9Tur2lK0t5dStA=; b=cpRnHVFFjQpVi5zo1YwgvIggpQFYZqVjTawSct+ZhTRNyjDVEHEGcAY9fUl4f/7pEDE+RthvFLkiTdBxGDGr40DNeqIjTdQ6EsvoAT/Xvz0F32D6AkdeUjxZfPbcOAAmR4wm1SyTEbrltSOcIiYbRj/vliBs7G0V5d7TGalLDyLxYZGx+tuWj4XJAeXz+/4doKuNIrB5HYcw82sfkY1tp/jEnw1ko/38OG3DuHGJ1rhpimYvUlqciVzgnAHSVY0jPHatbxDVt1AZ5xxg9gl/DRwiRE9wCYJIFMxUgYZzRRERcEl06C0mqXEaE3AA75kntjD1TtUSZAEw6L3qs8n5NQ== Received: from TYCP286MB2607.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:242::11) by TY3P286MB2548.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:22c::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.16; Fri, 1 Sep 2023 08:34:07 +0000 Received: from TYCP286MB2607.JPNP286.PROD.OUTLOOK.COM ([fe80::320e:3328:32e4:a3ce]) by TYCP286MB2607.JPNP286.PROD.OUTLOOK.COM ([fe80::320e:3328:32e4:a3ce%4]) with mapi id 15.20.6768.016; Fri, 1 Sep 2023 08:34:06 +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, sergeantsagara@protonmail.com, Riwen Lu Subject: [PATCH v3] HID: i2c-hid: use print_hex_dump_debug to print report descriptor Date: Fri, 1 Sep 2023 16:33:56 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: <87bketu33z.fsf@protonmail.com> References: <87bketu33z.fsf@protonmail.com> X-TMN: [JyIlt+0tQ3FtwKYnUJW6I6m1nq2zxbUl] X-ClientProxiedBy: TYCPR01CA0108.jpnprd01.prod.outlook.com (2603:1096:405:4::24) To TYCP286MB2607.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:242::11) X-Microsoft-Original-Message-ID: <20230901083356.626091-1-luriwen@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCP286MB2607:EE_|TY3P286MB2548:EE_ X-MS-Office365-Filtering-Correlation-Id: 50e3074d-ad27-4700-b68b-08dbaac63483 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MvdwPFuioO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dZe9pUg4JiLBQlIDfY4+LEMNt3b12Cfr0rn9INEnL1jo6+4EmIIIRNg1vcPqn+OS6MTUW12WBeQ8qqNisG/44Lb1fSuuqiVo1uqIShurE4HcG9K4eOz+ejFl+qVwYIezK3w7ovJ7RA5kbS//Xt9jZfuagoRtsf8HfaZdxSKng4sxWTM25dU0W8BVdfhBUHBM/YYJqp+O5lrSKR1LKnh3joaDfa0rup9C8cHIFZZPzMn1+STKmKtrXZlbBJS01YfJUWsqHxttdxJn3buCDoRGnmbwsGPIUkdbHj5juxAWAbG5v44HeCToxljbi+mc5CvdVFk8/OYI5Kc2cTbHqGS7e/1LURS3SwNaNO19X4xbiIEq3fMjfvf/wuCaX3r/o32p6Os6Yn46rq/L3PpEYBM8QtaVxwPWFcNlIFHf4DCjPbvm74TogmgB4TmOvSaGw4oGqJaj9iBVxxMomGF1+tIHk2JFMs6e42sW1FrA641FHkq8b9nGWD35BIaNJ7H4TbMBTsnlLrU+6dCExmONv+rPRl1g83tVqUpiwtubusiCtVlA4dfAVN4o87vZDlsStmNdMPOqi68+LHEVAA9yde9YwuConHtFHFuq3uoBN61esHafqz4pSp/wx5RBMN0Aho3dcGsP2vM3LoqtKEG2UkWaCjM/sd6uX6xTPIi1LnQ1V8ajC7NkoJ2oYQp8a9QeIwPTOXZPrSgFfq1rcP6/sX2xxCrWSh6Oq/hGmaFKQWEzj3ARiABrrafoDLoe3E6xzTGJQxSPOUJqLcvMCpHwHUiSSverJRM++Q== X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-05f45.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 50e3074d-ad27-4700-b68b-08dbaac63483 X-MS-Exchange-CrossTenant-AuthSource: TYCP286MB2607.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2023 08:34:06.8624 (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: TY3P286MB2548 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Riwen Lu The format '%*ph' prints up to 64 bytes long as a hex string with ' ' separator. 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 Reviewed-by: Rahul Rameshbabu --- v1->v2: - Add a prefix for the hex dump. v2->v3: - Print the size of report descriptor. --- 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..dd69abdd1f0d 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 size: %#x\n", rsize); + print_hex_dump_debug("Report Descriptor: ", DUMP_PREFIX_OFFSET, 16, 1, + rdesc, rsize, false); ret = hid_parse_report(hid, rdesc, rsize); if (!use_override)