From patchwork Sun Jun 17 08:48:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 10468681 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 211B1601C2 for ; Sun, 17 Jun 2018 08:49:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C65FF285DB for ; Sun, 17 Jun 2018 08:49:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B7255285F1; Sun, 17 Jun 2018 08:49:07 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6C787285DB for ; Sun, 17 Jun 2018 08:49:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=9NmZLl5OdGgrZcMSxCxE4JRg85kGDQXtTpUU0oRc0ow=; b=KRx Q/a1PC7H0HE3yrH7bNaYWtN24mIvpzVknF2+L8E0lXfZLmIGu/r6CTFBRBj7yJf5Qjy65zkW8BK6O VoqATFxQnjCsdvO9ZRabJJC2I5bsaX4xbA+uSmaFpYjj1uwUCcdWyPgEBLby2sW6YOu2+lR23UTPr LgkgN9KFlO0pUCVLeiWMwSAziVPciilKf4El1vhfebz1jUH6DK3G/wTOePLW//pWMm+jLx4lZWMTk +6fhSgkdQwdgqjfCOAV/hSuwhN6pJOS3kLAU3PUsS6cAj2J1OuoETdTyBBaCGJKfYUknasxldlu5q a/4R0JZLhsn18Z7SupDW3OkBwzEfKCg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fUTMv-0004Vm-UH; Sun, 17 Jun 2018 08:49:05 +0000 Received: from mail.kmu-office.ch ([2a02:418:6a02::a2]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fUTMr-0004U0-Px for linux-arm-kernel@lists.infradead.org; Sun, 17 Jun 2018 08:49:03 +0000 Received: from trochilidae.lan (unknown [37.17.239.3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id ABF885C037A; Sun, 17 Jun 2018 10:48:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1529225329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:content-type:content-transfer-encoding: in-reply-to:references; bh=ZjvNVXWFdRVsCVQNAEc1HToxaABQiBl/rg5vop04hj0=; b=GHeQ03pvQj+f4rB8Gl6uihwrhOv7wKULqDXY8e1F6j1b5n8WQqiSmyvE3KG+qEU8ROI2lm cOgHK9GhglBASoxSEi54ClEH+6DA76Sum6Dv6iADg8dmSpvWGPazsTim8+6TmFDKOMmgkT VE8LLRu5pwZ/HMS/gYC14r4uKhrOeCs= From: Stefan Agner To: Boris Brezillon Subject: [PATCH v2] drm/atmel-hlcdc: check stride values in the first plane Date: Sun, 17 Jun 2018 10:48:22 +0200 Message-Id: <20180617084826.31885-1-stefan@agner.ch> X-Mailer: git-send-email 2.17.1 X-Spamd-Result: default: False [-2.10 / 15.00]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_SEVEN(0.00)[8]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; MID_CONTAINS_FROM(1.00)[]; ASN(0.00)[asn:13030, ipnet:37.17.238.0/23, country:CH]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180617_014901_991295_0BF5B109 X-CRM114-Status: GOOD ( 14.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Stefan Agner , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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] Check for values in the first plane instead. Signed-off-by: Stefan Agner --- Changes in v2: - Check for first value instead of dropping if statement (subject was: drm/atmel-hlcdc: remove unnecessary if statement) drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c index 73c875db45f4..47e0992f3908 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c @@ -839,7 +839,7 @@ static int atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane) return ret; } - if (desc->layout.xstride && desc->layout.pstride) { + if (desc->layout.xstride[0] && desc->layout.pstride[0]) { int ret; ret = drm_plane_create_rotation_property(&plane->base,