Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3360448pxf; Sun, 28 Mar 2021 23:16:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweSi8WQcVgEd2l6TJwQzLKvHhUXkyCqXHbOxEYqljUEGp6vl5KBcX5eI+zw9LWqKNdTBhI X-Received: by 2002:a50:82c5:: with SMTP id 63mr26681323edg.97.1616998584649; Sun, 28 Mar 2021 23:16:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1616998584; cv=pass; d=google.com; s=arc-20160816; b=peBLWngC9wsYv2XBSr/UU7FYm6S/abM7TfIycYRBFGRadIpDi5MXingnJC2LAywOtm iM09LN6hfDFTJY0mjDqegPmirn1ZEhR5a9Lat8gGyRhIpJ5vace82NOqHZMHc0HByQ9r KGmNZXXE15dHqgJWkkHo0e/xif24ej86RDMmfoWRMWAbp0dU8P2rARc33wJM1yhZr8HK mHN0tCXompwYgfLUrxqKgztGcHSeicYX7RWdBH1WhVXNXlMJfZ9GxFsSfhaqFMysFvw8 FXeJT2GPZW7A+lGt3d5twNgdp57CKWHNGmEkZ+tpPK3fU8nF0tlnz20cOz5dC+SJMmD2 wtrQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=9zsZx1of93nrbNmXb2S9C4Sx1ATMh7hYRPS71v10IRA=; b=diz1IiiV9NB9LYIAb9J3LpcaPc7u8PDefeo3656nEt9y9afPQMmB8Gg6RwvHJUcqdu OfMhTK0bFJtdDJZtw9zclYYoGBonep8Uswpt70c5TXWmw9bH0/JcCkMEz1KquGmtvEkU 0BpjAMIIgSojX4BOPA5FNxCDr2oUbyUe/++U396owS67nkNggRXZQwT6GZF/oda0qpUQ UcM+LzTjKJMF1LHcZolYcfkyz3W1X5y9A/EpI5rhSGTNGZoUlBp5kn5ow/ZTWio3KI9q UhVgc/EWtJX0ch9WifTk3XVrB0RhHC1qTf1vW7rYRJczuuyUNxYG4M8ND1Z6s/4GWbHB 5SPg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=CT+9Kbgh; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s9si12139193edc.296.2021.03.28.23.16.02; Sun, 28 Mar 2021 23:16:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=CT+9Kbgh; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230247AbhC2GNA (ORCPT + 99 others); Mon, 29 Mar 2021 02:13:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229709AbhC2GMb (ORCPT ); Mon, 29 Mar 2021 02:12:31 -0400 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02on062a.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe05::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66CE3C061574; Sun, 28 Mar 2021 23:12:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bZLBpZc8nbJJn9uCjJQkim0IMHMO2pVJPs3GBlTv3ChPdYMj+ua55+7zfCRgzxPBSGcQ3kp951BVAEr2nZSaaznJEOMH3X9CLstBXaLziwhl5IT8Q4XALOoNZkv3jjJJ6cfTVXgFvuVchF+eKBMowAuxmvvV3hibgi0jfsptjkuOoNzqDuesf5MSD6s6igtyOoxLhSba5x0Ds6BnYbV3bIw15Y+xD2YGajqxm1P2BFX+DH1AzkfZtnCKigy3u5moFlwdTsvP4Atxi8Hrgi8M2wce7DgxRlSi3cL5Gta0mftPc/1vBy3NAArOjiw2VUFWyXBB47evbU68Hj4n8Y90ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9zsZx1of93nrbNmXb2S9C4Sx1ATMh7hYRPS71v10IRA=; b=evqfcIE5kcPPmeY7Oo1ws8020ZkuWaa1FrIDKsOCFYvq1RqMwdMJBP9B8WxjivezK4ngyyZ6K/JWv8nkKq3JLVqghKerYRoiYjt3DvJdlibTRL92RW8wzFJe/Hw644Ume+jGWi5rvgZ3z6gAizPV9RWb2t7OLBES5npNFzbTkvpHPkKYaGAHEJP3mfGdj2pWCleKB6OJR4HUXD8qo7F2ac/xsi+S5nDt+r4ovNEVgQNQY+CDKb2wGVsm0BrnotG+fTgxZPgRJXeX/FKNMD6L+to9N2Y8X6ixMfEDdmHZVGT8YsULBpCRpe97+65i+gA0g6w4tF2EVIGtq41G+N0PLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9zsZx1of93nrbNmXb2S9C4Sx1ATMh7hYRPS71v10IRA=; b=CT+9Kbgh7M+1K6lS94Yg7uc1Nvfe+AgCIMeg5qzGxJMQZny5+K0zX8We49ptPnpeMt0nyNF076H5LOS46T4hs3ao4l3U9O3oKqDcNcvmG39/89k19AlZGtRPmE5mZ/9G3CRsaORug4GgEOv5WPJrA6GWODHdvgJLOm4S2ROXSGI= Authentication-Results: lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) by VI1PR04MB4895.eurprd04.prod.outlook.com (2603:10a6:803:56::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.30; Mon, 29 Mar 2021 06:12:26 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::3ce1:4759:5c33:514c]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::3ce1:4759:5c33:514c%5]) with mapi id 15.20.3977.033; Mon, 29 Mar 2021 06:12:26 +0000 From: Liu Ying To: linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: p.zabel@pengutronix.de, airlied@linux.ie, daniel@ffwll.ch, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, robh+dt@kernel.org, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, laurentiu.palcu@oss.nxp.com, guido.gunther@puri.sm, marcel.ziswiler@toradex.com Subject: [PATCH v9 4/6] drm/atomic: Avoid unused-but-set-variable warning on for_each_old_plane_in_state Date: Mon, 29 Mar 2021 13:57:24 +0800 Message-Id: <1616997446-8783-5-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1616997446-8783-1-git-send-email-victor.liu@nxp.com> References: <1616997446-8783-1-git-send-email-victor.liu@nxp.com> Content-Type: text/plain X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HKAPR03CA0027.apcprd03.prod.outlook.com (2603:1096:203:c9::14) To VI1PR04MB3983.eurprd04.prod.outlook.com (2603:10a6:803:4c::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HKAPR03CA0027.apcprd03.prod.outlook.com (2603:1096:203:c9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3999.14 via Frontend Transport; Mon, 29 Mar 2021 06:12:21 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c69f9759-bac0-4069-d096-08d8f279a01a X-MS-TrafficTypeDiagnostic: VI1PR04MB4895: X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:47; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: legrROUFaSSefg+MQu0zRQLfCRXFYSRkawhq/GMTcur3AWLLnPfJ6pnCvFmmf8YxHiRgLk9JtJwtAF0ljz6jotbkx/KwR3420n3xm8XMrG9Q+tS8QDpw45rQNMuJgSLao3xij2SwyuWzDWg/FcSsNs8/pjpx7JtBMqTGcBBsCgb1xZ0U4ziEuuX/glv8FVAO4dPHsV6r8II2PWiRGx9K1SfbJA+qc23vS1aBI5HR4eqHE0+IgQKKAwQp+sLToLxiJXEoK5ipSQpYV1Bdg1GymSX9zxg7AJKVnNAaLwy9MkbYfa6r8l54cPKMxoRS9l1CHrszXQg0e6D51JqlJf08nvug/MQp3QZf0vYIt/Xq3HTWcYBiWr6GzwFhWnMz2TfZj8n/YXOnw5n66WG2NE6o6XVgHBKxE0s+gnRzadyclj2GrA7EbfoAJgSojAAGUPeopoKGYSPG16J3UrNdf+HzvKlW7HaGUCmHe4pTKpqgrprR53L0wmRvOSHuNy0VOBck7QwWZxDbDjtHML2TxaTOYxyhYOIMH4GwgiyiaytLPWJyTcKWv8RbCqNenC82UZ0meXtIIoKLAarqSFdZ5X70yys7XlaKl7kZWAQBDfD1dDKzJG2m6GiKqrV7jT7G5t1vTeYR/S1sSwWgFwNpNffNkg5CMe30xS82JmLkzL0apDwdo4JfYx5y5aDGExmHcPfb X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB3983.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(136003)(346002)(366004)(39860400002)(396003)(26005)(36756003)(16526019)(186003)(8676002)(8936002)(6512007)(6486002)(83380400001)(52116002)(6506007)(66476007)(66556008)(86362001)(316002)(5660300002)(2906002)(66946007)(2616005)(478600001)(69590400012)(38100700001)(4326008)(7416002)(956004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?ebUx3eUmAimcMmXFxCiVHq5Qw7/B6wiy2a2hiN4W5guFCOQvDiJZx+haiV5Y?= =?us-ascii?Q?APz+PWF6/Mzi8A5CMcGgAoLOaSfc5/jSEZUugGIYP6MzNWG1uStp55vJJuQv?= =?us-ascii?Q?zoBLy6p7/l1P0od7/78ZLYDm7rNx+MPOg+JO2UFCUUSfHOK0b0oG8GwuZdrU?= =?us-ascii?Q?VnqbSRouVpa+Yj+NOmLViWBDFk8ZssMDNg0rYglHnAdBxUeQArPrF5JpeEX9?= =?us-ascii?Q?HDTGE+dU8Bdk5MI0jcAbojCnZ3j1ls9GuZC1nkAKOL4U8SReCnAzcZGCTa4b?= =?us-ascii?Q?5dBOLL01tEDX0Naj+dzCqPhYDkRILJEJMZjB1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oOKyaYhBzKon0Wdq9GEgMZr1xBSJV54e+ExRapnpWX7niY3qp498PK?= =?us-ascii?Q?bXSKWY5c+v9Sq7bLntFTSHDaZZk/KzM0yZbi3VhIyrbSL8u4acFIkTAX3jWG?= =?us-ascii?Q?tDaVZGGqthLMFmWTMWbJ5h/K?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c69f9759-bac0-4069-d096-08d8f279a01a X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2021 06:12:26.5820 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VBCSpGsRkSBERTdNiPKIlhQJfUQHY/0slXYRydT6bi3KwqvGhMn6yOEQDLtrBgingX2hgmQlIYCT2yvTy1DP1A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4895 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Artificially use 'plane' and 'old_plane_state' to avoid 'not used' warning. The precedent has already been set by other macros in the same file. Acked-by: Daniel Vetter Signed-off-by: Liu Ying --- v8->v9: * No change. v7->v8: * No change. v6->v7: * No change. v5->v6: * Fix commit message typo - s/Artifically/Artificially/ v4->v5: * No change. v3->v4: * Add Daniel's A-b tag. v2->v3: * Add a missing blank line. v1->v2: * No change. include/drm/drm_atomic.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h index ac5a28e..76d8dee 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h @@ -912,7 +912,10 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p); (__i)++) \ for_each_if ((__state)->planes[__i].ptr && \ ((plane) = (__state)->planes[__i].ptr, \ - (old_plane_state) = (__state)->planes[__i].old_state, 1)) + (void)(plane) /* Only to avoid unused-but-set-variable warning */, \ + (old_plane_state) = (__state)->planes[__i].old_state, \ + (void)(old_plane_state) /* Only to avoid unused-but-set-variable warning */, 1)) + /** * for_each_new_plane_in_state - iterate over all planes in an atomic update * @__state: &struct drm_atomic_state pointer -- 2.7.4