Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2647131imm; Sun, 17 Jun 2018 00:51:27 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIbj8NFT3UuNJzqOJpSQnnftzgEYuEBAqcLCtLybMxYiRpsq1SFHX22v713WC6Z2fFxAylw X-Received: by 2002:a17:902:bd8f:: with SMTP id q15-v6mr9328635pls.161.1529221887215; Sun, 17 Jun 2018 00:51:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529221887; cv=none; d=google.com; s=arc-20160816; b=H5cuxTEmyvpKf9i7ljCWVzqQxI5/H2lZ6Ry8psivQ2b97RUaiJxRCP2U9SrW+Zx9We a5WUYxab0vg5wsRYCuwevDz1cSbq6mFh+DgopXzYN9BFrLuk7tVBYjH1rJvOIF+PUJKW Ama/jXKJnYQb3Fj9ZXWOjU47KL+FDACreOlwJl2tMQ5q4ePi+FjevDWeLSxaWFQ+WAxN u4O6QkRkt2WmxcEKiOQvCMBj/uzDx/IuVB0PQH98sGigrdmy3CX1hF4fpIV9ein4cICs IZvUUli2YVdEl9v4brcMw0xKK+OLvwsXq0IgLIF1PRvdIcLbHdGezsbaFKNJxkwvMyM7 JEqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=MAF2zAZKvPnItJZqIByjWYob3v0zhfplkkyWmxC1IXY=; b=qwNm7Z8/NajKNmUtlAzoKQJHx626v+Lyb+u5rOvNcTt73K8ZQFq8wKVCDh1H2e/fOP YOW3iqjmO7e1NlmioG+CLKSOQ0oF359/0uVX75WJO7+Rgma+O+nhZATpwjmxLQe17WHM HKaEKoCmLxDqpAbF/OUMenjNzrcWuO4XuDmiQHFAZzXnTW17brbjtTnHrYqbHzDgDDQb NS1znbbxvX0sNxLuqfAzquqXVe5V7F5n93uJLwL3AOROjXbcTN7BgOWj+B2yQ7viD05J LjtAcy1kv9uqKk0ThhH38lSham/Bspn1cy8QaPQw8kXaWpJWzEX2bPDb/VjCTrGnetGi owHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d37-v6si9757544plb.481.2018.06.17.00.51.08; Sun, 17 Jun 2018 00:51:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932583AbeFQHug (ORCPT + 99 others); Sun, 17 Jun 2018 03:50:36 -0400 Received: from mail.bootlin.com ([62.4.15.54]:38279 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932451AbeFQHuf (ORCPT ); Sun, 17 Jun 2018 03:50:35 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 4676420799; Sun, 17 Jun 2018 09:50:34 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (unknown [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id 1231820012; Sun, 17 Jun 2018 09:50:34 +0200 (CEST) Date: Sun, 17 Jun 2018 09:50:33 +0200 From: Boris Brezillon To: Stefan Agner Cc: maxime.ripard@bootlin.com, airlied@linux.ie, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/atmel-hlcdc: remove unnecessary if statement Message-ID: <20180617095033.515bd531@bbrezillon> In-Reply-To: <041e4264a89b5d8ab748f6dc3bf501db@agner.ch> References: <20170807062650.9863-1-stefan@agner.ch> <041e4264a89b5d8ab748f6dc3bf501db@agner.ch> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 17 Jun 2018 01:34:34 +0200 Stefan Agner 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 > > --- > > 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) { > > /*