Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4202574rwi; Mon, 17 Oct 2022 03:03:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4B2pdY2lD30WBc1TonVm6L57kN7Xh9241ruH4QkD7ffecv6AMCWzLP/ahBZImUu+8uFD79 X-Received: by 2002:a17:906:5d11:b0:78d:a41c:6a2d with SMTP id g17-20020a1709065d1100b0078da41c6a2dmr7916153ejt.215.1666001023618; Mon, 17 Oct 2022 03:03:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666001023; cv=pass; d=google.com; s=arc-20160816; b=i34+Zg+cUIM5PtCFIz4WeLslr+1Yp5mA58Iobr03ElgorkB1neWfJBcjkFnM3VyBqe BySCKJtitCstccjd5tAJsms3KFX5VluTXcoflAvxenXVPrR9KgTJx6cu9On6QHAT8U6l pMlHfobEPT8gL3Ic54zi5zW7Mq5EmTvARklCP+G20nuTDEXO/mNnJ0UR+3wsn99L7WC1 Yosc/Sm4U6UIrMAB2K/lr8I3hcseekuIF+0mSjEfvgoGq1B/lsJsBRVxNK9CXuoSs0hu afA0HouNX+hUM6Iz7M3alrkR6QYDuEt9kO+R2Wc2ZckRt1czi1eD8hvJNwTXGAjwx4rC gTOA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=37HLJsLIfcnsT7QWqQsCzE45ndZOh5JvUcXgWNXWskI=; b=kTlHDRVdd8stNknwYWPv/jIcJHdXtDhAR+rQxjWTbco7jIgkALUKsr19Q8uugypXjS EAkleg+wdOLCpqAMRuZlkbIcLU44C1jgLNWwbxrbk9/aGUsZS/7jmavY3UqLgOGpzpo0 u508sVB3o43LjjSKSJBXH/KHAVCuEPLKbEA7BrMXRTe0G/VZT9niLvCN4ik5uc6KMIdx XrmsbV/h0xFfKhcHFYmOQeb3K4Ft1jRlLcRtl/8ynSFc/mxyAB9MTmfHpH3cv7IL28FQ H6Ga4If2o04LL0IOZyTtrsR+t2Zhue0WElY9pnzCRwoKkrEUMYmFxnl3/M7WojSVdbVk HqYQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=D6mZ9cxy; 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 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ht14-20020a170907608e00b0078a00ad1e38si9027502ejc.876.2022.10.17.03.03.16; Mon, 17 Oct 2022 03:03:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=D6mZ9cxy; 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 2620:137:e000::1:20 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 S231272AbiJQJWr (ORCPT + 99 others); Mon, 17 Oct 2022 05:22:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231265AbiJQJWW (ORCPT ); Mon, 17 Oct 2022 05:22:22 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2085.outbound.protection.outlook.com [40.107.22.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AD7218E1E; Mon, 17 Oct 2022 02:22:15 -0700 (PDT) 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> Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: =?us-ascii?Q?C2gV9yX7hbJqWbAxhv3aJwy0om7NUekdI7zNCSHMyCJUtUc3QOKXVNdp0Thw?= =?us-ascii?Q?ar95LEU03XW51UL4CyPbSOWGx3Vez9mCuqz8gjpGDxDvQgpqatxpr0FYU78M?= =?us-ascii?Q?ibmx5Wq9YuIQQvc2qb3oSqc9jPBI1WCtUX1ia6d7wtz1yK+f91NAPKuA5v3J?= =?us-ascii?Q?bBR/QI2bnbucRZLrjiIhe2X1mevB2FdPL/xnxsgNIImpyWQF3PcopN11qeeC?= =?us-ascii?Q?2MRjy9+ksY4jGgoNqTN42upuRv7FxEr9/JQd2HvuwDKixeQdC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pluBDNpd8WhzXlbsSAWJd32ipPnBk2BoOAJgZIMxXVO5SDx?= =?us-ascii?Q?6I21S4sFLumDi386cVGa+SfU53U9ggYLe1YMI1gsqorRdB11kLe8c/PAdvE/?= =?us-ascii?Q?0zmFZcCoYmKP/Oo/9rk3jzYU3CMmD/Nj2TXe5r5Y64RH6k28Q4Yzsx1qKC4n?= =?us-ascii?Q?YscDuf1CDTQ18BJCNI1lHDq4E3ufc15WZGpn64sseptEVhPtQjBFLY35l7e/?= =?us-ascii?Q?Ev3BmYRMXtPMkvmMUJUTIAS20jcEGVzV6GRck9bEr4unD4Kb0K9Pd/fEBWwb?= =?us-ascii?Q?m4bLA3LOfn0u8xTkVyuciAKvmZwD0BbTOlTKIyHfkt6V8D578cLhomu5tTYL?= =?us-ascii?Q?NGa4u5uBPWASJChe6zn0MJrDot4Gh/r4L1QZQ8lEGg93ULdOBtHLz9NxoySu?= =?us-ascii?Q?GIs3gyKmt8vpBI90paXBT7dNJW5J8ZvOtCzpn3sn?= 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 --- 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 -- 2.37.1