Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp786561pxj; Thu, 27 May 2021 11:35:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnAnPBcr9NpYJp3BTYujg+WBAT3i0KrEPgm8P/BvA08KhNBiVd5asAGZebSE8KwXbTffGt X-Received: by 2002:a92:4a0e:: with SMTP id m14mr4009089ilf.278.1622140550091; Thu, 27 May 2021 11:35:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622140550; cv=none; d=google.com; s=arc-20160816; b=MkT9+bJHC69cXc1ZZXjPasHmRC6FDfwz2MzZiUK4LSw//eOkIp1f4ATSuhX0xdbKMD LAygL61mne12gHWJYac24Q0SWa5W+A+fqBtjB7AUsalMcw6yD8kw5/Qt3yGzdvI4fzz/ jyxgGxLIpbqu8U5Bao2Dgm/Vh98cMcREdGJwZpSEuEVMU+EQAlbNpVKuBCE3QdbmLJHq sVU4uaY4ffNdM+QEqMrDaDuR8n+zhIT0a/8tRzzsyG+wnZL/p0tcgbuPMYzTlANkcuHl G+1LM9507Gu42+hOm/SoEW38ii3VEtbar4gsw3WBwt0G7coRLPXMVyYGwOEuCIHIFVlj 42MQ== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=nfEYfHu/xpv2orIRp7LpxxPBhcKbj3EHe2w3N0b/vhE=; b=jFXJ/scO5CqUWj4lk6IH00BSKSC2d5sqCQj6v9LyCsJDoAQLsPJZKDlZwRYdWzZHw8 3ssNPKCzs9jCtDUt1sqiOIGRaptIGqjTW7pCJoWM7RHNjpupNck3GakgKd/DTejMP0/u Fcmxf5ykmYKXsgh/S7Rx2cx6YJOPOykAm2YWAhRcTaCTRDZD9WoUSHMcj6PFWye0uk7j cGJecUMEzf0sQvHBUwYkR7WpG8e/Z1X7gPYEGmRkrUckQlLDsbE8NITbbeaiRqsFilQu 5hnmZPKmCtDdxkcaQYgDSz3LDU0qwDh5dck710DOcNJfJNqlk1tqcTAOXu6IPDLDpgs/ rvAw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g10si3225975ilf.140.2021.05.27.11.35.35; Thu, 27 May 2021 11:35:50 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232565AbhE0QTI (ORCPT + 99 others); Thu, 27 May 2021 12:19:08 -0400 Received: from smtprelay0117.hostedemail.com ([216.40.44.117]:36432 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235283AbhE0QTE (ORCPT ); Thu, 27 May 2021 12:19:04 -0400 Received: from omf14.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id 7B4A21812870E; Thu, 27 May 2021 16:17:28 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf14.hostedemail.com (Postfix) with ESMTPA id 840D8268E46; Thu, 27 May 2021 16:17:26 +0000 (UTC) Message-ID: <644a711e4d2639a23bfc50dffa180ad184a4acb1.camel@perches.com> Subject: Re: [PATCH] iio: si1133: fix format string warnings From: Joe Perches To: Jonathan Cameron , Nathan Chancellor Cc: Arnd Bergmann , Nick Desaulniers , Maxime =?ISO-8859-1?Q?Roussin-B=E9langer?= , 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 Date: Thu, 27 May 2021 09:17:24 -0700 In-Reply-To: <20210516103628.2cf899a0@jic23-huawei> References: <20210514135927.2926482-1-arnd@kernel.org> <7afc367b-8103-9d48-1bfe-d505d86553b9@kernel.org> <20210516103628.2cf899a0@jic23-huawei> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.39 X-Stat-Signature: qdkk4frfin6s4b3oqc9zzfiayxtbnk1i X-Rspamd-Server: rspamout02 X-Rspamd-Queue-Id: 840D8268E46 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1+ozl0XL3trtk2YILrXGbz44hU+4X9/M6Q= X-HE-Tag: 1622132246-824994 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2021-05-16 at 10:36 +0100, Jonathan Cameron wrote: > 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. [] > > > diff --git 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", which is almost certainly wrong. the length specification includes the # which is already 2 bytes. Likely these should be 0x%02x > > > ?? part_id, SI1133_PART_ID);