Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752076AbdHGG1A (ORCPT ); Mon, 7 Aug 2017 02:27:00 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:33576 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751516AbdHGG07 (ORCPT ); Mon, 7 Aug 2017 02:26:59 -0400 From: Stefan Agner To: boris.brezillon@free-electrons.com, airlied@linux.ie Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Stefan Agner Subject: [PATCH] drm/atmel-hlcdc: remove unnecessary if statement Date: Sun, 6 Aug 2017 23:26:50 -0700 Message-Id: <20170807062650.9863-1-stefan@agner.ch> X-Mailer: git-send-email 2.13.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1670 Lines: 51 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] 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) { - 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) { /* -- 2.13.3