From nobody Tue Apr 05 14:42:31 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BD6501A8F12E; Tue, 5 Apr 2022 14:42:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KXr2v3zCDz4cNm; Tue, 5 Apr 2022 14:42:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649169751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Infsg8WfnjeMTrc3ih3zWcIWni2jS4YqR78DQpGA6S4=; b=mqnNS0ilu/d7hAPEjB3UW9QUO5lOfotIM1TkPifEYiRAVnEMzGygTjJg2L//QhqTDAURq3 K2w26DsvSkydZhk6s76js0W90YGYODgQXoaobD8ZZ/v4fY3vbpK+dxtWBFYs48vZrDWjrv FB2h2gkAP9+sEHg/7dkYBKlagnHCUdjdgZzgJc+ioMo+jV9ErIt9xxz9SpuFy7jxfozm7i VBrHW65BiumyT1cyIzyBKICkAC29GPe+KVCmilvT89M8aJp2v4kDc4h54wAVzwPWd7n3wv 0Eh6oSKJ7Kl+H2VNuFMHgJUcyD00Uy5ManAvWy43jzfXLlfGkZWfK5AWn5RfaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AF6A1E8; Tue, 5 Apr 2022 14:42:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 235EgVIf031353; Tue, 5 Apr 2022 14:42:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 235EgV0W031339; Tue, 5 Apr 2022 14:42:31 GMT (envelope-from git) Date: Tue, 5 Apr 2022 14:42:31 GMT Message-Id: <202204051442.235EgV0W031339@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 2cd55de380d3 - stable/13 - linuxkpi: Move lkpi_pci_devres_get_alloc into .c file List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2cd55de380d3d6f02c9b40ea53a319b477268f1c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649169751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Infsg8WfnjeMTrc3ih3zWcIWni2jS4YqR78DQpGA6S4=; b=YM5Jm8STAHfBTKaw7gd24DZXPq3507AElopOqqw/3JhrcbFb4ze/Es366QGbQ+TC6trs4j mtlw9guq4OP8ealFhtWg24OcBdrRwcEGvbbH+Azk/T/h7CYtgpDgJj8PNY4gR45AzhnZau 0ff7Ws9W3eoB3SuUNBD5vG+KIfjosviBoMAjwG+DUEwo5fBY/uWBAotf09hrwW4Ld+I3H4 dFhLLHVqCSvW5li1ZsA1NXBsjQs9Zx061szLmkPNL4eX8K/Di9IHFmSRKv03W3RCaKeU/s TikJIKESPFu3XragO1lngRUS37ZFrCqWncQuEDIK2Quzc6EbaHwnffuLZrKCKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649169751; a=rsa-sha256; cv=none; b=ZzJp5SUtpsNGHp2xiTs64ItiNRaq1+Wio5EgFhe65pOVYhkHsIisiv5QHMNzKhc/DPpLUl MY4duPqvKGUMDb7Y1fpM2jHduJBt/wy23X6BzPYDL7ZQvBGkVUnGu5R3Bf2FaPofrPaMpB bIFpyyKxFrs0yIqrliWKOgTnJdLycfsXRmG6LyUu6QkzWNeMZ+8BvhMuzG11Cx1imdsUz2 UxwTqnNLFphJAnKjpoyZHe0dSF/NPyTBl827d+WgxoR4ovJhZWSDHOdw7eysaOIbIVSwYr Q1+dMXXJlNfMiQ5auQMkUEf1Lvun4FMEIr1BaDoE13W/lCtOKPN5Mi6upaa8qQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2cd55de380d3d6f02c9b40ea53a319b477268f1c commit 2cd55de380d3d6f02c9b40ea53a319b477268f1c Author: Warner Losh AuthorDate: 2022-04-05 05:06:06 +0000 Commit: Warner Losh CommitDate: 2022-04-05 14:40:10 +0000 linuxkpi: Move lkpi_pci_devres_get_alloc into .c file lkpi_pci_devres_get_alloc encodes the struct pci_devres into its code. Move from .h file to .c file to move this knowledge into linuxkpi module. Sponsored by: Netflix Reviewed by: hselasky, emaste Differential Revision: https://reviews.freebsd.org/D34772 (cherry picked from commit 3ea682e21eed92f31dcfb8a34409580d36c452f7) --- sys/compat/linuxkpi/common/include/linux/pci.h | 16 +--------------- sys/compat/linuxkpi/common/src/linux_pci.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index c4d30a6e293a..f655c8f5ccdf 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -340,6 +340,7 @@ struct pcim_iomap_devres { /* Internal helper function(s). */ struct pci_dev *lkpinew_pci_dev(device_t); +struct pci_devres *lkpi_pci_devres_get_alloc(struct pci_dev *pdev); void lkpi_pci_devres_release(struct device *, void *); void lkpi_pcim_iomap_table_release(struct device *, void *); @@ -542,21 +543,6 @@ done: return (pdev->bus->self); } -static inline struct pci_devres * -lkpi_pci_devres_get_alloc(struct pci_dev *pdev) -{ - struct pci_devres *dr; - - dr = lkpi_devres_find(&pdev->dev, lkpi_pci_devres_release, NULL, NULL); - if (dr == NULL) { - dr = lkpi_devres_alloc(lkpi_pci_devres_release, sizeof(*dr), - GFP_KERNEL | __GFP_ZERO); - if (dr != NULL) - lkpi_devres_add(&pdev->dev, dr); - } - - return (dr); -} static inline struct pci_devres * lkpi_pci_devres_find(struct pci_dev *pdev) { diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 0e952c17d7f7..b396b512e176 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -506,6 +506,22 @@ lkpi_pci_disable_dev(struct device *dev) return (0); } +struct pci_devres * +lkpi_pci_devres_get_alloc(struct pci_dev *pdev) +{ + struct pci_devres *dr; + + dr = lkpi_devres_find(&pdev->dev, lkpi_pci_devres_release, NULL, NULL); + if (dr == NULL) { + dr = lkpi_devres_alloc(lkpi_pci_devres_release, sizeof(*dr), + GFP_KERNEL | __GFP_ZERO); + if (dr != NULL) + lkpi_devres_add(&pdev->dev, dr); + } + + return (dr); +} + void lkpi_pci_devres_release(struct device *dev, void *p) {