From patchwork Wed Oct 19 20:41:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 5836 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp527640wrs; Wed, 19 Oct 2022 13:48:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ZCmZJnc6nDOKug+wx9JRc21MqS51Z8ilQDQjxauQubWX7jjAdHxJceQwEU/nOLvXRxhwI X-Received: by 2002:a17:907:a42a:b0:78d:3ade:a543 with SMTP id sg42-20020a170907a42a00b0078d3adea543mr8554406ejc.400.1666212510835; Wed, 19 Oct 2022 13:48:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666212510; cv=none; d=google.com; s=arc-20160816; b=onttg3uRpj1jhg0iD3jTmzdos6n42W7Q/VUwYsdpzlwkKUx02DxdjhxctNpdIszKnX av6tPNOKc1sLE6+mZlQSJ7x6WF7BX7U4OH0Aa4/mEhZykqd3p5OIjuQIBkY2FysBa6Jz T3EtJ5jFtkMJXHVdyaiAg7XgtKhfOU4gdCu/KM4AN67MKH8rZpgmt9t0mSx0VaWPqFMC g7mKsNs3rQBgwAk3A/CnTmxZfNGC7LjVQSCJo3EE8jAY6XAqE6DurW4PPZMjFQG8JwwS jVJJx5yCCKm+7FpAAosN8yARhx3cGGj629/E2SVzz1quOJytfalBxnCx8vbiI1Kw7TUU 1QuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XDri2yAV+M16/oEnKHdNhdXW8p1a5Oth84AxJQ5lUWY=; b=JyuwVEauBFDsN8CxHEVy3y2SHjwDJzvhLZ2aJCwON1P1MnHjBIUOsADzSr1Ybl621Q 0J/ZHVFZaQ856yfDJelHPpJeDmTdIYNXIHxEnl9+xCERlKTVpH2cAVyeeTznQQgAxgTz zDjIeawKq+G7YtMLtcvB/c/5NM8SK5E5LD4CGpT92zXK2HJ1iooIPp9SCJQiU1RgYnGD PHTXyHWu4mg3kdDUu86igFjMlDMv38zXSlDa7M6jLOb/NmTDOCMCH57eqku61zKu93QB IVTnReadp4KLcJB5ORIDFCghH+/lGkWJBK9B4IBup3JHtNnqKKtZtx1ZLj6mnu/5Ha+s sFbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TBRWCM1h; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j15-20020aa7de8f000000b0045c0c18dde7si13597734edv.524.2022.10.19.13.48.06; Wed, 19 Oct 2022 13:48:30 -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=@kernel.org header.s=k20201202 header.b=TBRWCM1h; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230368AbiJSUlt (ORCPT + 99 others); Wed, 19 Oct 2022 16:41:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231458AbiJSUln (ORCPT ); Wed, 19 Oct 2022 16:41:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D17B169CED; Wed, 19 Oct 2022 13:41:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9FC5DB825E4; Wed, 19 Oct 2022 20:41:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F592C433D7; Wed, 19 Oct 2022 20:41:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666212098; bh=PJnRqTU+uLahKAeRgjkoETGDStPF8ENfLDUsX7IDEoY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TBRWCM1h8BdKM5rnViHBCrVACCi2t58X7AekhrKjfzfKd1hGX1Pla7vrUHTgZc6Vd wtGKZk79eBV+qBsOCp5YzvQjyONj/uR56oKoFru4QkhetRU1TwGFWK/+nYEFjhpMBe Gg8RKUFIrRV/gY/9krRw3DN88nj9WpjTVsvYMZy4cWB/rbXczD3H74Ya7Cb/Klvfri F8d4ml6S839SWM8GD/EdFzVf7ZR6sAqHrLz626+aKuvHE0xM7UKC51wOadkUI/5h3S O61RqmP3UrNcnsfb0w0M9LJ/CuZ9AWd97WS7nm+qGtnMLJb5xAg0DTmau11PcwWIba xnVeP34Hr6ikQ== From: Bjorn Helgaas To: linux-pci@vger.kernel.org Cc: Stefan Roese , Lukas Wunner , Jan Kiszka , Stuart Hayes , Keith Busch , linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: [PATCH 2/3] PCI/portdrv: Move private things to portdrv.c Date: Wed, 19 Oct 2022 15:41:26 -0500 Message-Id: <20221019204127.44463-3-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221019204127.44463-1-helgaas@kernel.org> References: <20221019204127.44463-1-helgaas@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747150449958341965?= X-GMAIL-MSGID: =?utf-8?q?1747150449958341965?= From: Bjorn Helgaas Previously several things used by portdrv_core.c and portdrv_pci.c were shared by defining them in portdrv.h. Now that portdrv_core.c and portdrv_pci.c have been squashed, move things that can be private into portdrv.c. No functional change intended. Signed-off-by: Bjorn Helgaas Reviewed-by: Christoph Hellwig --- drivers/pci/pcie/portdrv.c | 9 +++++++++ drivers/pci/pcie/portdrv.h | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/pci/pcie/portdrv.c b/drivers/pci/pcie/portdrv.c index 0b4a1f9c2a6b..ae8da5b2e922 100644 --- a/drivers/pci/pcie/portdrv.c +++ b/drivers/pci/pcie/portdrv.c @@ -21,6 +21,15 @@ #include "../pci.h" #include "portdrv.h" +/* + * The PCIe Capability Interrupt Message Number (PCIe r3.1, sec 7.8.2) must + * be one of the first 32 MSI-X entries. Per PCI r3.0, sec 6.8.3.1, MSI + * supports a maximum of 32 vectors per function. + */ +#define PCIE_PORT_MAX_MSI_ENTRIES 32 + +#define get_descriptor_id(type, service) (((type - 4) << 8) | service) + struct portdrv_service_data { struct pcie_port_service_driver *drv; struct device *dev; diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h index bf380bcea6a5..58a2b1a1cae4 100644 --- a/drivers/pci/pcie/portdrv.h +++ b/drivers/pci/pcie/portdrv.h @@ -98,15 +98,6 @@ struct pcie_port_service_driver { int pcie_port_service_register(struct pcie_port_service_driver *new); void pcie_port_service_unregister(struct pcie_port_service_driver *new); -/* - * The PCIe Capability Interrupt Message Number (PCIe r3.1, sec 7.8.2) must - * be one of the first 32 MSI-X entries. Per PCI r3.0, sec 6.8.3.1, MSI - * supports a maximum of 32 vectors per function. - */ -#define PCIE_PORT_MAX_MSI_ENTRIES 32 - -#define get_descriptor_id(type, service) (((type - 4) << 8) | service) - extern struct bus_type pcie_port_bus_type; struct pci_dev;