[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZU1shQH64ryxp/l5@ideak-desk.fi.intel.com>
Date: Fri, 10 Nov 2023 01:34:29 +0200
From: Imre Deak <imre.deak@...el.com>
To: David Laight <David.Laight@...lab.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"torvalds@...ux-foundation.org" <torvalds@...ux-foundation.org>
Subject: Re: Build fail in drivers/gpu/drm/i915/display/intel_tc.c
On Thu, Nov 09, 2023 at 10:55:38PM +0000, David Laight wrote:
> I'm seeing a build fail at line 1878 of intel_tc.c
>
> gcc is being a bit over-enthusiastic about snprintf() formats
> and reports that "%c/TC#%d", xxx, tc_port + 1 might not fit
> in the 8 bytes available.
> 'tc_port' is an enum with values -1 to 5.
> I guess it is either allowing for the full 'int' value of
> the enum.
> Changing to '(tc_port & 7) + 1' stops the compiler bleating.
>
> The code isn't new, so I guess the compiler flags have changed?
>
> It might depend on the gcc version as well.
> I'm using gcc 7.5.0 from Ubuntu 18.04.
The compiler warn should be fixed/suppressed by:
https://lore.kernel.org/all/20231026125636.5080-1-nirmoy.das@intel.com
--Imre
>
> David
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
>
Powered by blists - more mailing lists