Re: [PATCH, net-next] net: ethernet: freescale: fix false-positive string overflow warning
From: David Miller
Date: Wed May 30 2018 - 13:19:10 EST
From: Arnd Bergmann <arnd@xxxxxxxx>
Date: Mon, 28 May 2018 17:49:46 +0200
> While compile-testing on arm64 with gcc-8.1, I ran into a build diagnostic:
...
> It appears this has never shown on ppc32 or arm32 for an unknown reason, but
> now gcc fails to identify that the 'irq_cnt' loop index has an upper bound
> of 3, and instead uses a bogus range.
>
> To work around the warning, this changes the sprintf to snprintf with the
> correct buffer length.
>
> Fixes: 78cc6e7ef957 ("net: ethernet: freescale: Allow FEC with COMPILE_TEST")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
Applied, thanks Arnd.