Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp447999yba; Wed, 3 Apr 2019 11:53:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNznsUF/vvwxS4tOS1mBvLkG85bMuhzp5n+hxHuAMTCPVCpsWUjLcQF1HPoDeZmfA17bnc X-Received: by 2002:a63:7843:: with SMTP id t64mr1244196pgc.178.1554317601262; Wed, 03 Apr 2019 11:53:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554317601; cv=none; d=google.com; s=arc-20160816; b=RH6abdLQTtNDHnyo6jKuRBh56vJ1DhFTMwg5DoLDkv2l3i83WU/X6fG9+4fLx1qiVr 0BsWaQB9/kQx6KVyADOsptU4ntccWitjFSJpc0Xdje/pJUT6TMunj7e+vXQDv5vkS5RR d7t5yaQEufH9IFhSbRddYucGwUBmMi1v5WnKhKKtjTWP32fq5sM78quOBxivv1+uj1SE I/XI6C/cwV454PMZc+r9L0b7LpiAZE74Fwcn9zMnJJWkrIHXhyxkcwBs675ffYMQeOkY uL7ZkWIAuOIQIe5rnACECp9KDojNPfL5ryLCJCPaeFQKcml+jdjl0/K7CTUjbwJyDcMd 7KeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=kQDTtckqNYi5lUz5o20NzZlCCkLQWS3gZ7P57EnnZ5k=; b=TJRA8UiSVk67GLZJdo00ZJPp2iqMGb/Yi6hvGObByck8nQig+GmL2OL3wwOpUT7U49 L4kZUjUzkY0NN2dpZsJ6kakz7knmFUmBBrf6nntDeQSTlQO/Zp0qAUkCnRbUPBpM2Whd el1jnRY65fQdfIDq8mo2vreWrcrv5dG5l4W2ewsU7u1O1O5GeqA3vtYUlDTmvIQKLUKj b6K8XQcqVvQhRsQ52hXhH9NKk5R2E0ShaVelTfUwo4HsCBE8k5Mz8pe/0RTzC7CttisY Arivo+pU5o1XM+Xnf2d40EMOt7StAmLCrgT05BYoSfZiPD15zMUw4S/9ALvrpFADfP1M xm3Q== 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 y3si5472666plt.57.2019.04.03.11.53.06; Wed, 03 Apr 2019 11:53:21 -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 S1726841AbfDCSwY (ORCPT + 99 others); Wed, 3 Apr 2019 14:52:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50370 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726064AbfDCSwX (ORCPT ); Wed, 3 Apr 2019 14:52:23 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E1A40C075D8B; Wed, 3 Apr 2019 18:52:21 +0000 (UTC) Received: from x1.home (ovpn-116-99.phx2.redhat.com [10.3.116.99]) by smtp.corp.redhat.com (Postfix) with ESMTP id 227F64F067; Wed, 3 Apr 2019 18:52:21 +0000 (UTC) Date: Wed, 3 Apr 2019 12:52:20 -0600 From: Alex Williamson To: Louis Taylor Cc: aik@ozlabs.ru, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, ndesaulniers@google.com, jflat@chromium.org Subject: Re: [PATCH] vfio/pci: use correct format characters Message-ID: <20190403125220.4d6353ff@x1.home> In-Reply-To: <20190228194812.30929-1-louis@kragniz.eu> References: <20190228194812.30929-1-louis@kragniz.eu> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 03 Apr 2019 18:52:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 28 Feb 2019 19:48:12 +0000 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 > --- Applied to vfio for-linus branch for v5.1 with Nick's R-b. Thanks! Alex > 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); > }