Commit 50b0946d authored by Maxime Ripard's avatar Maxime Ripard

drm/connector: Fix warning in debug message

The commit 3aeeb13d ("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@google.com>
Reported-by: default avatarkbuild test robot <lkp@intel.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Fixes: 3aeeb13d ("drm/modes: Support modes names on the command line")
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190624084016.12937-1-maxime.ripard@bootlin.com
parent 1effe5a3
......@@ -140,8 +140,7 @@ static void drm_connector_get_cmdline_mode(struct drm_connector *connector)
}
DRM_DEBUG_KMS("cmdline mode for connector %s %s %dx%d@%dHz%s%s%s\n",
connector->name,
mode->name ? mode->name : "",
connector->name, mode->name,
mode->xres, mode->yres,
mode->refresh_specified ? mode->refresh : 60,
mode->rb ? " reduced blanking" : "",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment