[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210326102835.GB62598@gauss3.secunet.de>
Date: Fri, 26 Mar 2021 11:28:35 +0100
From: Steffen Klassert <steffen.klassert@...unet.com>
To: Arnd Bergmann <arnd@...nel.org>
CC: <netdev@...r.kernel.org>, Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
David Ahern <dsahern@...nel.org>,
Jakub Kicinski <kuba@...nel.org>,
Arnd Bergmann <arnd@...db.de>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
"Zhang Changzhong" <zhangchangzhong@...wei.com>,
Sabrina Dubroca <sd@...asysnail.net>,
Willem de Bruijn <willemb@...gle.com>,
Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>,
<linux-kernel@...r.kernel.org>,
<clang-built-linux@...glegroups.com>
Subject: Re: [PATCH net-next] ipv6: fix clang Wformat warning
On Mon, Mar 22, 2021 at 12:56:49PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
>
> When building with 'make W=1', clang warns about a mismatched
> format string:
>
> net/ipv6/ah6.c:710:4: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat]
> aalg_desc->uinfo.auth.icv_fullbits/8);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/printk.h:375:34: note: expanded from macro 'pr_info'
> printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
> ~~~ ^~~~~~~~~~~
> net/ipv6/esp6.c:1153:5: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat]
> aalg_desc->uinfo.auth.icv_fullbits / 8);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/printk.h:375:34: note: expanded from macro 'pr_info'
> printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
> ~~~ ^~~~~~~~~~~
>
> Here, the result of dividing a 16-bit number by a 32-bit number
> produces a 32-bit result, which is printed as a 16-bit integer.
>
> Change the %hu format to the normal %u, which has the same effect
> but avoids the warning.
>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
Applied to ipsec-next, thanks!
Powered by blists - more mailing lists