From patchwork Mon Oct 17 09:23:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 13008413 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 28435C43219 for ; Mon, 17 Oct 2022 09:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1jiFY036hs+7d5qRSPPwyMPGntS8rxG2nASxJL7Yrrs=; b=aoWcWMjifolY8A aXA5vL/vQ1w97Ym5Dsq6gJM8nQy//MP+IQwa6JlGCFm1z7XSzBgrWwc9qbs3fgvYlYTSEg5o28V9N RO0GwdcIkRxPUSUkzD5H+UOayopMXIcHJrn480mIoEI8pbB6cNDWbIvX8ZkDnvuJIrglVOw1pSvjY Igz9VIo6PHysGfL+mG5LaqtHYBKK4trFgEfADZzM+KFoNAZN56diLsZkfeBtdJgIZbYBBxlUp5Ct1 4HCSVNXt7tVgjEHneq54Z6ntIt6siiAS+XW626w2qfUg1pZVT/mYvIvUDZJj+NkUt7gjfya3nE+Yk GWpHhy8AYXKk8BaDyjJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1okML1-009fbI-5w; Mon, 17 Oct 2022 09:23:12 +0000 Received: from mail-am6eur05on2047.outbound.protection.outlook.com ([40.107.22.47] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1okMK8-009fDu-0J for linux-arm-kernel@lists.infradead.org; Mon, 17 Oct 2022 09:22:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jZB4Tae0U61zLcKcj1y84ZWo3zxIT97YTW3KrvDFImlTrx1G30ULAfuArp5z7SQMj1TKKlcLseqlh5AD5xcHebnuiMGFbSBpLDW04Q76ooJ8mwl1OS3Kh5Xz013v6n4g4+YjeHOxYT5C5fwcdKoCgPOtIsoeyYTVYvKPzxmEW4k8B9jch40if49+Jt5Nn0SEcUj0KbLnvcy2/oVOcrSXA52+LO7BZrsOiRIH1JOQhfcT8qtyaputNTR6JkNymTJ59fNx+c5o6FBCksf8Ku3wwnIxVHqDFybvEoCPf/m1STPsoSO2WgCVGf3K1xsgBGPJN6pTBZCIUn+ahXCbAUDxEQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=37HLJsLIfcnsT7QWqQsCzE45ndZOh5JvUcXgWNXWskI=; b=j1Xz91VTt+ibynUtqKoTJCuDSYGVJKolvrEMaLnGyYs/FKYkf1IKCH9IYXYnTbAsAJzLEIA7HImmsIPCDZC0F6UG1XKqeeqYmoXDW6Xi8nzM+dMUZxuIaWR3WSX4+XsaJEBYLFjvCI7vvS6lJYqpn0shxgYnu1NZObJcSCDH3hcRrIVfkKpP/QCJCmRFHvDqf954APjZ4pkXqNaS1b+oXNCSeIdlFjQjTiL5XlNXK5JsWsR7d/oIogDUSSgm3tsFRDMIBEaIP7urE8ja2J4LjzX3+R5kVGCus52RVQecqYHqkBT7oEB4njcCuD7zMyD/ntE9UslAkd4cHgzO8/4zZw== 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=37HLJsLIfcnsT7QWqQsCzE45ndZOh5JvUcXgWNXWskI=; b=D6mZ9cxy9JHQIYQuJidgG+VBELvPCrmPgAxrg5keGEIhf6VOyoFf+xykqKjNyDbP8efCrw/zzkckvXEGoeb1W2OzmZnyQVMxIgoG9NzwG+Piq2z2l6qTiEWm4Bo8JFQwxogmP1R/VPpBtra2Vj0e5t84V3HJfZ+3iNQJdvTWPyE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by AM0PR04MB7188.eurprd04.prod.outlook.com (2603:10a6:208:192::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Mon, 17 Oct 2022 09:22:12 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::181b:75f7:dbc8:b4bc]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::181b:75f7:dbc8:b4bc%6]) with mapi id 15.20.5723.032; Mon, 17 Oct 2022 09:22:12 +0000 From: Liu Ying To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, guido.gunther@puri.sm, marcel.ziswiler@toradex.com, laurentiu.palcu@oss.nxp.com, robh@kernel.org, Daniel Vetter Subject: [PATCH v12 4/6] drm/atomic: Avoid unused-but-set-variable warning on for_each_old_plane_in_state Date: Mon, 17 Oct 2022 17:23:06 +0800 Message-Id: <20221017092308.249665-5-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221017092308.249665-1-victor.liu@nxp.com> References: <20221017092308.249665-1-victor.liu@nxp.com> X-ClientProxiedBy: SI2PR02CA0002.apcprd02.prod.outlook.com (2603:1096:4:194::22) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|AM0PR04MB7188:EE_ X-MS-Office365-Filtering-Correlation-Id: 7a14b09a-180f-4c47-2c56-08dab02112e9 X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D4fWrRQsyRE2fsh4vMfMjlCLT0sCLkRDv67NCA+h9DVZW0LJv9TDml8kXyNnHt2iBjYYt8DgE+11AAAyC5oLHnsxxbsTuguIo953XSj6EPCnr0GrQggzBbVQisDymslzPTZ0osmQk+5ibRNdaQ7s7VdhcntxZqMXQROUXAZkz/oF5SxfDZJ4W02NnocSR5gg4PbUz5Dx1Tz1ZRxawcemWvl98JvsEOmlf5rMCfnBE+9yJKpPTHMrawxYxi1LrcIg8c14PPnnyQfQgev7VXfiYPQTVukGbAMuMDBPqsna8aNuPPV2G60x9ioDwCW1OIrIRYzzrlvga4EZ1tN7/bCBD9EYBsn2qraZKtQJEC8V+8ZoTF0M8KSjhdEVDPWv5nkN8Qlnq8tT7zztMSXO0FDQI+I1cK/cGIQGIa0Hphk52FyPZFc5wUIbvLzRkSlXsj9OZGKvM0hg1QqNZ7OqRtC3D9P5p+5Pw28yPZbUZoqPtivQ97qtBp8f08sqcKpID4V7kd3OGIJ/puqeAh5z4/avBRbZXgqyRS+Enxew7n9Dkynq3x5V+3r5gOkalAKJUx6q07LNRG9Bs7LcmQuEehBNCwgfaHOYCK1Qu3OaUnFM2mttoxtbM93t0S1A/zsWrXWLBbqtxgZyvOKI2yGPKDty143YMHyQjvEt5dceLgBJAF94yrT/E38pmWnxirZ0bpZTL+kvaBZviFuTT1DcZIh9irPEkN4GUf0ap0bSt7EdidylnSzlZhntL6XikZ4IUJaARsr2EB7Ay9Xa7bxKhw1OwA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7046.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(396003)(39860400002)(346002)(376002)(136003)(366004)(451199015)(36756003)(38100700002)(38350700002)(8936002)(5660300002)(83380400001)(86362001)(26005)(6512007)(6666004)(186003)(1076003)(2616005)(66946007)(7416002)(478600001)(6486002)(316002)(66556008)(66476007)(41300700001)(8676002)(4326008)(52116002)(6506007)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: C2gV9yX7hbJqWbAxhv3aJwy0om7NUekdI7zNCSHMyCJUtUc3QOKXVNdp0Thwar95LEU03XW51UL4CyPbSOWGx3Vez9mCuqz8gjpGDxDvQgpqatxpr0FYU78Mibmx5Wq9YuIQQvc2qb3oSqc9jPBI1WCtUX1ia6d7wtz1yK+f91NAPKuA5v3JbBR/QI2bnbucRZLrjiIhe2X1mevB2FdPL/xnxsgNIImpyWQF3PcopN11qeeC2MRjy9+ksY4jGgoNqTN42upuRv7FxEr9/JQd2HvuwDKix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pn64sseptEVhPtQjBFLY35l7e/Ev3BmYRMXtPMkvmMUJUTIAS20jcEGVzV6GRck9bEr4unD4Kb0K9Pd/fEBWwbm4bLA3LOfn0u8xTkVyuciAKvmZwD0BbTOlTKIyHfkt6V8D578cLhomu5tTYLNGa4u5uBPWASJChe6zn0MJrDot4Gh/r4L1QZQ8lEGg93ULdOBtHLz9NxoySuGIs3gyKmt8vpBI90paXBT7dNJW5J8ZvOtCzpn3sn X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a14b09a-180f-4c47-2c56-08dab02112e9 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2022 09:22:12.5901 (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: RmLkOZUH7BCgxM5FnFF2aWQYSRIzAOMB5wizWre8QRhMBFpHrp4F1lUnCrDIfQWLImmPkgZHSyeag9s8XtXeQw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7188 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221017_022216_088479_0C1283E9 X-CRM114-Status: UNSURE ( 9.99 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 --- v6->v12: * 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 10b1990bc1f6..bcd6ff9d18e1 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h @@ -947,7 +947,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