drm: connector: remove bogus NULL check
Subsystems (2)
PATCH 1/1 drm: connector: remove bogus NULL check
mode->name is a character array in a structure, checking it's address is pointless and causes a warning with some compilers:
drivers/gpu/drm/drm_connector.c:144:15: error: address of array 'mode->name' will always evaluate to 'true'
[-Werror,-Wpointer-bool-conversion]
mode->name ? mode->name : "",
~~~~~~^~~~ ~
include/drm/drm_print.h:366:29: note: expanded from macro 'DRM_DEBUG_KMS'
drm_dbg(DRM_UT_KMS, fmt, ##__VA_ARGS__)
^~~~~~~~~~~Remove the check here.
--- drivers/gpu/drm/drm_connector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_connector.c +1 -1
@@ -141,7 +141,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 : "", + mode->name, mode->xres, mode->yres, mode->refresh_specified ? mode->refresh : 60, mode->rb ? " reduced blanking" : "",
Signature · 6 lines
2.20.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 24 lines · Arnd Bergmann
mode->nameis a character array in a structure, checking it's address is pointless and causes a warning with some compilers:
drivers/gpu/drm/drm_connector.c:144:15: error: address of array 'mode->name' will always evaluate to 'true'[-Werror,-Wpointer-bool-conversion] mode->name ? mode->name : "", ~~~~~~^~~~ ~ include/drm/drm_print.h:366:29: note: expanded from macro 'DRM_DEBUG_KMS' drm_dbg(DRM_UT_KMS, fmt, ##__VA_ARGS__) ^~~~~~~~~~~Remove the check here.
Fixes 3aeeb13d8996 ("drm/modes: Support modes names on the command line")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/gpu/drm/drm_connector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/drm_connector.c +0
-0
drivers/gpu/drm/drm_connector.c static void drm_connector_get_cmdline_mode(struct drm_connector *connector) · line 144
Quoted 5 lines
drivers/gpu/drm/drm_connector.c +1
-1@@ -141,7 +141,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 : "", + mode->name,
Looks good to me.
Quoted 6 lines
drivers/gpu/drm/drm_connector.c +0
-0mode->xres, mode->yres, mode->refresh_specified ? mode->refresh :60 , mode->rb ? " reduced blanking" : "",Signature · 1 line
2.20.0
Quoted 11 lines · On Fri, 28 Jun 2019 12:39:05 +0200 Arnd Bergmann <[email protected]> wrote:
mode->nameis a character array in a structure, checking it's address is pointless and causes a warning with some compilers:
drivers/gpu/drm/drm_connector.c:144:15: error: address of array 'mode->name' will always evaluate to 'true'[-Werror,-Wpointer-bool-conversion] mode->name ? mode->name : "", ~~~~~~^~~~ ~ include/drm/drm_print.h:366:29: note: expanded from macro 'DRM_DEBUG_KMS' drm_dbg(DRM_UT_KMS, fmt, ##__VA_ARGS__) ^~~~~~~~~~~
Quoted 4 lines
Remove the check here.
Fixes 3aeeb13d8996 ("drm/modes: Support modes names on the command line")Signed-off-by Arnd Bergmann <[email protected]>
Quoted 17 lines
--- drivers/gpu/drm/drm_connector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/drm_connector.c +1
-1@@ -141,7 +141,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 : "", + mode->name, mode->xres, mode->yres, mode->refresh_specified ? mode->refresh : 60, mode->rb ? " reduced blanking" : "",
Boris Brezillon
AppliedQuoted 11 lines · On Fri, 28 Jun 2019 12:39:05 +0200 Arnd Bergmann <[email protected]> wrote:
mode->nameis a character array in a structure, checking it's address is pointless and causes a warning with some compilers:
drivers/gpu/drm/drm_connector.c:144:15: error: address of array 'mode->name' will always evaluate to 'true'[-Werror,-Wpointer-bool-conversion] mode->name ? mode->name : "", ~~~~~~^~~~ ~ include/drm/drm_print.h:366:29: note: expanded from macro 'DRM_DEBUG_KMS' drm_dbg(DRM_UT_KMS, fmt, ##__VA_ARGS__) ^~~~~~~~~~~
Quoted 4 lines
Remove the check here.
Fixes 3aeeb13d8996 ("drm/modes: Support modes names on the command line")Signed-off-by Arnd Bergmann <[email protected]>
Queued to drm-misc-next-fixes.
Thanks,
Boris
Quoted 17 lines
--- drivers/gpu/drm/drm_connector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/drm_connector.c +1
-1@@ -141,7 +141,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 : "", + mode->name, mode->xres, mode->yres, mode->refresh_specified ? mode->refresh : 60, mode->rb ? " reduced blanking" : "",