Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp587067rwd; Wed, 14 Jun 2023 22:11:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4dCKzQLaD7F07rujqeIauOQADdEfTUFN1Bwh+aCwIdmeiukEyl2M4G9Tt+cZNBEW+8/1ma X-Received: by 2002:a05:620a:8d9:b0:75d:584a:369e with SMTP id z25-20020a05620a08d900b0075d584a369emr17212306qkz.29.1686805880647; Wed, 14 Jun 2023 22:11:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686805880; cv=pass; d=google.com; s=arc-20160816; b=k8oBvQ8lePPx1euMoyIYlNkMBZZCQJqCiefPg+aXPN+eUbOhLCuZX9gfll7zyv/pRo TpC/2dKImP+wtiJsAgCzQL8SePHTlyzFaD6Otd9UCD+MYggBJQP1uCfmVYUJm57icTxg 1Vl80FR6QdkCab92DEDM5LyjYECXE/7+Rtu81ukk4/XZO4DnHbOBLmefdz7P8zcUiNRx xw1yvlj+J0b6PN8RRqppBd2ssCFJXpCKh9ho2hhPiQrLNyszwbhn2re0RLQpiZ2wvT7q w1to4YTFNbD0zqzOo9HMy6ngwA7ob/roIEsQ/sFhGPumYypfe+aI9agQui0KXwqq0XfB Lo3Q== 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=OJ+hFj+wB2UrTRLkTBYFcRNUhFnHauukaAsov7l2qwU=; b=h5HZUso9tbC2p1Jd6ppTaIFwZyu2otrA5eTwm7FbBWrMqD0tueY24lB8LoELnq8wqd nrlSEBOCcaRG9eBlqRiRNnmN3LPglgoswoGQTpoVrszxjrDu0Y/4q52Hp8qoeLmNn+lp 5DPUxX/noxcNqdk1859PRKm+mWxgCNtezfgrPabbUpSlho4UjmP5EW23fb4EaneL4Wxu cUbzMcbLAHfnj9NRIURKMTaUsfUbVWAIXimqB9g5h9oOVxKkG7tax4HJvK6KnIYZLCyW WcnSv4nnRC/yixvcUATMdgljor5KOfvM5s51POydUygFWrW1uwXeHdSU8bnn4gYVE7jr X+3g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector2 header.b="Q/oRgxGC"; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b24-20020a637158000000b00534866eb2c2si11960941pgn.835.2023.06.14.22.11.08; Wed, 14 Jun 2023 22:11:20 -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=@microsoft.com header.s=selector2 header.b="Q/oRgxGC"; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243264AbjFOEqT (ORCPT + 99 others); Thu, 15 Jun 2023 00:46:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243116AbjFOEqA (ORCPT ); Thu, 15 Jun 2023 00:46:00 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2126.outbound.protection.outlook.com [40.107.101.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D44AE2684; Wed, 14 Jun 2023 21:45:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j5ekCV6HJ6iJpq17Iu64gq5hMA+iAej3fFDdqXyC5jXwLy0fFAijGSxk27o2tfRtYZMfNSX87N4D1jrEirWPB1ElmJkNOKPtJUPaFgb6SJ7NYD+53dAMFhDMfirF0CkoneAcnM7kaAwuf+9Cv/0mjOCdqpAOvJp3c/Bbpca5ti5dNvtyfKaACYl9T+QDZirYMeR2G3n1N3OglxtUei1KVKRctjfeCi1zcjmrfyBgxaV27hGWLDjmbA1GEKCSxOgh8atiT+Xcv74TVGLHP0Pftzpgv4I3uqaatVMPGEzBG+qsQcFAz2n1XkGN++uhH5ZZFkc46SoVXMFq7v2WBYs/Uw== 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=OJ+hFj+wB2UrTRLkTBYFcRNUhFnHauukaAsov7l2qwU=; b=AZpcBatpnTVjYjB4SoSawINz2IqS8+VXBg9dWgZayjRw2UwEBzOowRtgB5c9dAe30ZBxuSXF/bSlJk9T/nz6gEUvaREBYjI9EZTxcNkpy+0ClG+dXzcqi0MPvA1+yi8aWpA84GcUJS2XOiLTtPymjiB2gu5BAF5DujaKJTWKWji0qWhQRyjjU8uj2TTvJEqZhpGsIw+gntNe2OoM4mTSxk3yvXgiWblksE9vw58VE0CIKC5g70D6w6boCWTp04pwfplI5yIBThWmBtVJ5h0N5A8KsCcDSZDRRsNNPYYo3ZIsDJr9NySPkl7GqeAQz7TINTwWxqgA4KmPYcL+clX73A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OJ+hFj+wB2UrTRLkTBYFcRNUhFnHauukaAsov7l2qwU=; b=Q/oRgxGCtWExhTY3uq8NBCHnUrlsVNFrkbEKBUxUD7GYpVE4hWnTm0h6dy922F4lW/m7gHRKdfeXqWzMDxBGHKlaI7AgpKgKMQFV0l85GgiKlGIyexAOonxZClAJXe9m6FPSLvE3eSk5CRSqLVlSgWYzTZHB3vHQPh4TJqvmLzw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; Received: from BL0PR2101MB1092.namprd21.prod.outlook.com (2603:10b6:207:30::23) by PH7PR21MB3382.namprd21.prod.outlook.com (2603:10b6:510:1de::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.10; Thu, 15 Jun 2023 04:45:42 +0000 Received: from BL0PR2101MB1092.namprd21.prod.outlook.com ([fe80::e673:bfeb:d3c1:7682]) by BL0PR2101MB1092.namprd21.prod.outlook.com ([fe80::e673:bfeb:d3c1:7682%3]) with mapi id 15.20.6521.009; Thu, 15 Jun 2023 04:45:42 +0000 From: Dexuan Cui To: bhelgaas@google.com, davem@davemloft.net, decui@microsoft.com, edumazet@google.com, haiyangz@microsoft.com, jakeo@microsoft.com, kuba@kernel.org, kw@linux.com, kys@microsoft.com, leon@kernel.org, linux-pci@vger.kernel.org, lpieralisi@kernel.org, mikelley@microsoft.com, pabeni@redhat.com, robh@kernel.org, saeedm@nvidia.com, wei.liu@kernel.org, longli@microsoft.com, boqun.feng@gmail.com, ssengar@microsoft.com, helgaas@kernel.org Cc: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, josete@microsoft.com, simon.horman@corigine.com, stable@vger.kernel.org Subject: [PATCH v4 3/5] PCI: hv: Remove the useless hv_pcichild_state from struct hv_pci_dev Date: Wed, 14 Jun 2023 21:44:49 -0700 Message-Id: <20230615044451.5580-4-decui@microsoft.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230615044451.5580-1-decui@microsoft.com> References: <20230615044451.5580-1-decui@microsoft.com> Content-Type: text/plain X-ClientProxiedBy: CYZPR17CA0016.namprd17.prod.outlook.com (2603:10b6:930:8c::25) To BL0PR2101MB1092.namprd21.prod.outlook.com (2603:10b6:207:30::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL0PR2101MB1092:EE_|PH7PR21MB3382:EE_ X-MS-Office365-Filtering-Correlation-Id: 34955f6d-e823-4685-a080-08db6d5b600b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m8pyY0EewRj8e3wtyiDfrbJhR770R7vkMOo8IPJ/DFgVoIflx8PWF/z6SqD5BsZhlxbRG/uPY7asTDtLIZdJA4ghDZydEM8Woq2lxTL5lk6mlXvXVeUQlgoZsKKcyjVhyAHPp4uXTvZ7LW65ATDrvuSRMW9bqFGiTlcru626bONd1CjE4MwgtYq4NlmfTVOVrD310iVJUK1eBN1CnCxpQ+XdvDCzBXIo/iIqsD4oPm676ZmDNAiyloSjZTXQEWyZ1l2OSQIIKhAESjZ7438xGehQYviPSjJsXBgA5nf6tgNpZOvZMxo9pnOJ1pDxsTqYu8JHYN13K3Y+upq4dFZJKSbMOcuGs5rmiXd98jherCmvBQsbWhdV4Y/m8qWWMrv8TsV3wVmNC1PCSSjugsk0oL84B/mfwkWKcPMwipfOe30jbiiYOZcOHM0UJX2GkGJJa1Xq7MMXwg5KyS2KDnnJege5RfAANxdW/czk0xd9PdhVax0o1OllQdg2x9UPjrXcdBv9nHJ1emCfnYYlZ+rNjFa0ibDVYqBAm8g8DksTvWsW6K/gl4WOjVtZktaSU9SwI6F2NrXPU1BqLsKc9Q7lnDQVj0G0GiMMetq1xlI4cvPByxqBOo/czgYqawL+t/hzJlaYXiawaN2VOUxdmzgYRw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR2101MB1092.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(39860400002)(366004)(136003)(396003)(451199021)(82950400001)(921005)(478600001)(82960400001)(8676002)(41300700001)(8936002)(10290500003)(66946007)(4326008)(66476007)(316002)(38100700002)(2616005)(66556008)(83380400001)(186003)(6486002)(52116002)(6506007)(5660300002)(6512007)(1076003)(86362001)(7416002)(2906002)(36756003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?kystszMxTz2sp2yzeIfJg9MvDVoNiDQWtiOhLyblR5FTPeDeLiAuD9jLCj/M?= =?us-ascii?Q?k3vLlNHvBH1uBeeibtN60L1inZx47f3B5ibdupTtTI5F2VKdsbkqjdWBdDgt?= =?us-ascii?Q?mBnhd7pTiPX3GSH5XhshMhoRNVBMhbOPV3gc8/0jnlZQQUwFWP+PCGUvpUh9?= =?us-ascii?Q?mK6kxY7XV4xaw+PUO6FMIu5oh5e8FRxSdh7yJZjZsVcKKsRdxArSgradFubq?= =?us-ascii?Q?tHQax8jNOxs2e7fRTdjsUfQ7rhprIIsoyuyn/XzBa/LTwUL5zGHjuWn7Mkq5?= =?us-ascii?Q?FIAv0lzNPUHz77zQ4z3zXqRMEoNzZYqX3gbSgCawUorfH8Y6knhD5MNWCYgZ?= =?us-ascii?Q?K/nyF/uFHrUBnVW5J8FF+mpSypOxrqKsHkpey1x36qDpo03ZWWZjI+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LqDxe6fQPcO0qtBvqDfAjxfgtdl?= =?us-ascii?Q?5NBuPMEMoeYkV6LhszmBruCO87q8OJWr7Ckb0PdqAol9NtIX2qN82Lrgm5gB?= =?us-ascii?Q?cKEUoUw/efx7o93MACoXtmqsx05zCRlXd8GyFud1LbvRcnkE05WqDnzErf6c?= =?us-ascii?Q?PTzoALtOWzpR0dO2a4DVT9KDyKT3KfrhcTb3dPymK/ANG08s6s0vQ8doiA6Y?= =?us-ascii?Q?wwaljCeOvpNsfkr1aZkKJPJY2t3S1VMNYVIOsAj1J6WH+tCq9aOEiCLsNByP?= =?us-ascii?Q?L9Jr2caF3rmSF2v2Lq3762fm4pelxVF/WFjJ/iLM21VUMsDWZR0PCFi38azb?= =?us-ascii?Q?vmxTGZHwHT3QF3PUy6E/mJV4ezazUa4dX5uBlBGGhR+g?= X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 34955f6d-e823-4685-a080-08db6d5b600b X-MS-Exchange-CrossTenant-AuthSource: BL0PR2101MB1092.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2023 04:45:42.5075 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CTRX6MXnBV/p1FtTD3T83mqkZYxmTo7xdXWVvYOEwESr6tMj8jSdysTl9hX/g99KtkEEczAKSB/G2yCH3JW+5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR21MB3382 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 The hpdev->state is never really useful. The only use in hv_pci_eject_device() and hv_eject_device_work() is not really necessary. Signed-off-by: Dexuan Cui Reviewed-by: Michael Kelley Acked-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org --- v2: No change to the patch body. Added Cc:stable v3: Added Michael's Reviewed-by. v3: Added Lorenzo's Acked-by. drivers/pci/controller/pci-hyperv.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index 733637d967654..a826b41c949a1 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -545,19 +545,10 @@ struct hv_dr_state { struct hv_pcidev_description func[]; }; -enum hv_pcichild_state { - hv_pcichild_init = 0, - hv_pcichild_requirements, - hv_pcichild_resourced, - hv_pcichild_ejecting, - hv_pcichild_maximum -}; - struct hv_pci_dev { /* List protected by pci_rescan_remove_lock */ struct list_head list_entry; refcount_t refs; - enum hv_pcichild_state state; struct pci_slot *pci_slot; struct hv_pcidev_description desc; bool reported_missing; @@ -2843,8 +2834,6 @@ static void hv_eject_device_work(struct work_struct *work) hpdev = container_of(work, struct hv_pci_dev, wrk); hbus = hpdev->hbus; - WARN_ON(hpdev->state != hv_pcichild_ejecting); - /* * Ejection can come before or after the PCI bus has been set up, so * attempt to find it and tear down the bus state, if it exists. This @@ -2901,7 +2890,6 @@ static void hv_pci_eject_device(struct hv_pci_dev *hpdev) return; } - hpdev->state = hv_pcichild_ejecting; get_pcichild(hpdev); INIT_WORK(&hpdev->wrk, hv_eject_device_work); queue_work(hbus->wq, &hpdev->wrk); -- 2.25.1