Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp2176280img; Wed, 27 Feb 2019 11:43:47 -0800 (PST) X-Google-Smtp-Source: AHgI3IZN3pEADabnj9lYdUxK+mrHssDFMAdKq4wYu8iSqEWskkI3dhYRsUprkT+VUtKgXWecFRHh X-Received: by 2002:a63:6a08:: with SMTP id f8mr4616916pgc.165.1551296627288; Wed, 27 Feb 2019 11:43:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551296627; cv=none; d=google.com; s=arc-20160816; b=K7hV5AGZdnRCcTn2mBVxYyBMCFibPcKpgXl9chTbOcVoUTWKNrMyi37C48U6633dWx 6MBCAsDvSYdhxxzDnZlajg9KPGZ/X86UZDWKe41JmlUEWMumWR+XaZ0GMZ+w2wnfOL2/ QqBzBy3MmrWAWyx/hjWaH5TCGaN+OROxwpAp7m3feABYiI4O8mQSKZ4ZuP89ZQFfTWkH Uc7N3Kkoj+TcM4gCwqaG/hyJX0pp0/PDcCwyIPo11DlxrVQWZQ3JX/Yae0XWM2l/NOiv x3EMXkKzEZKCpp1ET4E6VWnUVRVU4XJLuAtd6/wWjTc5bKas/fhe1OmOXbdQe+Q4UOIl fMkQ== 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=v10SQsz27WAbdJEQoAu+f4GrXevfP2+IfguzPFDhyIU=; b=a8t4eTikI4eyuy56qjVwjgC2TYvDcl/356OWhinOC+U5vKuztfFK47amITsKW729dJ krA5KSYi0357t3aJM3AWXJ4eJSKmurmi62LHt7S4+jGND9DuD7kByZ9E75K8dKp+dxtX Ly/dFTiuWL9LDCaHGSreVS4DiqJE8J4mDDm9+EdxVj45xvosNSsDfT3EZXNAlfEtnNLo le+TQoKAyjeN6SQ7r/m+a51SJcNHqCESRrs/nFaV3HVwdF7yt82YGmf74aUdW2aB+SkL RePRs557PKpo0eH0DeQwCGuZ0gTePTkKpEJQswJl+UwM+akBK+nYs/Xb7jg/AFEXjslE KIoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=J1KVSqt9; 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 s14si15727451plq.284.2019.02.27.11.43.31; Wed, 27 Feb 2019 11:43:47 -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=J1KVSqt9; 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 S1730250AbfB0TnF (ORCPT + 99 others); Wed, 27 Feb 2019 14:43:05 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:43092 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727240AbfB0TnF (ORCPT ); Wed, 27 Feb 2019 14:43:05 -0500 Received: by mail-pf1-f194.google.com with SMTP id q17so8482836pfh.10 for ; Wed, 27 Feb 2019 11:43:04 -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=v10SQsz27WAbdJEQoAu+f4GrXevfP2+IfguzPFDhyIU=; b=J1KVSqt95IFYzYcLA8IcGi3bsqlNFPPR9ePjBYKC0kcgBnQHxJb9vHkoks0Aqq/rRV 0axvYaPbPmVc62NkMKIpVm//mUZZfGU3qFQgSKjAQZth06QU5+53dShjVV4Q3WLZZbNK d1wiG84iSQYeSYve3+C7TaXmf+zBeFkPSSfyWtyWEmm+cxQwIMCJbC15eOJ5pooQP6tw STi3XQplrX6QRG2ihHnsezCBhtrFNC+QfQrz20ea1bLEGr4bvqhz6/BaGIqfD+dW5XOi 45DoKyMD7ImUfS4OYSluQizdrIujWfwP313EGK3cHM88yI4kQqkYMk0btKdLUDFVDd8B yqfQ== 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=v10SQsz27WAbdJEQoAu+f4GrXevfP2+IfguzPFDhyIU=; b=a9duFA/ZIS79Zvq7bedJCDVAh+75+KNuQEwvm4MHHJeRWL+EGd1T2WTyTaRXyv44T6 rHaa2B4itsHPcDZwWOsosS0ZUyHaza+mGmEvtuz8WNwgUIa5jAZ66DU9jHgiA4EZVj09 rgfERomDzUrQO21RnU6b4tTV3X8pg02l6V8eGIIwcjaLiRSOrDORUb/ZTBLGio612n39 4YgG3bFqDTG1pHOXa6NfQnoC7yZVmE5UfKemGYCqmoCBKo8qKyzLDJGw3HUerV5I+PEQ Np5qX18h//ltdHrrCSbAeBhFqZN27snoBiKxXl1wxjpJmXxSc+Os+V63EAsxwh4GIVMC ljcg== X-Gm-Message-State: AHQUAubMuBUiycNitgspqe5O93ZmBh2j3+5wkfsuDEtmKr5NqkyjD822 4K0KunaivloecebdKG52mOFweQCPZNTFPMdtSbhPTQ== X-Received: by 2002:a63:fe58:: with SMTP id x24mr4553167pgj.255.1551296584092; Wed, 27 Feb 2019 11:43:04 -0800 (PST) MIME-Version: 1.0 References: <20190226234853.20441-1-louis@kragniz.eu> <20190227110720.27329-1-louis@kragniz.eu> In-Reply-To: <20190227110720.27329-1-louis@kragniz.eu> From: Nick Desaulniers Date: Wed, 27 Feb 2019 11:42:53 -0800 Message-ID: Subject: Re: [PATCH v2] 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 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 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 > --- > > 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