From patchwork Mon Dec 7 03:20:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 11954755 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70B49C4361B for ; Mon, 7 Dec 2020 03:30:56 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2669522CA0 for ; Mon, 7 Dec 2020 03:30:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2669522CA0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iXnBGG8cc3TL72atcRUNZVReX2jYev4B+Ti+q2+4rkU=; b=K+cmxliw1OYyXnMOMaprC81vJ W6+6HHC0+z9T1KQoJUAaisagkrKC3jFTsZ+XFel0hNPkXmCeCSCiWlSY08nu6KQOXJ4Lf35S4hDrr P32W0Mx9bbSIgaAi/SdQL2wvpQo7Jj7GvJ/XJADju4iJ+d3yfBZfZCXYUZsQUjwOFIUf5ARu0pajq Bwu4Xskc7f+UNEx3GRA1/IPPBi/uFBjz1V2cNiAnRWBtnzqese1qnAPv1mJCD81XQ6R+YqE5EujlB M9dGL4JUMyDTt6Pq4DgjSEwglPtv6AB7SkTSsuPFpLfR4UizAaeHMsNgIsXI02tbgkRJhmqOkaGrk gYt8h49zQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1km7DV-0005zF-3N; Mon, 07 Dec 2020 03:29:37 +0000 Received: from mail-eopbgr70087.outbound.protection.outlook.com ([40.107.7.87] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1km7DP-0005xD-LD for linux-arm-kernel@lists.infradead.org; Mon, 07 Dec 2020 03:29:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IOM96QZcgeAEPGicwH6LMRbwkCIwRrkN1HJPT7dSaDp985lrJtfRBN8+Ib8RDpMEKuD46Jxyax6nPVcPbujzjaN3+hlz1hivPWD2vBVVldvD2i8wt2hCM49X4Pdb9TLy/5j2EsPYFqocmupPemsoNpg/80NkGswuVnT4mr9y8tTbVhVZynJjZFIh06HYALsnBSUbBc2z1ZyQ1uCVPw1DYWHSZumhAvQZoevmI+UmamxE5s7LtzhgN6ZiY5B4jlx3yu2eM6V5h2BpJYAgq++cym72gEkw6ouwzvK6r3zWYS7RhpZtjifie+JyA6jou7fe/6ANK9vO0sQY7pNvwPLgbQ== 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=JL7Nxesg7WWWHg1Vc0Qj2sVK+AtQdmWw6DZRerFjmbk=; b=UmNVJ5VOt446GJ5znsGKXseC2wb+da4/BGNPlNv4dLFCmM++ALmiqE37psG7X4TPzRjHVoKnImf7RajcOiFkOBYh9XoaR2YWPIs3evOyNk8Rzr02HAkoQW7+oPewhSYqar7tJwhYmgiifE2AanZSmeG1I2PTHIlukO2QquEDZIUNMA9MnIEBLorucWEWu0CFUPqIU9TY8d3PB754VM8Uhlw+1goIOQpm9qWFg7TPJ07mmPvjB8CeFTk0CItFkW8zUZIxmMm3AHSJbp3NUnJTKgtazplDkrlk5db/QRgxKJ2RKHemlO20N3TlcEDp4w5bfxwmUc7Kihz4Sa2fCvOfHg== 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=JL7Nxesg7WWWHg1Vc0Qj2sVK+AtQdmWw6DZRerFjmbk=; b=A0IvkBj4R6LLkbmPkeYz/2yyOl/u5gCBL4j6DGZ9j9E/ojzyFDmW8mkXzQ/PwRGn4BZCe8l/pHtsrrh+c+y0x0mDQc1J8ohH71EQNNsyZmsAPpMS0q+3Tv//wMyhrFK7HQdubltvii2NOrWVjOnOC6sgkKW0wVBnRswKnlpo1xU= 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 VE1PR04MB6349.eurprd04.prod.outlook.com (2603:10a6:803:126::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17; Mon, 7 Dec 2020 03:29:26 +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.038; Mon, 7 Dec 2020 03:29: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 Subject: [PATCH v3 4/6] drm/atomic: Avoid unused-but-set-variable warning on for_each_old_plane_in_state Date: Mon, 7 Dec 2020 11:20:58 +0800 Message-Id: <1607311260-13983-5-git-send-email-victor.liu@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607311260-13983-1-git-send-email-victor.liu@nxp.com> References: <1607311260-13983-1-git-send-email-victor.liu@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: SG2PR01CA0085.apcprd01.prod.exchangelabs.com (2603:1096:3:15::11) 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 SG2PR01CA0085.apcprd01.prod.exchangelabs.com (2603:1096:3:15::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3632.18 via Frontend Transport; Mon, 7 Dec 2020 03:29:21 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d73b3829-3fdc-4c22-a93a-08d89a604c79 X-MS-TrafficTypeDiagnostic: VE1PR04MB6349: 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: pfWxtu5NWM4cTN4A1CYm8FUW/WDwuoNygPEjb6/wMYhd3T7eMFk20PIJyC7cPNltgQZF9A3TUuUG6BXmRZoDJfHGgKeS+VhRusuXdMSUPezrG4EuLkjeNldAAvYBmI+VFYp98ceECM5dbhnYdT4pm6gtd/NFR+wsAvzWLQXFfepqyQSnfn7zv84NlEjV/AUKVu9IJaCfsSLWN8sQcjfZcPMvA9lvXkUqxYdfbQbge+Zi8NxSSp/1b3ktbPdPCxo41WBBUCZoDM46Y+d5KYnyzv2YQp87h7i690M3VHgSLhTQ49TRojK+HVOSkIh1QsIWqRxTe0MpdVjI56crYCXZmEzNoBnBCxM6OSFekI0ut4q1N4urKhyGaK2lWaV6/CLM 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)(136003)(366004)(376002)(396003)(346002)(8936002)(6506007)(6512007)(2616005)(316002)(52116002)(26005)(478600001)(69590400008)(16526019)(186003)(6486002)(6666004)(4326008)(2906002)(7416002)(956004)(86362001)(36756003)(66946007)(66476007)(83380400001)(8676002)(66556008)(5660300002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: tMyO6jk4gAM6VaRuQUzR9cAeph5uyDbW+uXn4SaCXL5XgOVGItisSwW8iUgECUuwQIK1cFTT4sKVxxmeTbUgpbG9X45wrmMKI/h3wZDSw5lGA5qax6DHS+fF1JGeB0TeAuF0+6hbTofHLda6BCMy69ZcyyhjPNp+n8ZH50lFMEK9vyODtEOB49zUZwJfosxQ9yYvtFtR6eNFxPznQvpU5kSZjor9ao1ejZGZ8t/ZBZC1ClCFzYrXheSPMZOlRGXAtCpfYyqeFTBB8M8Iwkq8v5FTxetuUMkOWNkeYn9c8PRYmvPHVWE/mV0xDpO/m19qkknC4VHnR7gL/Hl1fiZ5sJbmFqBuhWQi0/31fIUL1FmUCdIIiL/VkBSmbUTSIvj5Gjt31GOR4EBOmqJhNpiRZsv79J3QYcvUJNDQkE1Nxi1I5IZm/6CCj8h8xE8pDW2Y9/jzjXuBH9yYYVr2RRZgsRty8GtGHEeP2g0Dcqzil/txyt8o06mBfbDwQ1G4Vm1s+4QhCZleM0kKxl/4keV7BG2xleA1kP7LtLNbJOYUcB+Se4xM6FFzxuG4YV1zV7L3m6fvNuFaeiO8qp+CIymxYMkhBKj9zcuhtYRfQ+YVqHnbjyKnOcMzdjBabK5jt0Y/0lT9o4HQRCuluvLqMxeH2qV+MyLWuM3EQQ4jt+5gE7EOuBBWB4R37cbYuBxxGwHjL5gZujFDKUT3QiW0Ijold28iODtdCiv0z3JbGMoumPj11c9LiSN4neZ+43tUk6VDgN3GBk73WA8qfJ6LfovKTXLQzpHXqL3uwiQKQv1fMyM9TytJKPdL0Z6fl/2da+WDFFGrdYlQA1A8zYnZy0UFSKXwcbpiub+bisv1Wew89ERhljE1JWh4tDC3IU2ESvXLXpdRL9MJ5lrlAfexpc+2TpL1b0EMGWNXjRvFhQE08LZmc38F/W+lBhxsNIynmPYDRSk/ZloR4AXj9KIDbXXWWd+lhIOngN//aiJ46/1NSrcwlriOI785m92JFPbmAFep X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d73b3829-3fdc-4c22-a93a-08d89a604c79 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3983.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2020 03:29:26.7152 (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: yIJ7ZnIHPE3gvY6HGKEdc8y3E6QTxTfBLy0VEQOdBUN4ggQ2zIqfVXgLsF0VRTgQucBfE/xnMR+d+RGlzGFrew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6349 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201206_222931_772426_F20E052B X-CRM114-Status: GOOD ( 11.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: p.zabel@pengutronix.de, tzimmermann@suse.de, airlied@linux.ie, festevam@gmail.com, s.hauer@pengutronix.de, maarten.lankhorst@linux.intel.com, mripard@kernel.org, robh+dt@kernel.org, linux-imx@nxp.com, daniel@ffwll.ch, laurentiu.palcu@oss.nxp.com, shawnguo@kernel.org, kernel@pengutronix.de Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Acked-by: Daniel Vetter --- 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 54e051a..2e087d7 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h @@ -888,7 +888,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