From patchwork Mon Aug 7 06:26:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 9884449 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B718460364 for ; Mon, 7 Aug 2017 06:27:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A872328573 for ; Mon, 7 Aug 2017 06:27:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D48F28578; Mon, 7 Aug 2017 06:27:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1C73A28587 for ; Mon, 7 Aug 2017 06:27:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 781446E1CC; Mon, 7 Aug 2017 06:27:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kmu-office.ch (mail.kmu-office.ch [IPv6:2a02:418:6a02::a2]) by gabe.freedesktop.org (Postfix) with ESMTPS id B30556E1CC for ; Mon, 7 Aug 2017 06:27:00 +0000 (UTC) Received: from localhost.localdomain (unknown [IPv6:2601:602:8800:40b0::587]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 0556E5C2113; Mon, 7 Aug 2017 08:24:05 +0200 (CEST) From: Stefan Agner To: boris.brezillon@free-electrons.com, airlied@linux.ie 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1502087047; bh=GkXHd5tFOpoom+hq5sLUJb2nn8otdTTeyAH0posaIfc=; h=From:To:Cc:Subject:Date:Message-Id; b=Hv8ks37KYt5utox62UTaVOGX76Id20RSDJv3+vErhpcV57j1LtKyvMVeoqMmQM2RMoBBj6OjCIGEe/4VbBLSMYrO8ARnpoLvTfAa/PxGx7wBQm5TWLzPmtBVngdm1u1VQ3pHVHq5cL3JOZxRDOi7AcbWNGTfFR012ABMp5Xmykk= Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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) { /*