Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp188811pxu; Wed, 2 Dec 2020 19:20:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJyb9fj7Fh5M/mWMZ2flAdIip7uhZLnvTa9xVt1Iu2XDUVpBvz29HeTYtxA/wcpQ/cLUY8zz X-Received: by 2002:a17:906:7d91:: with SMTP id v17mr804222ejo.522.1606965642610; Wed, 02 Dec 2020 19:20:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1606965642; cv=pass; d=google.com; s=arc-20160816; b=o1ExengwCZgn+x9bpddoPfHsvXgaCOVNzXeE6zNVEFrTQ+e7kN3zsLC+usEIxEAFm8 2ENivdDqhl+wSqdpkjVybs/ucFKqWWETlHrhydPsQ5LhWPaFYDuBULD3vEQcNj6HFu5E WxhXcGKMbitB51f+M9rXxfcxC2+uXI10wXQ81s+iTPfZIXpd44KKni2LBrxv5zrOl+Os 6AcrO5q+mtMCO11chBS7x9wKCXcaYKONtc2tl9qYVktBU9fopyoMbqfTGtKjBA3pAnXp YTyDVqqgX5vRuEGKSwvKTH+LoF3+ck/yT4U48q71LSTjg6StFXqk7sqmHMqjz79u6GBF gMTw== 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=D3PKTqREgG55iO4KJ0iCZIh0ksgOic+fsHolhYkcRKk=; b=YG1Gcdymd0RaPC9vXhkJZNzPLdJ/UCwj6kVNJ1zHGtxjBX0oZNqT6WuYqESLAiO7z9 i/6FclZfL0fZvhCB6fsNOGeR2KyPsq/MdXSf0lI/yELQKIAQ2YmmKCQrQetG3elvccu0 A7oIjC/mKlvGKu/ZsAZkaQ4DvjbJ715vH0eG8VQJONxwZZAEE/khl8moam7pMvjt3PFI s0ckxOeu4YW2Fu90ad8TMoCJ5KpUeOogiAclypGZrlZ0tTbpDc7K29QcqHRs62DFjq/x pum41tqlFzY8VLngA4K8lf8HnG7brTLyiU+mEU07GxZjKsYm4Zhtg2Rcx7yC6FmOlwfJ jAVQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=oNIXPkV+; 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 cq10si188351edb.140.2020.12.02.19.20.16; Wed, 02 Dec 2020 19:20:42 -0800 (PST) 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=oNIXPkV+; 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 S1729620AbgLCDQE (ORCPT + 99 others); Wed, 2 Dec 2020 22:16:04 -0500 Received: from mail-db8eur05on2089.outbound.protection.outlook.com ([40.107.20.89]:23489 "EHLO EUR05-DB8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728071AbgLCDQD (ORCPT ); Wed, 2 Dec 2020 22:16:03 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PXzxF0QrxiaF2WXaRLR/thqPDmO9HSX76NaeF50MZUOuzCGzSkb5JHag5cqQrVsgKQd04qfhFFwcOXDLiNlbs2u+Nn1vEXnDoJRP2Ns7W/GXzJIJy+DDvqFvR7rfebiWmlKCvzKCvvSNLUT1Kt0hsZAmz6hEcN+bwb8aGaEDGGpBRZIP/+3zdhW067NeRUNgF6Sqkqhs+S+DZCv2GXEcA26Or1Z7nrIjTb8eXta6QPCMduhNSzGYsvOgVZ3TS+7VdG5OiIrAHw2MGvaZGoINuFcr0CoZx2m1/ate7Gxd5UmkkTbekfVA+1R3rG21rhFXWvxlazc4zqNXjumuHKn9UQ== 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=D3PKTqREgG55iO4KJ0iCZIh0ksgOic+fsHolhYkcRKk=; b=J3C9zXGmtzlhbrdbgWloreBcBCoXrEcrT14LCyRtKWKMIQq+kJBY9+IZlaZ2h4c5YzZICblrK3TNvcVZOB/tj8SGclKp/lRwbkdYchCYkv/c7eWjAJjSxWTf1IDEeJwBSFMlqpbymlckHtcmITr8anrn1bnIpildtjKgD2WKzNdoKx4klUFKR8Tu5Kwh43pyrHtP0D4giAG8lrOhxv832HTYsMXsv9RGOBT3xS9iGyHbSfBUGx0eRmeGaOsGO6gTe+HZV1XTv9HfRhxHEaQjAXn3Q1L53+8L5CbnigNDfeQVKczobikvP9QOfBMeuA3I2wNKZ34No3MubS1HeWXU+A== 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=D3PKTqREgG55iO4KJ0iCZIh0ksgOic+fsHolhYkcRKk=; b=oNIXPkV+8dpxiDS7Mc4RkVe5xG1CtHKH+KLtIrVjgZaeXUQMBToayD9hBkYEim00uvJ5QtIOlW+acC+JUQoEUYlmSfhsH3jCysZS7KYuVu2QSkqJs37JW/Pz8yAMc/xE9jk6uMjm9fxoaKV8jZH6HXn5GFtaA3jahSI2dZY7Lbk= 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 VI1PR0402MB2879.eurprd04.prod.outlook.com (2603:10a6:800:b7::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.23; Thu, 3 Dec 2020 03:14:37 +0000 Received: from VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::dcb7:6117:3def:2685]) by VI1PR04MB3983.eurprd04.prod.outlook.com ([fe80::dcb7:6117:3def:2685%7]) with mapi id 15.20.3611.025; Thu, 3 Dec 2020 03:14:37 +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 Subject: [PATCH v2 4/6] drm/atomic: Avoid unused-but-set-variable warning on for_each_old_plane_in_state Date: Thu, 3 Dec 2020 11:06:29 +0800 Message-Id: <1606964791-24927-5-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1606964791-24927-1-git-send-email-victor.liu@nxp.com> References: <1606964791-24927-1-git-send-email-victor.liu@nxp.com> Content-Type: text/plain X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR02CA0028.apcprd02.prod.outlook.com (2603:1096:3:18::16) 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 SG2PR02CA0028.apcprd02.prod.outlook.com (2603:1096:3:18::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3632.17 via Frontend Transport; Thu, 3 Dec 2020 03:14:32 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: cc45f134-ceda-4cac-ab46-08d8973990db X-MS-TrafficTypeDiagnostic: VI1PR0402MB2879: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:229; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CKiL5wttPDphBg9GHwEu8DLSuZfrLX6z6/zWxZWzT7qSl5TseFLUJZRaxkHUS7yuUXpc011WCXByl/TljGvdRKFttOvsV5T4xpt1iLKlled4gOtEqMLGcHi8I5pJ+Bvu+S3QbFzjvpxirxpsnMzegYrdXZUUm9yYOJXqPliDfrWXoq7m996CjyUA8HU1hKV32j5rlYpfKR25VOujD1nk0tVlivy2WB0mwSMqUBgivZDWVCrQ3+bRW9qMUunTp+Z8MwuFpOPo80DMu7e+QvQ7PZxbkFM/mBdF147z/OoGnezz+yb5ti1f7XExko1ot3wC9kHB3UgO+zHl6IXH81dxhjy5iOT4FoXOmxkuV6XhnQHY4nPTlACKEUaXpl01N4ic 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)(39860400002)(376002)(396003)(366004)(346002)(136003)(8936002)(4326008)(186003)(66476007)(6666004)(66556008)(5660300002)(26005)(478600001)(7416002)(6486002)(956004)(2906002)(6512007)(316002)(2616005)(66946007)(8676002)(69590400008)(86362001)(83380400001)(6506007)(52116002)(16526019)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?DiOrys9zLxDSntHgXyAWq41ftjSqvVj78ie68OIAgCzdLPi3LLWJKsKKcYEN?= =?us-ascii?Q?Q89lRvns8zwysBNZ4ORdxREAd1B0j/VyPCJyFaaWSljP94ycALXICukeR1+G?= =?us-ascii?Q?OSStxdv2BfmgZfcLILS0u+j4kqofvFMOKS64tyT1jkNv2WrtV+IV+T677v0k?= =?us-ascii?Q?xcxU6K05X4XH8zGbK1tRWAmJ0HZ0d37dSmTaun+Wk31LqFLzoFVzr8LNgHG5?= =?us-ascii?Q?bW3nERV/paLQbr6rTpbB71+c3NFbdBwagQRJaM3StW/lj6QCqqXaeblAVqKP?= =?us-ascii?Q?ENDksVnxLc1lz0Xej0XLH8CWgVnJNQWGWuDqgAQDmWGFcaByaI6wAh04cxMK?= =?us-ascii?Q?GSYxR/4wIc+a/MKz8nyXMujsJyxi70H4MmsLK4Tuvvnck7c/S4slbsOu4BAa?= =?us-ascii?Q?GdUkbweitw0Xzuw1DI3p0iBqMaas1f/7Lz1j5jciBI7oyh8Eyu07TQp9JM3+?= =?us-ascii?Q?/DXaKb+YD4ZTJgANoZeLQkBSniToTSG2NeUHZszhMAIh84ELVkYhs37KO4py?= =?us-ascii?Q?vJdsKyGy3z6BmT1SOoqgF9Q6A2qGZ5RwDwDWE9Yw6HLM6o28hoEh58hcJGd8?= =?us-ascii?Q?k4Jh7xwEQOggiF+nf873VTQN6toGegxfJjtyl8R//oUy+aiRuiwkcn6awdDe?= =?us-ascii?Q?Z49IBZu3wms762Iugv8t1LZBeMwg4F6CdpMRr5Li3rVKHUe45KRWnfHRxK7p?= =?us-ascii?Q?2UjgNLDbMxF8ahhTP6G+n11Vu3WuQHgK9KgE/2uM6KPTzQdCGKN256rRDEbT?= =?us-ascii?Q?Kgc7YpoPxq32o1MPaJgRjQ0VSMJn44GF3zusagmaZOCGj/B++GeV1dmBrZaV?= =?us-ascii?Q?lGkNPVwoLWVqZco1q7AD0D4D6kxkUhiD3tfh654F3xK+BHk5zbVHH3GDd53U?= =?us-ascii?Q?ND6vnvwdMD/5Uw9gosvKgzGbkBmt3t2o2g0rx2McHAyvAPRbz3y+r1gfYHdb?= =?us-ascii?Q?mhc8Eqb4qp2yYvFyyY7sVhaZO6/Hv9rCGIhzCd5TO6plWWjBINWsvBiM+N14?= =?us-ascii?Q?GJjY?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc45f134-ceda-4cac-ab46-08d8973990db X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2020 03:14:37.5718 (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: NPqR314q1Xp1HlObP35X6yz4pcARc03vb8vsC0BBrcXMHhevjfyXZg/1axqZHXRktl37q7v7LiZbXStQJMPGHw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2879 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Artifically use 'plane' and 'old_plane_state' to avoid 'not used' warning. The precedent has already been set by other macros in the same file. Signed-off-by: Liu Ying --- v1->v2: * No change. include/drm/drm_atomic.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h index 54e051a..9da1e35a3 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h @@ -888,7 +888,9 @@ 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