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: <20180617095033.515bd531@bbrezillon>
Date:   Sun, 17 Jun 2018 09:50:33 +0200
From:   Boris Brezillon <boris.brezillon@...tlin.com>
To:     Stefan Agner <stefan@...er.ch>
Cc:     maxime.ripard@...tlin.com, airlied@...ux.ie,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/atmel-hlcdc: remove unnecessary if statement

On Sun, 17 Jun 2018 01:34:34 +0200
Stefan Agner <stefan@...er.ch> wrote:

> Boris, Maxime,
> 
> On 07.08.2017 08:26, Stefan Agner wrote:
> > The statement always evaluates to true since the struct fields
> > are arrays. This has shown up as a warning when compiling with
> > clang:
> >   warning: address of array 'desc->layout.xstride' will always
> >       evaluate to 'true' [-Wpointer-bool-conversion]  
> 
> It seems that this patch never made it upstream. It still produces a
> warning when building with clang. Maybe you could have a look and queue?

Oops, sorry, I missed that one.

> 
> --
> Stefan
> 
> > 
> > Signed-off-by: Stefan Agner <stefan@...er.ch>
> > ---
> >  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 21 +++++++++------------
> >  1 file changed, 9 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> > b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> > index 1124200bb280..9bd8c4888035 100644
> > --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> > +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> > @@ -854,24 +854,21 @@ static int
> > atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane,
> >  				struct atmel_hlcdc_plane_properties *props)
> >  {
> >  	const struct atmel_hlcdc_layer_desc *desc = plane->layer.desc;
> > +	int ret;
> >  
> >  	if (desc->type == ATMEL_HLCDC_OVERLAY_LAYER ||
> >  	    desc->type == ATMEL_HLCDC_CURSOR_LAYER)
> >  		drm_object_attach_property(&plane->base.base,
> >  					   props->alpha, 255);
> >  
> > -	if (desc->layout.xstride && desc->layout.pstride) {

The test should be 

	if (desc->layout.xstride[0] && desc->layout.pstride[0])

Can you send a new version with this change?

> > -		int ret;
> > -
> > -		ret = drm_plane_create_rotation_property(&plane->base,
> > -							 DRM_MODE_ROTATE_0,
> > -							 DRM_MODE_ROTATE_0 |
> > -							 DRM_MODE_ROTATE_90 |
> > -							 DRM_MODE_ROTATE_180 |
> > -							 DRM_MODE_ROTATE_270);
> > -		if (ret)
> > -			return ret;
> > -	}
> > +	ret = drm_plane_create_rotation_property(&plane->base,
> > +						 DRM_MODE_ROTATE_0,
> > +						 DRM_MODE_ROTATE_0 |
> > +						 DRM_MODE_ROTATE_90 |
> > +						 DRM_MODE_ROTATE_180 |
> > +						 DRM_MODE_ROTATE_270);
> > +	if (ret)
> > +		return ret;
> >  
> >  	if (desc->layout.csc) {
> >  		/*  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ