Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp23021pxh; Thu, 7 Apr 2022 12:48:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8erHuOYoVr/kTyROFre+NoAcUj9A5mVXBfdvQ2KdZYLXGY4f1TBWrsEWThiAlJ0xTcnt9 X-Received: by 2002:a17:90b:3851:b0:1c7:80f9:5306 with SMTP id nl17-20020a17090b385100b001c780f95306mr17574582pjb.207.1649360934320; Thu, 07 Apr 2022 12:48:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1649360934; cv=pass; d=google.com; s=arc-20160816; b=QwD3EcHKlSAMFR9kaop0CBoMLBWBEsCYC8sR0HeIR3Lqiij0BMaujJswmOc/U5BHAT aezUfvFMgkw8jLsVdbLAZ637UXtLzE1w/8r0CcZqM5CaFVlIv1WWO1XJhuCPF0i6MpCs CmaR/79uXqdQKklJ69Po6hwuGw77TXT6n8c8P5Binwv5N9rcrlXW932BYkXt1rpVtxH1 3ZuH7T48xw6NHmByXoZUq9vm25P6DY+QvuasqK5YMlxW7YArn+lUXOJHPCZ8M5pkGGwW YzlxkNWQodPBrjQzZ9p/CRJr40ZTXn7cDjeCOL6PoBGN9fP5MAj0wBPtxxTP4vbj6RL1 b8Hw== 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=trAvGYKqF5mc2Gtm1sEWDRW8EouZa+DVV5JCesZ09xk=; b=v8Drg7l58UuZGwT0EsMs5PF9wXNOQM0RhswU73Tullrxnbde8kPB2ZHSJ3BA0H3k7b 7nsUp2eGyNurknIkoREhR7t0KWhmJvAQzRCSAFCiJWQ42JVJjOImrakS9hQtW5KLLpbI FY1vj+RLhTfsot5ETbqQzF/CPzdahfV1FNB8+i+rbU0ujONEpC9mMQMNTBM9P0A+aSxl 2i56OMdLHsghwMmCyOOzK/TiOAXmfULhmCjyNGtmh9vmcDWu+acq3hH8EbOWengmm4mN 0JXZHtL58+UDviVjYsdjv9jln9Wgy2B1ZeiOGb/WX+yUxYhkr5aHsAjmpVy1z/cE1Msu 0GQw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Yag9UdqG; 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: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id o18-20020a170902d4d200b00155e153b8absi583434plg.482.2022.04.07.12.48.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 12:48:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Yag9UdqG; 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: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 31BA7223236; Thu, 7 Apr 2022 12:21:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243606AbiDGJNq (ORCPT + 99 others); Thu, 7 Apr 2022 05:13:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243658AbiDGJMp (ORCPT ); Thu, 7 Apr 2022 05:12:45 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60048.outbound.protection.outlook.com [40.107.6.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DA671B0; Thu, 7 Apr 2022 02:10:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UUuoS1QMGiWjyqweKtObBQJvfl6kfrYKAFEXdM6z17c37U3mBdgur6lP8j1p3gdp9KxVcK9cBYokg6MjvEG5v1H+UcbUo6iKPDZpjj7DsreKdbR4e34M+KdsTK8ayNZoifCNP/fQqFU9yhH7ycMy7cKARFLshyH6z0Um0StavlyfqGG+oXOYWX6hYmiB1cyP7OsJRrhcewZH285AhIh/QQOwPVLm5fGIFcePj+BGgHgnbfUDdRmYr/IA5BhpjjFxrRarv3AU6b7sjPS1iZa2Teun6HO3OCAsh740v0hkSxf6mOGmRqlPnSsRbRCAb3qH19YlESCA1n/UgKZUOSi8ew== 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=trAvGYKqF5mc2Gtm1sEWDRW8EouZa+DVV5JCesZ09xk=; b=WzDX7sa2/H1yYxd68IbZgar/qZ253xJkCZRLLcD9Y8Mpvc4OVGHYHom4BCD75eMkkvgpqKo9xbuqg2vhNdvSdKiMoYHXW0Uq/+S9PYq/h+Vj8MEr+cLAS0AkGCwPMXW1Zc77KIy7WzXuINJ0HENAXmnibA5yObKoo+VLAnkgMKT4tjt8SrkP4PY5/OG+w4wf5P5ZmdML0SesrYlkC8xXTwfk0xv87CqCnpWH0YXZvQV6nHaSrrVAOPkeh1kR/A1cID7me7u2r7UyVihAhFpWtqWdBTS9+INpo99NL40ro5oy09uwMlyhb+CvHXuJTfTU5Qq+PukGqaYvsYi/dhq3AQ== 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=trAvGYKqF5mc2Gtm1sEWDRW8EouZa+DVV5JCesZ09xk=; b=Yag9UdqGLXKuMwRogG3/K0d5nGo5C9XPMnRFI3s9MI7HLX4nh4fliFxx8jA3sVRrYQM8/06uoFjlKYLpFayYUcX+VSxW+K4sOoHbgVTO4aiCC0cPBa2n8b76mo4arG3sDx9k2QzwBxW+CiS5jZMGK8ZzYJKdTNV5vYGym5QzO1w= 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 PA4PR04MB9344.eurprd04.prod.outlook.com (2603:10a6:102:2a8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.31; Thu, 7 Apr 2022 09:10:42 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::b09c:8ffe:8e02:7387]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::b09c:8ffe:8e02:7387%9]) with mapi id 15.20.5123.031; Thu, 7 Apr 2022 09:10:42 +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@linux.ie, daniel@ffwll.ch, robh+dt@kernel.org, krzk+dt@kernel.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, Daniel Vetter Subject: [PATCH v10 4/6] drm/atomic: Avoid unused-but-set-variable warning on for_each_old_plane_in_state Date: Thu, 7 Apr 2022 17:11:54 +0800 Message-Id: <20220407091156.1211923-5-victor.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220407091156.1211923-1-victor.liu@nxp.com> References: <20220407091156.1211923-1-victor.liu@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0021.apcprd02.prod.outlook.com (2603:1096:4:195::10) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 963bcb5e-8334-4080-74a3-08da18767e04 X-MS-TrafficTypeDiagnostic: PA4PR04MB9344:EE_ X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nhTVmcIeZlb6AgQOJBcto6yfsR2tTQiTvRNti4V7/aluECDHHfluSr3aNNoADv9/i9vpM4bXh727kPMywVv1JFXjMKU+xnWJZH0xGDTDXvIAJvLiqid4Ft1JAAvI6gvyDuoSTKqUmUdvt6/eUDdzDGTR46fm+H1ZDtloqMjv/l7ovh7wLUIERthoZa2d0DRO0qNo47AZPkMKjXhx/S2cHU4i/vqe9Y3tn81L67Mb9+3mvk/uDoZ1WPrmdsf5xl+w4PSsZQj5OFOI5FytXJhj29EruOfy1jhPoI7AJirSk7PWY+VQJJWCo9jWPcao/nQ4iV7X+eGvH4FWvd0nWa9ChpknV+AsBk1LRVtMrBiSetXJhtIgpfTv8687znTa7cZBSIQ5WX/xz9kczokHaA2p1a8mw4IqzbT9gPD8J4ukh2+7/OYSMS4xfqCLmj3vkKhYDot09ZXsHE5KEUJ9I4gl5l+xFSJhCtxSt7rM3KH2Z/oVKkX7zLCzL1t3gb1hCMjoS0F0Dx8VvJCHe4KJ2IDEJGBMfB6FZ67jHI5/O/4dmbVqpDYEvWS23L/rI/56jHAz70RDuzAy5JjxuM4IhQAr/yvtiml0Vfih2Yoc3wMjnkAiWpJmx8c9sZQEak4sSgQQg6ePLfB1kUi+MjDZOAuqY6TerARyIjBogjdmaSoutqYrd+ARJqxo3hgRp0lNlqUH+qFxKCS50k8uyIcfHYkIuw== 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:(13230001)(4636009)(366004)(5660300002)(66946007)(6666004)(86362001)(8936002)(38350700002)(52116002)(4326008)(38100700002)(66556008)(66476007)(8676002)(6512007)(7416002)(6506007)(2616005)(83380400001)(186003)(508600001)(6486002)(26005)(1076003)(316002)(2906002)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?16grXdPZ1QrCynn/yVO9a7XTUGDmSLOQpEImx6SU71x/PPvcN1FQ/9iizPiz?= =?us-ascii?Q?xbYwR/GHWjjXu10/svayGuIDDVJ/RsvMDG5MK48PNulcKVbQF+O1Ku+JuR1l?= =?us-ascii?Q?z4qjC2+wGUyd5QmgIqIslAjkXEwNK3o1aypwxL4zW20kZ5kjkRM3WRx7WiaQ?= =?us-ascii?Q?5NeV/00F23CQD/Ui9cFfbmVadb35ACYT2RUBSetW7i3+nhKntwwetVeXzmU/?= =?us-ascii?Q?yZBAyIG3cTDEG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ascii?Q?C5jfDUDIZ4aAnbNijBkunvlLGXgqa50Q2w2l/70Gh8i5px5qbL8PAv1CnRnd?= =?us-ascii?Q?nGp2ZByUzdpP0rHs9fJeEcX/BbUryKiTG5cMSTqddaIH/xRrBRxh6n/mzcgx?= =?us-ascii?Q?90OT2iROf+vH2oPOqXr/nfY4iozD1IO6nsxCnZJCwOQ2drYWSTpbYwO6M0VA?= =?us-ascii?Q?8mC8dNQgqVVren4x1yVRQr2N+PwUNfOjMNdNE2in6erkjRh9GOexgXJ5e5QV?= =?us-ascii?Q?FJhLyNR3ep0uu2lhbh9MpwpdWDA7lFaYarT0gQrsD7aPOYrBFKZyuHNt/eXi?= =?us-ascii?Q?PBk/p8oEbHQ6WaWp6EUU5EF+2+amL+RuZIK7BoQogMeswAjW+OzvK/Zmg34T?= =?us-ascii?Q?Oclog5eS0aopQMQ+quL2WXiqW+2kUG6EiQ8SepWYtAs+F1TQPgSJvubGwr7F?= =?us-ascii?Q?qEB+PgEemn3p4UK381eeE7H0Fmg0ycX4YWWiaiKJefafhQTjv/xLoHZJ7XR8?= =?us-ascii?Q?VebPWUG/kbL7+yZyDyRecuou6UXXIrmpqqjREqcCa3xIlYmt2E/B2e3ehnuu?= =?us-ascii?Q?ssApGpQdtKIjtBod11BM1x2hkbcLcziwGYWfgVr6G+gmmToJd6K/YXc44MwG?= =?us-ascii?Q?fvDZpde7XQ=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 963bcb5e-8334-4080-74a3-08da18767e04 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2022 09:10:42.8265 (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: pgp+wv3Ir8vSs/1xZjKuIx4y9FQqnHAoZqzvvixsED0EjXavmG6sChvkHb4ZonYVBqZEzK9I/ed2AuAPHbxuNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9344 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no 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 --- v9->v10: * No change. 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 1701c2128a5c..50377c80a039 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h @@ -928,7 +928,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.25.1