Message ID | 20210811153619.88922-4-boqun.feng@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=byvG=NC=lists.infradead.org=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@kernel.org> 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=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,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 0469EC4338F for <linux-arm-kernel@archiver.kernel.org>; Wed, 11 Aug 2021 15:39:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 AB02D60FA0 for <linux-arm-kernel@archiver.kernel.org>; Wed, 11 Aug 2021 15:39:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AB02D60FA0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=a5o/s3QYBLxXJkpRLb7JEudkucwWZvv3olfH8nk3Jz0=; b=jAW21Goo2CykVR MAjxewwCv0UapqQRr02cGAnGk8O1kuEXQyGEVvefrq7Ei3km7/XWuB49shkbTJav8P+Z46md0xwMW AFbjkc747c1sIWKZpJubQFYTb1Fudjf5yRdfX0G0BvXSFs15lkKAfGwcnESecenQqiq9tH6mppDEv RnEramYKKM2LL2UbgKOeh0IR9cFc/vt1wu9RXAiFAdAs8hrojR9Ksh2Gvqgvg/s1sujW/MK9HiLAG HV9J4MZjgNISuG9ARqzclce/dfOkn5xcyH3O1wsXwAie6T/DEPAIYgznqI6EaorHMr3833KZCJnQU BWrOhRGQskGiFji/8Ltw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDqIF-007ZKL-Ok; Wed, 11 Aug 2021 15:37:24 +0000 Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDqHY-007Z6a-VU for linux-arm-kernel@lists.infradead.org; Wed, 11 Aug 2021 15:36:42 +0000 Received: by mail-il1-x133.google.com with SMTP id u7so3295136ilk.7 for <linux-arm-kernel@lists.infradead.org>; Wed, 11 Aug 2021 08:36:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=m+WerKLNTuUcJjz5ppPIhMIuAZu9yrWomJykGHOMdQE=; b=Xw6bPBKjGySndzPoxC/HBXcfij6Ej8gsr8XCwc/zUlawabtn9idGbjPtC5CiRKkBTI IA8wyHhBi1Eb/DNR66nHkc+bGlSqJ1oMU4yomnzFoL0dLvsgp9EijGkpycy+ME8ywYAU 9miztcb3otIBCm1rnSjISWjbUkHjtO5Zh2zXHk64EhOOR4+ZoIniFCi6Vzp+VeQwPEFF 0swypePmtrL4wWMaRNBmi/e63ZXF5YQpxE0eYKmevPTTY0pWT9oCPylMLKRBiOT3TNq1 9Jbxxt1ehFQEq3YrJUL7/RrF9dIgres10UXUChxe2NvXIyryaSik9xOkU7x4vyd0R6Yz cr1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=m+WerKLNTuUcJjz5ppPIhMIuAZu9yrWomJykGHOMdQE=; b=I5AcWE+1GeGEqFeVbqEAvfopRWgfLLLpjaERjKD5DeNI3MafAyERqglKNovLsRDhiA /IMpRHVI1R6BIYIxyawkQ7p0itCfHIxeomijaaiKdLNZj3kmSCRYr+6BkP2x4bgyfPkL vVrxfL2CyN6T/0+cdobPuqyI7Koed3tYadJho9nBmTy5nGIhF4dnogUySsHI614rTmN/ Li2+2oXkl4E8ecfFUgwEV8W7aGyS8oTa+07lcmD2HiK9OEwyrov4Zue594bobiCU6SXP HPnUuDB9/XjkRoy9dEJrVXLZ+U1XqyKEG+PmLACmjBWn6Ve2qg5Kl5eOllyNyirXGz3c PiWQ== X-Gm-Message-State: AOAM532hRsjmhKhUezmLWuUWMKiEaYl0pDB2F94qs2deDcVmUTLzZE0G LIRTZi5O0u9KTS2VnIY4Emg= X-Google-Smtp-Source: ABdhPJwG2Q43Tufl+2zOtEvKna7XTvih3Y7p27iDvAbAfAT9elYx46qIz2mqI+h/bG7cZprSEiAaxg== X-Received: by 2002:a05:6e02:13f0:: with SMTP id w16mr276304ilj.268.1628696200058; Wed, 11 Aug 2021 08:36:40 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id t15sm12914887iln.77.2021.08.11.08.36.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 08:36:39 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id BCAAA27C0054; Wed, 11 Aug 2021 11:36:38 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 11 Aug 2021 11:36:38 -0400 X-ME-Sender: <xms:he4TYYu_fkfWkZ1sy9OtFgmUVMfiW-OJ3rytMff_hgLViVA7TCIKTA> <xme:he4TYVeMKLd8PPat7GNzlZpuax9FMGeC7P1D9M4qfkvgdwPMakM9qFl6WaGhwnqg0 Wb1hYMxBVOX8X0TPg> X-ME-Received: <xmr:he4TYTxD7jOVcdCQ_gZ1YkGpXN0MK4S-b-qsR5AFUk0LY8g-35lS5bp4l7A> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrkedugdeklecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpeehvdevteefgfeiudettdefvedvvdelkeejueffffelgeeuhffhjeetkeeiueeu leenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsoh hquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdeigedq udejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfihigmh gvrdhnrghmvg X-ME-Proxy: <xmx:he4TYbP0DXUPZ2rLB-eC_riltFQkOP6AaPMFqVsvSNH4FIYA7UxeOw> <xmx:he4TYY_GEWxUvhvq8zDauKaLZNJRSSOZVAYpzlPlpk6Akx5ndco20g> <xmx:he4TYTWhsIp172WT4bdecVCNZicWTcCMFhk2fE6z2YAMPC2Tg2PVSw> <xmx:hu4TYbcrq1OJ_K9ttEqRoQgIOJRIjiWEK81s8nvd0tIsx9d0ne2TkkR3GkQ> Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 11 Aug 2021 11:36:37 -0400 (EDT) From: Boqun Feng <boqun.feng@gmail.com> To: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>, "Rafael J. Wysocki" <rjw@rjwysocki.net>, Len Brown <lenb@kernel.org>, "K. Y. Srinivasan" <kys@microsoft.com>, Haiyang Zhang <haiyangz@microsoft.com>, Stephen Hemminger <sthemmin@microsoft.com>, Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>, Rob Herring <robh@kernel.org>, =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= <kw@linux.com>, Boqun Feng <boqun.feng@gmail.com>, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linux-hyperv@vger.kernel.org, Sunil Muthuswamy <sunilmut@microsoft.com>, Marc Zyngier <maz@kernel.org>, Arnd Bergmann <arnd@arndb.de> Subject: [RFC 3/5] PCI: hv: Set NULL as the ACPI device for the PCI host bridge Date: Wed, 11 Aug 2021 23:36:17 +0800 Message-Id: <20210811153619.88922-4-boqun.feng@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210811153619.88922-1-boqun.feng@gmail.com> References: <20210811153619.88922-1-boqun.feng@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210811_083641_113513_33D05544 X-CRM114-Status: GOOD ( 15.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
PCI: Use the private field of pci_host_bridge for ACPI device
|
expand
|
diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index 62dbe98d1fe1..fd3792b5edcc 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -3021,7 +3021,12 @@ static int hv_pci_probe(struct hv_device *hdev, */ BUILD_BUG_ON(sizeof(*hbus) > HV_HYP_PAGE_SIZE); - bridge = devm_pci_alloc_host_bridge(&hdev->device, 0); + /* + * devm_pci_alloc_host_bridge() use kzalloc(), and we want to set + * ->private as a NULL pointer, therefore no need to set ->private after + * allocation. + */ + bridge = devm_pci_alloc_host_bridge(&hdev->device, sizeof(struct acpi_device *)); if (!bridge) return -ENOMEM;
A PCI host bridge of Hyper-V doesn't have the corresponding ACPI device, therefore a NULL pointer needs to be set as the ->private of pci_host_bridge since for platforms with ACPI ->private is used to store the ACPI device information for the host bridges. And since kzalloc() is used to allocate pci_host_bridge, as a result, what is needed is just setting the correct size of ->private, kzalloc() will zero the field as if set a NULL pointer to it. Signed-off-by: Boqun Feng <boqun.feng@gmail.com> --- drivers/pci/controller/pci-hyperv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)