Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp6750img; Thu, 28 Feb 2019 13:59:37 -0800 (PST) X-Google-Smtp-Source: APXvYqyRayc77EukK8IccZKl0rTZfe9K46CDan2+VcLJKPO41FA7NPSdJrzouLuNceH802xLmg+u X-Received: by 2002:a63:8441:: with SMTP id k62mr1278751pgd.219.1551391177223; Thu, 28 Feb 2019 13:59:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551391177; cv=none; d=google.com; s=arc-20160816; b=gq8aOZd4N1vMU745QIZPmxQ2n6W91Krq4p5dvyxW0tv37iPHlAxoeGo0GYs9CHeVpS 1a7b/rG9PVyy6ExAnx3he3mIo7XfT0Vn6eAcWoeREIW+9pN7ja34hdj7Pa0p7V+ch3zh fY5ZyNzqsNLfv/JKdFcBI5RQ3U2xYuioi2g3Efuch9HXxWzcQ+Wj+gIVtleKmuscee5y CvtrxgmKXFnjy5ZoOgcT3IITTuff9acK+j7owBPZ0MFpHWS/8/EsNFdirgQ7PCcFZ7Us EOt/UYM+cRj4Y0oM4PWe9SyH7VNr7M5zqh87MAM4Xa82vjetqF539/caGmemFLY9xXRJ c9Pw== 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=Va/KJiFXOJNHNDj0/LvVsbvJb9pknbq+C46fNM5B750=; b=OdikJWefc5MPOPmcRX8YmAVqw1Bl3LidUCp/ctD+4vzOKbNSEZIsudf74Kee0eu4QL LRqjVK6hM2UJ38I9qLBgU+alNLvCc008hFnrkinE0SaFe33puh2G0ZU1M/pmG1gWs0bb 6NxlHTqweZUelWxwUyE7dxu2Va8enEX65pErPWWWhzp6A/FciWtyXWC3625BUsCDYj9F bNm75hXH2vzLnco9Y41T81ZFCNZKbUxWmGVz78CdIOnkbE6X3GYJUU6CQPkPJap32wRZ UaFueEgafIijcExICEx3UYF7XKRQY3TpQoqTfkk5qw2i16YDRIZPCPthEbZZ0heBA7WV bG8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=BPvRePWW; 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 l2si18945460pfc.287.2019.02.28.13.59.21; Thu, 28 Feb 2019 13:59:37 -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=BPvRePWW; 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 S2388254AbfB1Upk (ORCPT + 99 others); Thu, 28 Feb 2019 15:45:40 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:46015 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733277AbfB1Upk (ORCPT ); Thu, 28 Feb 2019 15:45:40 -0500 Received: by mail-pg1-f193.google.com with SMTP id y4so10254105pgc.12 for ; Thu, 28 Feb 2019 12:45:39 -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=Va/KJiFXOJNHNDj0/LvVsbvJb9pknbq+C46fNM5B750=; b=BPvRePWWtXehTGfNyYbvICjN6j8Vksw+6xzRlc4JEAW5xoPhxfyi2S9C5k/bX96EFa bYRFsJexQAVVoI019lSGyeTDvfHCdsy1f+vy16dImgAFd5PnyayipEuRyDrfAgPlIkFZ tHFEx7x4Oh+/WR+rtqPckLgfrw+WL5XYUpJKkC9jbTZAxHmwPgEZiiEGIohk+iRwDIU9 gA+rfrqcs3z5JP65ohfS4mOysnnxBZSqKwuzVQUT5oiU1Mobpq+LE0Yvb3OwN3+Cdef/ a8XLytIIytyinoO7PYN8m9rH5aMMIsYm9PR39MMXyqb3/bZWDggeFsgJ+ec/Ksbdu29k 2/zA== 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=Va/KJiFXOJNHNDj0/LvVsbvJb9pknbq+C46fNM5B750=; b=OVEA2tSk4EoEFPTJ+lLVPBuzM9FyjtsNDdYFha90sgDXge0aiE7dg4oRORY5Y/OrUU Pza7BXxZfi5H5qRwtBDd7EjjPFJMnYXREJsCC64VcXFUwNXSsj6g8GQCuzGMJZbe5+bE lGuORqwSP7H/5rs2LRsCVGHiMizUes25Z7wt8G+ZmXYZLNVII/h7eHY8ThMiB7JPJ0zA MkBDdeaeufZ7P92Ng7wRsyoF0RpbAIEuXmizszN0DvjETvuswLyRiOcj96YvC2ANGgpz ubbXQ3VWtdljm4X2WkRTlAaPKdEMZx1VacZmdPE2WpFvr5vbd1+A34Zc9Rnf6PvHUUOr NX1A== X-Gm-Message-State: APjAAAXReQua7LKOuyIwru3Ae4ywDgJZLiOLAUn28j+9vV1xGSkXEQ77 UJX9IjXUnVEta2kgI+Hhk1B9sQsxj7NdMP1Zj5Tr6w== X-Received: by 2002:a63:5506:: with SMTP id j6mr1094703pgb.202.1551386738966; Thu, 28 Feb 2019 12:45:38 -0800 (PST) MIME-Version: 1.0 References: <20190228194812.30929-1-louis@kragniz.eu> In-Reply-To: <20190228194812.30929-1-louis@kragniz.eu> From: Nick Desaulniers Date: Thu, 28 Feb 2019 12:45:27 -0800 Message-ID: Subject: Re: [PATCH] vfio/pci: use correct format characters To: Louis Taylor Cc: alex.williamson@redhat.com, aik@ozlabs.ru, kvm@vger.kernel.org, LKML , clang-built-linux@googlegroups.com, Jon Flatley 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 Thu, Feb 28, 2019 at 11:49 AM Louis Taylor wrote: > > When compiling with -Wformat, clang emits the following warnings: > > drivers/vfio/pci/vfio_pci.c:1601:5: warning: format specifies type > 'unsigned short' but the argument has type 'unsigned int' [-Wformat] > vendor, device, subvendor, subdevice, > ^~~~~~ > > drivers/vfio/pci/vfio_pci.c:1601:13: warning: format specifies type > 'unsigned short' but the argument has type 'unsigned int' [-Wformat] > vendor, device, subvendor, subdevice, > ^~~~~~ > > drivers/vfio/pci/vfio_pci.c:1601:21: warning: format specifies type > 'unsigned short' but the argument has type 'unsigned int' [-Wformat] > vendor, device, subvendor, subdevice, > ^~~~~~~~~ > > drivers/vfio/pci/vfio_pci.c:1601:32: warning: format specifies type > 'unsigned short' but the argument has type 'unsigned int' [-Wformat] > vendor, device, subvendor, subdevice, > ^~~~~~~~~ > > drivers/vfio/pci/vfio_pci.c:1605:5: warning: format specifies type > 'unsigned short' but the argument has type 'unsigned int' [-Wformat] > vendor, device, subvendor, subdevice, > ^~~~~~ > > drivers/vfio/pci/vfio_pci.c:1605:13: warning: format specifies type > 'unsigned short' but the argument has type 'unsigned int' [-Wformat] > vendor, device, subvendor, subdevice, > ^~~~~~ > > drivers/vfio/pci/vfio_pci.c:1605:21: warning: format specifies type > 'unsigned short' but the argument has type 'unsigned int' [-Wformat] > vendor, device, subvendor, subdevice, > ^~~~~~~~~ > > drivers/vfio/pci/vfio_pci.c:1605:32: warning: format specifies type > 'unsigned short' but the argument has type 'unsigned int' [-Wformat] > vendor, device, subvendor, subdevice, > ^~~~~~~~~ > The types of these arguments are unconditionally defined, so this patch > updates the format character to the correct ones for unsigned ints. > > Link: https://github.com/ClangBuiltLinux/linux/issues/378 > Signed-off-by: Louis Taylor Thanks for the patch! LGTM Reviewed-by: Nick Desaulniers > --- > drivers/vfio/pci/vfio_pci.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c > index a25659b5a5d1..3fa20e95a6bb 100644 > --- a/drivers/vfio/pci/vfio_pci.c > +++ b/drivers/vfio/pci/vfio_pci.c > @@ -1661,11 +1661,11 @@ static void __init vfio_pci_fill_ids(void) > rc = pci_add_dynid(&vfio_pci_driver, vendor, device, > subvendor, subdevice, class, class_mask, 0); > if (rc) > - pr_warn("failed to add dynamic id [%04hx:%04hx[%04hx:%04hx]] class %#08x/%08x (%d)\n", > + pr_warn("failed to add dynamic id [%04x:%04x[%04x:%04x]] class %#08x/%08x (%d)\n", > vendor, device, subvendor, subdevice, > class, class_mask, rc); > else > - pr_info("add [%04hx:%04hx[%04hx:%04hx]] class %#08x/%08x\n", > + pr_info("add [%04x:%04x[%04x:%04x]] class %#08x/%08x\n", > vendor, device, subvendor, subdevice, > class, class_mask); > } > -- > 2.20.1 > -- Thanks, ~Nick Desaulniers