Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1171516imc; Mon, 11 Mar 2019 07:58:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqy0/BPFTC41XVyOJdv17s6Rcp7UHrDgMAAxx1bbgRceMrM/oZ7m8p3h3pVusaK7V4K8no4X X-Received: by 2002:a63:35ce:: with SMTP id c197mr30204152pga.281.1552316320155; Mon, 11 Mar 2019 07:58:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552316320; cv=none; d=google.com; s=arc-20160816; b=ut/+gUxLgg4rs90r3Sii4lC8WTZKlh98UC0NgEJd8Wh7nCFcCz8hs5yW+YfIJ6kQHA hhK0dN9G6WYRsGtovHpMI7/YBH/akPtuLSpuy7E9/sC/MOGjQlIcetepqnaMIo40x7oy oitHdyOIEx4g7Q49VNHTpaBZaNQZXy6RIyvdLe2Gd+8Ie6tj+i6D6pompatrCCXhipor xb+1uXdvBkPSRqiweDQLjTehWrWcCV5ToS5vLNAxMBcZzWHRFg6Zd4zS1gf3G/9t0zN+ 0dH/LMcZz4D2yfeolgn9LdiDIhvyPNv1TEnXH9rdEEH6MhWYL+SY1yFbs+Ycj9VZYr8d jzjA== 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; bh=A6WUodKr6yAywA/HHVdmRHarMgILwJ8qtk0xnCBTaQc=; b=MRw9oAye1P9owoI3KQGeQzCeEm9+UW26eJVO00rMfv9P0DuCZHt9J1NmCfA4qpUFnw Rspgh/UCd51ZSmZmFG4c7qSph+PPWw7ean/kKmWENVe7DjOntkcmZTDcCceGp6rj2rgr l9aCPWvr0o3eMr++t0oYzyz5hYFieD/Kuop5Kd4/KBgg9izyQogC/7eD1xP22xK6ICR3 A07mIChnjPxwMeePwvJOZoSIsS62gVq1BoOucvQpOiMWC5u1y3M4aTGRjkbwOXDh7Q7I 8hHrztQSjSXt1Xn3pt5xuuCfs4Kxji6MnbY5FWqKkjega/SCqNNQx1oHoGWBwltG1MZT R7ig== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d11si5401269pls.255.2019.03.11.07.58.24; Mon, 11 Mar 2019 07:58:40 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727834AbfCKO4Z (ORCPT + 99 others); Mon, 11 Mar 2019 10:56:25 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:38984 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727433AbfCKO4Z (ORCPT ); Mon, 11 Mar 2019 10:56:25 -0400 Received: by mail-qt1-f196.google.com with SMTP id t28so1697005qte.6 for ; Mon, 11 Mar 2019 07:56:24 -0700 (PDT) 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=A6WUodKr6yAywA/HHVdmRHarMgILwJ8qtk0xnCBTaQc=; b=WbreCW/DdPQbuzxd+j4IgpPk4B2RPSnohpG6ceTUV3Rw6lnk/gBFfPmuNzE85b4KKc 73pmF32l1hF+jlkbRODLGAau06q3j2x/IJHCq6+ss2LzMKTowcno7F1NgglEq3CI+mYT tAtYTx8DbCGW5IRY1nLQA7ncP9HD3HIEATdew1K/7wrfgZ9jc7JaU/8WYKxVtdqCv2CM pU1G+dys5H3wcWHUZZKjYI5ARSpgq6zOkEd7QY+3RQpvHGW7mot0nvUBXeBWk2pUuQAO KxF/tiqU3+JpCvgfB33qYCTa6WF2LeEan/nhFiRIRubmOCQHgf4V75VhWQtGEhfhFBEF qcUA== X-Gm-Message-State: APjAAAUlr2LykcPxpwB5Kb0d2r4ciEjJBB97OwZzbZwcTi3vXuc8eQI7 lUAl+T5baM8rb+ZEabr+7oeIhHFkk0zACOTs/8EK3Q== X-Received: by 2002:ac8:2527:: with SMTP id 36mr11186029qtm.308.1552316184343; Mon, 11 Mar 2019 07:56:24 -0700 (PDT) MIME-Version: 1.0 References: <20190226234853.20441-1-louis@kragniz.eu> <20190227110720.27329-1-louis@kragniz.eu> In-Reply-To: From: Benjamin Tissoires Date: Mon, 11 Mar 2019 15:56:13 +0100 Message-ID: Subject: Re: [PATCH v2] HID: quirks: use correct format chars in dbg_hid To: Nick Desaulniers Cc: Louis Taylor , Jiri Kosina , "open list:HID CORE LAYER" , LKML , clang-built-linux@googlegroups.com 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 Wed, Feb 27, 2019 at 8:43 PM Nick Desaulniers wrote: > > On Wed, Feb 27, 2019 at 3:08 AM 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 > > Thanks for following up on the feedback. > Reviewed-by: Nick Desaulniers Applied to for-5.1/upstream-fixes Cheers, Benjamin > > > --- > > > > 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; > > } > > -- > > 2.20.1 > > > > > -- > Thanks, > ~Nick Desaulniers