[PATCH 2/4] drm: Help unconfuse gcc, avoid accidental impossible unsigned comparisons

Chris Wilson chris at chris-wilson.co.uk
Mon May 18 16:26:20 UTC 2020


Quoting Emil Velikov (2020-05-18 17:23:21)
> On Sat, 16 May 2020 at 22:23, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> >
> > drivers/gpu/drm/drm_client_modeset.c: In function ‘drm_client_firmware_config’:
> > ./include/linux/bits.h:26:28: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
> >    __builtin_constant_p((l) > (h)), (l) > (h), 0)))
> >
> Hmm this seems like a hack around a macro bug. I'll send a fix for the
> macro in a few minutes.
> With that you don't have to tinker to make it unsigned, although const
> will be appreciated.

Streams crossed. I added Daniel's suggestion for a WARN_ON to make it
clear that we should never pass connectors_count==0 to
drm_client_firmware_config
-Chris


More information about the dri-devel mailing list