lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200108173529.GG43062@phenom.ffwll.local>
Date:   Wed, 8 Jan 2020 18:35:29 +0100
From:   Daniel Vetter <daniel@...ll.ch>
To:     Wambui Karuga <wambui.karugax@...il.com>
Cc:     tomi.valkeinen@...com, airlied@...ux.ie, daniel@...ll.ch,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/omapdrm: use BUG_ON macro for error debugging.

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@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ