Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp688767pxj; Fri, 14 May 2021 13:10:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMCQv+msfH3Lexi3uf3ygJh2NfYElcSYHokbfwWrKmtd+GJwGZSDYn8t5b/uj/3HDTWTNn X-Received: by 2002:a17:907:a076:: with SMTP id ia22mr50013664ejc.233.1621023025012; Fri, 14 May 2021 13:10:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621023025; cv=none; d=google.com; s=arc-20160816; b=s7Uw4MpaXZwO9Adc6Tm715I3ptiasah10eAJ/X4GOcrLwN3gj3IpMoPF8Tb+H7nCvv IP/dlQ90QyHwkVLr3CUuqFmD6y1DkzjXJFf+5DDYAlavneD4cDkq3GJS7ER+fqMqwZzJ NxEZmYYBmzltbJSpVVZZB0xZQ5iWP+ObPzWvdinfd4AjnIoCdj5HIBQ3AklpvIJzNAIF TrI2Yt2yUeHZCPFD0DhotbS51vj9ILEbCbRfeDWZdTmm00XDFv/argvBCyAAXJeTolDw wawl+f7046hD//CcKAR08SnPaqHC1r5f3PIyCgKbqmRkk0s/lokboukSv75Gh3H85RAe 5p9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=QLY3Vtt6BQqpBuTSwu/HCIOjCBuLqltLHJXdoqlalIE=; b=CFNGGGiLPOm8nhyUoUIkSfehuW6WeKjj2TJ41HDItAqho7GkYBzzB7QOJeH/Y8bMod fuNEQO1w2dyGT6LMpfVVapFFY0e7KzzHhLaR0LW9WG3n0/kg0S/pcoqttoW4pCbhX81Q oPwO/Mp1FkqrrZQ1xeVzcOM+ilOTFVTVNV1uSJ5b/I37FcN4TIQqS+fNkaS6duSHgq6Z Ik2H9qzDHetHs5wh2M5JJduaZXC1mLSVBmujySHlERdittQofyPk8HA12kqELJ15vn61 raufUznTXdbfNNoqp9e5teP/abjYR7Knla19YZ3irTfpXvLM1Km3P8eZhxYUnW5vaz7/ UtdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y+L4WCeH; 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 js19si8950593ejc.277.2021.05.14.13.10.00; Fri, 14 May 2021 13:10:25 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y+L4WCeH; 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 S235216AbhENRqQ (ORCPT + 99 others); Fri, 14 May 2021 13:46:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:46754 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230213AbhENRqP (ORCPT ); Fri, 14 May 2021 13:46:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2B734613D6; Fri, 14 May 2021 17:45:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621014303; bh=OdG7QFpYNaI0q2QXmh6Rq7lI2lHh8xRpNEIu72tie+A=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Y+L4WCeH9e3iYuEe03OmsdcZMWofID21dvsomCcqmfpXWSPJwTHGL60AqXFNk4IHX ZY0IrTm2pF5Gjt+fwNEhq2n9VKGeHvOuL1TJlRDmPMxAdkTam36WN4QBwbnXWsK+oD /BKSIQQ2IjZcW4eomdRLN/xivhCss3pffzQ5/X7jjiKHwJ3Uhs5GEC5ouLz0rzBfSk JgkQJbAfhBbxvC8IvMtGS8vTNWIgaa0yrrkepvuE7M9eTwxyl6KN3q8YEYtpCsFvL8 HjQtj7JzC6bkV2365zLC9AVjMI+wKXTxtLL089qhPT1q7d/nqlWhvgsMSMCKzEJavw g7qYVKm+p/+Yw== Subject: Re: [PATCH] iio: si1133: fix format string warnings To: Arnd Bergmann , Jonathan Cameron , Nick Desaulniers , =?UTF-8?Q?Maxime_Roussin-B=c3=a9langer?= , Jean-Francois Dagenais Cc: Arnd Bergmann , Lars-Peter Clausen , Alexandru Ardelean , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com References: <20210514135927.2926482-1-arnd@kernel.org> From: Nathan Chancellor Message-ID: <7afc367b-8103-9d48-1bfe-d505d86553b9@kernel.org> Date: Fri, 14 May 2021 10:45:02 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210514135927.2926482-1-arnd@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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; > } >