mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Wambui Karuga <wambui.karugax@gmail.com>
Cc: tomi.valkeinen@ti.com, airlied@linux.ie, daniel@ffwll.ch,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/omapdrm: use BUG_ON macro for error debugging.
Date: Wed, 8 Jan 2020 18:35:29 +0100	[thread overview]
Message-ID: <20200108173529.GG43062@phenom.ffwll.local> (raw)
In-Reply-To: <20200102095515.7106-1-wambui.karugax@gmail.com>

On Thu, Jan 02, 2020 at 12:55:15PM +0300, Wambui Karuga wrote:
> Since the if statement only checks for the value of the `id` variable,
> it can be replaced by the more concise BUG_ON() macro for error
> reporting.
> Issue found using coccinelle.
> 
> Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>

Tomi said he's ok with this landing in drm-misc-next on irc, so merged.
Thanks for your patch!
-Daniel

> ---
>  drivers/gpu/drm/omapdrm/dss/dispc.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
> index 413dbdd1771e..dbb90f2d2ccd 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dispc.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
> @@ -393,8 +393,7 @@ static void dispc_get_reg_field(struct dispc_device *dispc,
>  				enum dispc_feat_reg_field id,
>  				u8 *start, u8 *end)
>  {
> -	if (id >= dispc->feat->num_reg_fields)
> -		BUG();
> +	BUG_ON(id >= dispc->feat->num_reg_fields);
>  
>  	*start = dispc->feat->reg_fields[id].start;
>  	*end = dispc->feat->reg_fields[id].end;
> -- 
> 2.17.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

      reply	other threads:[~2020-01-08 17:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-02  9:55 Wambui Karuga
2020-01-08 17:35 ` Daniel Vetter [this message]

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=20200108173529.GG43062@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tomi.valkeinen@ti.com \
    --cc=wambui.karugax@gmail.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

all inboxes | Powered by JetHome®