Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1762134pxj; Sun, 16 May 2021 03:28:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXhL4KpUGwcAhbep3VSDjao4nZqz8ybBZf/E3dtUgolnNcp/IC5pq9FKn1876PD2pv4o4q X-Received: by 2002:a17:906:84d:: with SMTP id f13mr13831651ejd.451.1621160896021; Sun, 16 May 2021 03:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621160896; cv=none; d=google.com; s=arc-20160816; b=PjeFvNlRcdbIxiFbJfaj2ucF7HkVVyan/vXLjkvQOzc0kHcTfxm2UKbPRHQ6wMMnYc xjgQ8uKS6W5EJEZNoTItRLkxUdZGMef9roekAuZ9jCJxuHww3zhUhDGGz3crb5BlM35L uPbhcqSPNHtigcQ+LXEnsLZ7TA/Sw4eSO6NxjoHuQli5yK63lAo8sV3C0+8GogS9X3NH TVMomwR9Ttxs7ykDhd/EPCmLnMKwuOCotgWpJDuLak68sA3jXPQYhZlkBb7eyaN7N62x 1k1V8M9OHERzmqdHJT+Ir7EKCMS1M2cnas2VmYTgWGwd33IBJteN55EqiiMCZfYI0rkl QREg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=P4+w+TWVZpKJQLBBln1TgkGlFGMqFwPrZJn6lrVvoDk=; b=LRnAkQQbFe9eqZDq2zhvIpazsUCcEaaifaLAvd6GHXwsC4bqOcpzPOZSMYD0q04enc IrbLrZhqVZuQnXvAvL27WReF9/NsLxgQaeK9ToMxc+NlHLP6MDvK/EmWUcn3s6TC/OtR Uup74xyXOAdV692D39odwAohcZx8zDflXLTHck38B2gIWbVZKAWSYGrKdfJdkykayTjv ccXXqiFCNfDfXMXek5j4Himb3AjP6f++mZhdNMzV8uqcbvF6ENp/EKv5VY8meL93BGmq P/AVIJEbaHfJQtumkmgQQSFvhUrDy65SVW/pQGA5B+toIOHl5pYicoD1TlDxvu6qBFd0 L5ag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si10678118ejj.290.2021.05.16.03.27.52; Sun, 16 May 2021 03:28:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234980AbhEPJge (ORCPT + 99 others); Sun, 16 May 2021 05:36:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:57392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234937AbhEPJgd (ORCPT ); Sun, 16 May 2021 05:36:33 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 162C761028; Sun, 16 May 2021 09:35:15 +0000 (UTC) Date: Sun, 16 May 2021 10:36:28 +0100 From: Jonathan Cameron To: Nathan Chancellor Cc: Arnd Bergmann , Nick Desaulniers , Maxime =?UTF-8?B?Um91c3Npbi1Cw6lsYW5nZXI=?= , Jean-Francois Dagenais , Arnd Bergmann , Lars-Peter Clausen , Alexandru Ardelean , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH] iio: si1133: fix format string warnings Message-ID: <20210516103628.2cf899a0@jic23-huawei> In-Reply-To: <7afc367b-8103-9d48-1bfe-d505d86553b9@kernel.org> References: <20210514135927.2926482-1-arnd@kernel.org> <7afc367b-8103-9d48-1bfe-d505d86553b9@kernel.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 14 May 2021 10:45:02 -0700 Nathan Chancellor wrote: > On 5/14/2021 6:59 AM, Arnd Bergmann wrote: > > From: Arnd Bergmann > > > > clang complains about multiple instances of printing an integer > > using the %hhx format string: > > > > drivers/iio/light/si1133.c:982:4: error: format specifies type 'unsigned char' but the argument has type 'unsigned int' [-Werror,-Wformat] > > part_id, rev_id, mfr_id); > > ^~~~~~~ > > > > Print them as a normal integer instead, leaving the "#02" > > length modifier. > > > > Fixes: e01e7eaf37d8 ("iio: light: introduce si1133") > > Signed-off-by: Arnd Bergmann > > Indeed, use of %hx and %hhx have been discouraged since commit > cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary > %h[xudi] and %hh[xudi]"). > > Reviewed-by: Nathan Chancellor Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to poke at it. Thanks, Jonathan > > > --- > > drivers/iio/light/si1133.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/iio/light/si1133.c b/drivers/iio/light/si1133.c > > index c280b4195003..fd302480262b 100644 > > --- a/drivers/iio/light/si1133.c > > +++ b/drivers/iio/light/si1133.c > > @@ -978,11 +978,11 @@ static int si1133_validate_ids(struct iio_dev *iio_dev) > > return err; > > > > dev_info(&iio_dev->dev, > > - "Device ID part %#02hhx rev %#02hhx mfr %#02hhx\n", > > + "Device ID part %#02x rev %#02x mfr %#02x\n", > > part_id, rev_id, mfr_id); > > if (part_id != SI1133_PART_ID) { > > dev_err(&iio_dev->dev, > > - "Part ID mismatch got %#02hhx, expected %#02x\n", > > + "Part ID mismatch got %#02x, expected %#02x\n", > > part_id, SI1133_PART_ID); > > return -ENODEV; > > } > > >