Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1200977img; Tue, 26 Feb 2019 16:29:13 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia7pR2/F1aaSailAFlGP+jocySFLqzr0Ff4W3uPf+gISOsKRjbNt1/EwUjdETRHY3TnBOp7 X-Received: by 2002:a17:902:728d:: with SMTP id d13mr15521675pll.12.1551227353312; Tue, 26 Feb 2019 16:29:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551227353; cv=none; d=google.com; s=arc-20160816; b=kpysbuFabARN6v4A8dpzXBz2qlIRosQvAmsb9kDzpeqgBacZW024RMvzfVTwb+VPTR MNdjQLkZKkkAkwGp17QDfIRbZigyqILmR5K7Yud00FqrRT7NAHh7Sxq+HM0NFai/dV0m B5sNsLMrtIXXGdPTCTQqaqNOfJiWa244CmW3NjKcmz+7r5Oef7uo/c3BbuB7g02Z4plZ e1F0jNf6slLkDLbQUWTDqFBtx0OSYDpSPysssAlzAtjb3VFJHNj7S/KVMK4xh5oK6Fj/ qKGqh2mLz1azmkdC1opLuwJnr2JXH3dspOif8jZhxYw/LxdIHX++rwwmm+yZPvXNpRd9 wXDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=V2V/dVF5Q1F7LotNMdhXS8ldQBuS0ozbkd1QvSSkDk0=; b=wf4pmbNHHvnFJH1kTpuqaYme5sbpKXKROnYb1W+EaXqYJb70CuwYvMabLRe/2J5ke/ +4icLhq+ZKO2DtHUrWPgtlGKLpl4eG2i2+3F3FgmUDy1wBFm3Xyg+SAul9tVjmyTfoiu MHFYLRSponbeHsQ46hWlRLyRgRS8LvvrcOkWGF1yIAqKmKg2M7wPrHM1hbtIHgpZbhy9 Hstwm+WjsOcDRDocb4DKwNB3+pqzXtlLTek9yLsGMOFcXOUjEcAwbE/8+dDoubVflAy9 NYQxG0TAEgi10Oc1kNTDWpR6xmgwJEFv3qX3MXfKoyFGcCsUe6+QnmqatyMq2ZRxjvL+ 3F0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=IKoWC0uC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si13444806plk.260.2019.02.26.16.28.58; Tue, 26 Feb 2019 16:29:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=IKoWC0uC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729508AbfB0A1s (ORCPT + 99 others); Tue, 26 Feb 2019 19:27:48 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:40042 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727998AbfB0A1s (ORCPT ); Tue, 26 Feb 2019 19:27:48 -0500 Received: by mail-pf1-f194.google.com with SMTP id h1so7065419pfo.7 for ; Tue, 26 Feb 2019 16:27:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=V2V/dVF5Q1F7LotNMdhXS8ldQBuS0ozbkd1QvSSkDk0=; b=IKoWC0uC+FKVgxSuVLb4AcNLF2Aiw7puELUPt5uaBCFbdhcNqBJL+Zqf/MATb9k1TZ I0mb1QCaM5jKVGjHQN9SzTL/38xuGVWOJ6hgqRymqY4eqOCHm4oOQIp4XMjdMJd+CZlh XO0ycCYsf6K0zK7z49lR3Ma5IUj8KbeW9eZ06MUJKc1AHE8197FnEGdHpFCahdPbvVye 8iG4QZJ6FiBBxZhXWglWX0pJyvt6oNMvmmQtBTDos3XrPt9Z4qcAc6sMEprUn3kjqPFJ 4+aGTd6OqmeNePwCNP+CXCOCYR5/M/VWaRie+BzsgU3o3gFaAHvFUANf8+zGUNSwVsg+ TENA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=V2V/dVF5Q1F7LotNMdhXS8ldQBuS0ozbkd1QvSSkDk0=; b=rzflSioDJ/kNlXqYA7g2Cy8h/HqkdZ5JUsBWSgGu84GgCEuTz2GPJKJasi8GaNP2VJ tSyzSL6w3DPA4X3WTIGLKVQNcfTWn/u5CFvi87Lls/VY1U+xg0bQapkw9SBRidF0+Uk+ THnXMQ2KVwBBtLI2gLUTPNF4wAtfyc4X2GYQOH3S4ZSmSs+Yf3AQLs1scx3syLnvq8oa JXOYwsqh/QOjqVZzPjzUzKMJiCOer65g7qJddfVnMsLVXzKdSN4YIEbBjt9PwXCqpx4k Bem9Fl2REbbE5/tFYbA001yfbKkBHTl8yx9BYgS2vPlpCN//eltaeg3RsGdOU0/cd8il aM/g== X-Gm-Message-State: AHQUAub9CioDP6TPAOe9DjG4CuFb3XBqLJRkv3fqPVh83a88mFd6YEmY 7azsjpahRwoP+b5JxNNnJnxAAqu4Ulfr76IngFqZpg== X-Received: by 2002:a63:c70c:: with SMTP id n12mr170294pgg.302.1551227266824; Tue, 26 Feb 2019 16:27:46 -0800 (PST) MIME-Version: 1.0 References: <20190226234853.20441-1-louis@kragniz.eu> In-Reply-To: <20190226234853.20441-1-louis@kragniz.eu> From: Nick Desaulniers Date: Tue, 26 Feb 2019 16:27:35 -0800 Message-ID: Subject: Re: [PATCH] HID: quirks: use correct format chars in dbg_hid To: Louis Taylor Cc: Jiri Kosina , benjamin.tissoires@redhat.com, linux-input@vger.kernel.org, LKML , clang-built-linux@googlegroups.com, Jon Flatley , =?UTF-8?Q?Matthias_M=C3=A4nnich?= Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 26, 2019 at 3:50 PM Louis Taylor wrote: > > 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 > --- > 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..b4e49e1b6f4a 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%x:0x%x\n", %h is for short ints, include/linux/mod_devicetable.h declares struct hid_device_id (bl_entry is an instance of struct hid_device_id) unconditionally as: 147 struct hid_device_id { ... 150 __u32 vendor; 151 __u32 product; ... 153 }; yep; LGTM Reviewed-by: Nick Desaulniers Thank you for the patch! There's 3 more of these in drivers/hid/i2c-hid/i2c-hid-core.c if your looking to clean up some more! > 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%x:0x%x\n", > quirks, hdev->vendor, hdev->product); > return quirks; > } > -- > 2.20.1 > -- Thanks, ~Nick Desaulniers