From patchwork Wed Feb 27 11:07:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louis Taylor X-Patchwork-Id: 10831563 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EB3311390 for ; Wed, 27 Feb 2019 11:08:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5A072A5EF for ; Wed, 27 Feb 2019 11:08:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9D242C8C2; Wed, 27 Feb 2019 11:08:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8992F2A5EF for ; Wed, 27 Feb 2019 11:08:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726265AbfB0LI2 (ORCPT ); Wed, 27 Feb 2019 06:08:28 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:37512 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726092AbfB0LI1 (ORCPT ); Wed, 27 Feb 2019 06:08:27 -0500 Received: by mail-wr1-f65.google.com with SMTP id w6so14196159wrs.4 for ; Wed, 27 Feb 2019 03:08:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kragniz.eu; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xVgaF+6RCsy76G62m4+uEGC9wcs64CsqkQWHMsa431Q=; b=iMup3HxvT8clgaIFE2CxprbdkRG2pdDGVrQx067aKuQiQ4A0ey688XFpdHh/2tL/QM i85zru5+xjngwSMz1F83WUQSayeXV498Ks8+UVO1prQ8PT915qLd7UcTOZOCtREdM5V5 o75vM/JHplHW223ZSJEE28WX6Jn1es36eUI4I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xVgaF+6RCsy76G62m4+uEGC9wcs64CsqkQWHMsa431Q=; b=rQGHnDRgiq6vq2koYJDM5Jl4vJLz6blXDH/KyXe1K+ErszfjZ+miZBhODnf5C2MvRW kRMaJdMoQO5eodNeCllfaOAD8guGw4N9tCcxi1mtBLkShUSh7CE67tUYIq8tsBo+qExZ T12++P9IgTNMn356wLGsqgVDz2dYAn+x9g6eA37VHNm3Jt3g+Km0kk6b1HeofB4sbH93 YoVESMrYk/ayXPVy0SU19xxvb6+0nb2NQtElnp0+kleFaAwMzzQbdC4Nf38dX9nCcIXr s1fQ2fs3HHnIBI+plxDu8ZRSQ1CK+uRRRrYR8KD6ukjxsG8kayyNXNuxDkGpKhDQVu1z cUEA== X-Gm-Message-State: APjAAAUTH3iCkijX8tttODmBN3u6YlcZ4NKom2c+QAWsycHBw1KACK4H pLkd2bQyqFHsN0VjVxAYKNcI1aaLRJc20g== X-Google-Smtp-Source: APXvYqzPXthKE7p21sHhQIvApgZp51uV6IMOyRbArPaRyRc7TpMrbtc1pY7xHeWxbmLIBM7YGhqdkQ== X-Received: by 2002:adf:b741:: with SMTP id n1mr1861847wre.287.1551265706023; Wed, 27 Feb 2019 03:08:26 -0800 (PST) Received: from localhost.localdomain ([5.148.119.11]) by smtp.gmail.com with ESMTPSA id a20sm996194wmb.17.2019.02.27.03.08.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Feb 2019 03:08:25 -0800 (PST) From: Louis Taylor To: jikos@kernel.org Cc: benjamin.tissoires@redhat.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, ndesaulniers@google.com, Louis Taylor Subject: [PATCH v2] HID: quirks: use correct format chars in dbg_hid Date: Wed, 27 Feb 2019 11:07:20 +0000 Message-Id: <20190227110720.27329-1-louis@kragniz.eu> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190226234853.20441-1-louis@kragniz.eu> References: <20190226234853.20441-1-louis@kragniz.eu> MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When building with -Wformat, clang warns: drivers/hid/hid-quirks.c:1075:27: warning: format specifies type 'unsigned short' but the argument has type '__u32' (aka 'unsigned int') [-Wformat] bl_entry->driver_data, bl_entry->vendor, ^~~~~~~~~~~~~~~~ ./include/linux/hid.h:1170:48: note: expanded from macro 'dbg_hid' printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \ ~~~~~~ ^~~ drivers/hid/hid-quirks.c:1076:4: warning: format specifies type 'unsigned short' but the argument has type '__u32' (aka 'unsigned int') [-Wformat] bl_entry->product); ^~~~~~~~~~~~~~~~~ ./include/linux/hid.h:1170:48: note: expanded from macro 'dbg_hid' printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \ ~~~~~~ ^~~ drivers/hid/hid-quirks.c:1242:12: warning: format specifies type 'unsigned short' but the argument has type '__u32' (aka 'unsigned int') [-Wformat] quirks, hdev->vendor, hdev->product); ^~~~~~~~~~~~ ./include/linux/hid.h:1170:48: note: expanded from macro 'dbg_hid' printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \ ~~~~~~ ^~~ drivers/hid/hid-quirks.c:1242:26: warning: format specifies type 'unsigned short' but the argument has type '__u32' (aka 'unsigned int') [-Wformat] quirks, hdev->vendor, hdev->product); ^~~~~~~~~~~~~ ./include/linux/hid.h:1170:48: note: expanded from macro 'dbg_hid' printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \ ~~~~~~ ^~~ 4 warnings generated. This patch fixes the format strings to use the correct format type for unsigned ints. Link: https://github.com/ClangBuiltLinux/linux/issues/378 Signed-off-by: Louis Taylor Reviewed-by: Nick Desaulniers --- v2: change format string to use %04x instead of %x drivers/hid/hid-quirks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c index 94088c0ed68a..b608a57b7908 100644 --- a/drivers/hid/hid-quirks.c +++ b/drivers/hid/hid-quirks.c @@ -1071,7 +1071,7 @@ static struct hid_device_id *hid_exists_dquirk(const struct hid_device *hdev) } if (bl_entry != NULL) - dbg_hid("Found dynamic quirk 0x%lx for HID device 0x%hx:0x%hx\n", + dbg_hid("Found dynamic quirk 0x%lx for HID device 0x%04x:0x%04x\n", bl_entry->driver_data, bl_entry->vendor, bl_entry->product); @@ -1238,7 +1238,7 @@ static unsigned long hid_gets_squirk(const struct hid_device *hdev) quirks |= bl_entry->driver_data; if (quirks) - dbg_hid("Found squirk 0x%lx for HID device 0x%hx:0x%hx\n", + dbg_hid("Found squirk 0x%lx for HID device 0x%04x:0x%04x\n", quirks, hdev->vendor, hdev->product); return quirks; }