[Letux-kernel] [PATCH] nvmem: jz4780-efuse: fix build warnings on ARCH=x86_64 or riscv

Srinivas Kandagatla srinivas.kandagatla at linaro.org
Mon Mar 9 14:52:49 CET 2020



On 06/03/2020 19:17, H. Nikolaus Schaller wrote:
> kbuild-robot did find a type error in the min(a, b)
> function used by this driver if built for x86_64 or riscv.
> 
> Althought it is very unlikely that this driver is built
> for those platforms it could be used as a template
> for something else and therefore should be correct.
> 
> The problem is that we implicitly cast a size_t to
> unsigned int inside the implementation of the min() function.
> 
> Since size_t may differ on different compilers and
> plaforms there may be warnings or not.
> 
> So let's use only size_t variables on all platforms.
> 
> Reported-by: kbuild test robot <lkp at intel.com>
> Reported-by: Stephen Rothwell <sfr at canb.auug.org.au>
> Cc: srinivas.kandagatla at linaro.org
> Cc: prasannatsmkumar at gmail.com
> Cc: malat at debian.org
> Cc: paul at crapouillou.net
> Signed-off-by: H. Nikolaus Schaller <hns at goldelico.com>
> ---
>   drivers/nvmem/jz4780-efuse.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 

Applied thanks,
srini


More information about the Letux-kernel mailing list