lkml.org 
[lkml]   [2023]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: Build fail in drivers/gpu/drm/i915/display/intel_tc.c
On Thu, 9 Nov 2023 at 15:34, Imre Deak <imre.deak@intel.com> wrote:
>
> The compiler warn should be fixed/suppressed by:
> https://lore.kernel.org/all/20231026125636.5080-1-nirmoy.das@intel.com

Ugh, so now it's a dynamic allocation, wasting memory, and a pointer
to it, using as much memory as the array did in the first place.

All because of a pointless warning that was a false positive - and was
always harmless anyway, since snprintf() is safe (ie it was only a
"might be truncated").

Please don't do this. Either do that ((tc_port & 7) + 1) suggestion of
David's, or just do '%c' and make the expression be

'1' + tc_port

which should be fine since I915_MAX_PORTS is 8 or whatever.

I do wonder why those ports are printed out as '1-8', when the 'enum
port' is PORT_A..I.

So it would actually have made more sense to print them out as %c with
the expression being

'A'+tc_port

but I guess by now people might depend on the 1..8 naming?

Linus

\
 
 \ /
  Last update: 2023-11-20 13:54    [W:0.042 / U:23.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site