Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2683312imm; Sun, 17 Jun 2018 01:49:35 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIUWObcKjpgsWOp3RQ0llF6MmFj4usTyYD5kR+JGIeRMZtpmZ+CC3ORCnPCwTl5jBPaKthW X-Received: by 2002:aa7:84cf:: with SMTP id x15-v6mr8894299pfn.220.1529225374934; Sun, 17 Jun 2018 01:49:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529225374; cv=none; d=google.com; s=arc-20160816; b=N1FRppMi22SNGU6kbguh58oJoYmzXyW+UdP7Bd4JNWxJc6eDQFXGAxRkPve/99eZUa TyIoUJcCKEOB8p63jtygFnwcCfxYIuMHsoRbloll9K0HmjWkBfzH7spIftmrw8XDlZeb RNqKrdVrbclh65ridprJ9vK01Qy2u92b5v0R8K582l+Lm8f96+49ajUEC5ReZMTW312o qDX+H2opGBqwsUIfODQj/VtynSqlNlSr9Dcjv4TNspEtEs4FS2yzWm8DrPnPX0AjZ4Q3 AGeSjyzo4Jx0CJfhQ4Oq8xcjIyRKuODsYsd3D1TydR+YlBna3C1riZW2IftvN9NptBt5 n+IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=ZjvNVXWFdRVsCVQNAEc1HToxaABQiBl/rg5vop04hj0=; b=qQ97jd7gwL8adc72IqIQe7e4+RL5ooi9kl8r9mxZsuMSQgCax4KvXLl177f18Nkl1L QZbmhmGI2XZYEEpaTrJzJQMkFp3zuwXh3ENHp2BFzwq8qulqZ+fe7wiy9n04A8Jus0wB r0t4f1pdPiflhZ/ncW39obHbv4KHnAr+kFPFhaPgKRQT1KSxPpYBbyHV4stEz5rVqpo2 XRFrtL+lsImrvTBkOBElVCkyN8yayiY+ziYI3KhF9cLItffSqgA7fa+DU4Jc6OPMTCo+ G+vCPeD1t12KiR23Q2iHhuqAm8NvfAQpdtsb4eZwIb9aCLVYFQ7/HbGKfVNoKr7c/o8w +F6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=GHeQ03pv; 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 i69-v6si10005325pge.674.2018.06.17.01.49.20; Sun, 17 Jun 2018 01:49:34 -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; dkim=pass header.i=@agner.ch header.s=dkim header.b=GHeQ03pv; 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 S932762AbeFQIsw (ORCPT + 99 others); Sun, 17 Jun 2018 04:48:52 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:43728 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932478AbeFQIsu (ORCPT ); Sun, 17 Jun 2018 04:48:50 -0400 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 Cc: Stefan Agner , David Airlie , Nicolas Ferre , Alexandre Belloni , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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)[] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, -- 2.17.1