[PATCH] drm/connector: Fix warning in debug message

Maxime Ripard maxime.ripard at bootlin.com
Mon Jun 24 13:41:40 UTC 2019


On Mon, Jun 24, 2019 at 10:44:33AM +0200, Daniel Vetter wrote:
> On Mon, Jun 24, 2019 at 10:40:16AM +0200, Maxime Ripard wrote:
> > The commit 3aeeb13d8996 ("drm/modes: Support modes names on the command
> > line") added name support to the DRM modes, and added that name to the
> > debug message.
> >
> > However, that code tests for whether or not the name variable is NULL and
> > only prints it if it's not. Except that that variable is an array, so it
> > will never be NULL.
> >
> > The original intent was to print it only when the name has been specified.
> > Just printing the array directly will achieve the same thing since the
> > drm_cmdline_mode structure that holds it is itself contained in
> > drm_connector, that is allocated with its whole content zero'd.
> >
> > That means that if the name is not declared, the array will be all zeros,
> > which will not print anything.
> >
> > Cc: Nick Desaulniers <ndesaulniers at google.com>
> > Reported-by: kbuild test robot <lkp at intel.com>
> > Fixes: 3aeeb13d8996 ("drm/modes: Support modes names on the command line")
> > Signed-off-by: Maxime Ripard <maxime.ripard at bootlin.com>
>
> Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>

Applied,

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20190624/8c62958e/attachment.sig>


More information about the dri-devel mailing list