linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <maxime.ripard@bootlin.com>,
	"Sean Paul" <sean@poorly.run>, "David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Noralf Trønnes" <noralf@tronnes.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Nicholas Kazlauskas" <nicholas.kazlauskas@amd.com>,
	"Lyude Paul" <lyude@redhat.com>,
	"Uma Shankar" <uma.shankar@intel.com>,
	"Boris Brezillon" <bbrezillon@kernel.org>,
	"Ramalingam C" <ramalingam.c@intel.com>,
	"Radhakrishna Sripada" <radhakrishna.sripada@intel.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm: connector: remove bogus NULL check
Date: Fri, 28 Jun 2019 12:41:54 +0200	[thread overview]
Message-ID: <20190628124154.5245f629@collabora.com> (raw)
In-Reply-To: <20190628103925.2686249-1-arnd@arndb.de>

On Fri, 28 Jun 2019 12:39:05 +0200
Arnd Bergmann <arnd@arndb.de> wrote:

> 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.
> 
> Fixes: 3aeeb13d8996 ("drm/modes: Support modes names on the command line")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

> ---
>  drivers/gpu/drm/drm_connector.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index 3afed5677946..b3f2cf7eae9c 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -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" : "",


  parent reply	other threads:[~2019-06-28 10:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-28 10:39 [PATCH] drm: connector: remove bogus NULL check Arnd Bergmann
2019-06-28  4:02 ` Ramalingam C
2019-06-28 10:41 ` Boris Brezillon [this message]
2019-07-02 15:09 ` Boris Brezillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190628124154.5245f629@collabora.com \
    --to=boris.brezillon@collabora.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=arnd@arndb.de \
    --cc=bbrezillon@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=nicholas.kazlauskas@amd.com \
    --cc=noralf@tronnes.org \
    --cc=radhakrishna.sripada@intel.com \
    --cc=ramalingam.c@intel.com \
    --cc=sean@poorly.run \
    --cc=uma.shankar@intel.com \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).