public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Build fail in drivers/gpu/drm/i915/display/intel_tc.c
@ 2023-11-09 22:55 David Laight
  2023-11-09 23:34 ` Imre Deak
  0 siblings, 1 reply; 6+ messages in thread
From: David Laight @ 2023-11-09 22:55 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
	Imre Deak

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.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-11-15  9:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-09 22:55 Build fail in drivers/gpu/drm/i915/display/intel_tc.c David Laight
2023-11-09 23:34 ` Imre Deak
2023-11-10  0:51   ` Linus Torvalds
2023-11-10  9:00     ` David Laight
2023-11-14 19:07       ` Imre Deak
2023-11-15  9:26         ` David Laight

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox