lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a22c082a661df0b548511f282fcc519a11bb3340.camel@perches.com>
Date:   Mon, 29 Nov 2021 02:10:14 -0800
From:   Joe Perches <joe@...ches.com>
To:     Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
Cc:     linuxarm@...wei.com, mauro.chehab@...wei.com,
        Hans Verkuil <hverkuil@...all.nl>,
        Kees Cook <keescook@...omium.org>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
        llvm@...ts.linux.dev
Subject: Re: [PATCH v2 09/20] media: si470x: fix printk warnings with clang

On Mon, 2021-11-29 at 10:47 +0100, Mauro Carvalho Chehab wrote:
> Clang doesn't like "%hu" on macros:
> 
> 	drivers/media/radio/si470x/radio-si470x-i2c.c:414:4: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat]
> 	drivers/media/radio/si470x/radio-si470x-i2c.c:417:4: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat]
> 
> Besides that, changeset cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary %h[xudi] and %hh[xudi]")
> dropped recomendation of using %h.
> 
> So, just replace them with "%u".

And perhaps change these to single dev_warn calls instead of multiple calls.

> diff --git a/drivers/media/radio/si470x/radio-si470x-i2c.c b/drivers/media/radio/si470x/radio-si470x-i2c.c
[]
> @@ -410,10 +410,10 @@ static int si470x_i2c_probe(struct i2c_client *client)
>  			radio->registers[DEVICEID], radio->registers[SI_CHIPID]);
>  	if ((radio->registers[SI_CHIPID] & SI_CHIPID_FIRMWARE) < RADIO_FW_VERSION) {
>  		dev_warn(&client->dev,
> -			"This driver is known to work with firmware version %hu,\n",
> +			"This driver is known to work with firmware version %u,\n",
>  			RADIO_FW_VERSION);
>  		dev_warn(&client->dev,
> -			"but the device has firmware version %hu.\n",
> +			"but the device has firmware version %u.\n",
>  			radio->registers[SI_CHIPID] & SI_CHIPID_FIRMWARE);

		dev_warn(&client->dev,
			"This driver is known to work with firmware version %u, but the device has firmware version %u\n",
			RADIO_FW_VERSION, radio->registers[SI_CHIPID] & SI_CHIPID_FIRMWARE);

etc...


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ