Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3938339imb; Wed, 6 Mar 2019 01:01:44 -0800 (PST) X-Google-Smtp-Source: APXvYqwA4NSjavf9vSeSwoklUW2s2NHVTnMhAgKJ/S8dr4mNi3Pslio3b+rR12LkikyL5RViZN7R X-Received: by 2002:a17:902:4503:: with SMTP id m3mr5822470pld.35.1551862904830; Wed, 06 Mar 2019 01:01:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551862904; cv=none; d=google.com; s=arc-20160816; b=iAW1lHgHqYkrauVjlqRn4rcQnZF/QGHJVlF4sVAoeGRqWgYedSRZITXbnuF/qi1TeD NqA0uQQ+2z3WTE2wPbQFXPaoqkkaReme23/q9SW6VgMDl0ZEoo7ZFon4LwQ6bgRMte+W 53+65BkJM5GZdRJNOzg6vJFsFG7DNV5pPIuI8kwsM13+LN02uDULjbyiqG45yR5l7/mO sTA0wVnLAkllP6bYJHLEOAEK0nzt+TB3feVuXWByi8IiYNq1/10zdoEq3A4vDF4wizH7 hWy6sihNPw1hnzrXIx2EChzKx347Bx6GZBgs0/cExdT+/SCs46UjLWvB1yht7RX0SgS3 AQyQ== 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=HxAeqLr7WkLHY6SXrbdc4IFPph0TstgnrH92LlsSejg=; b=GIjHBixzPnAuGjI13hrFh1ATM8ZOueiXJ79sdAKUK5tmyJuEx6nGDC/ZZkGkHAxExF C+0jlp8BewvJ35S87O/qImk7DbaByXbMaicEz+AmAHhkYmaNZjq3kYFDhq6qv/OSQupl 45150rXUyWdSbAIlccwhbJeF7JiUII4epQDGKVp83RcocMNGQQv5Liz+wNHpQzJqXGp+ 1ocncuHKbsbXCoXmJUOjBuilCuQ/N8fUWgulCZQohmwH935+VFiv8eNOscQqY/Q2OYZ/ nbLUo3kilvBxZ9wCe/t+riwussG2cpBZ5uZB9k6dDEi+DUm4TWsX2lqWitDCfYR+0+Ph J7hQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m32si936616pgl.453.2019.03.06.01.01.29; Wed, 06 Mar 2019 01:01:44 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729340AbfCFI6d (ORCPT + 99 others); Wed, 6 Mar 2019 03:58:33 -0500 Received: from mx2.suse.de ([195.135.220.15]:41170 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728907AbfCFI6c (ORCPT ); Wed, 6 Mar 2019 03:58:32 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4C36AB135; Wed, 6 Mar 2019 08:58:31 +0000 (UTC) Date: Wed, 6 Mar 2019 09:58:29 +0100 From: Jean Delvare To: Louis Taylor Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, ndesaulniers@google.com, jflat@chromium.org Subject: Re: [PATCH] i2c: sis630: correct format strings Message-ID: <20190306095829.5ba295c4@endymion> In-Reply-To: <20190302141836.24638-1-louis@kragniz.eu> References: <20190302141836.24638-1-louis@kragniz.eu> Organization: SUSE Linux X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.31; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Louis, On Sat, 2 Mar 2019 14:18:36 +0000, Louis Taylor wrote: > When compiling with -Wformat, clang warns: > > drivers/i2c/busses/i2c-sis630.c:482:4: warning: format specifies type > 'unsigned short' but the argument has type 'int' [-Wformat] > smbus_base + SMB_STS, > ^~~~~~~~~~~~~~~~~~~~ > > drivers/i2c/busses/i2c-sis630.c:483:4: warning: format specifies type > 'unsigned short' but the argument has type 'int' [-Wformat] > smbus_base + SMB_STS + SIS630_SMB_IOREGION - 1); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > drivers/i2c/busses/i2c-sis630.c:531:37: warning: format specifies type > 'unsigned short' but the argument has type 'int' [-Wformat] > "SMBus SIS630 adapter at %04hx", smbus_base + SMB_STS); > ~~~~~ ^~~~~~~~~~~~~~~~~~~~ > > This patch fixes the format strings to use the format type for int. > > Link: https://github.com/ClangBuiltLinux/linux/issues/378 > Signed-off-by: Louis Taylor > --- > drivers/i2c/busses/i2c-sis630.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-sis630.c b/drivers/i2c/busses/i2c-sis630.c > index 1e6805b5cef2..a57aa4fe51a4 100644 > --- a/drivers/i2c/busses/i2c-sis630.c > +++ b/drivers/i2c/busses/i2c-sis630.c > @@ -478,7 +478,7 @@ static int sis630_setup(struct pci_dev *sis630_dev) > if (!request_region(smbus_base + SMB_STS, SIS630_SMB_IOREGION, > sis630_driver.name)) { > dev_err(&sis630_dev->dev, > - "I/O Region 0x%04hx-0x%04hx for SMBus already in use.\n", > + "I/O Region 0x%04x-0x%04x for SMBus already in use.\n", > smbus_base + SMB_STS, > smbus_base + SMB_STS + SIS630_SMB_IOREGION - 1); > retval = -EBUSY; > @@ -528,7 +528,7 @@ static int sis630_probe(struct pci_dev *dev, const struct pci_device_id *id) > sis630_adapter.dev.parent = &dev->dev; > > snprintf(sis630_adapter.name, sizeof(sis630_adapter.name), > - "SMBus SIS630 adapter at %04hx", smbus_base + SMB_STS); > + "SMBus SIS630 adapter at %04x", smbus_base + SMB_STS); > > return i2c_add_adapter(&sis630_adapter); > } Signed-off-by: Jean Delvare Would be nice if gcc itself would reports such formatting issues... Thanks, -- Jean Delvare SUSE L3 Support