From nobody Wed Apr 06 17:46:11 2022 X-Original-To: dev-commits-src-all@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 338331AA6659; Wed, 6 Apr 2022 17:46:13 +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 4KYX4N10jmz3DXs; Wed, 6 Apr 2022 17:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649267172; 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=Obd4LL5j4zIQwLo/IuJgR/QH3klaDSUbT94mVFsfCL8=; b=oRK2PPbtuVrvFRkk/ukb6/0kHTevrJ8vK+i8WkbSMx33Bpakj+yTqsaGL/QzBd52MZBAMK 8NtPM2Eh9rvs4XzCxWXFwdyTE9VUuQ6hg7hUiIYV1lV/wgUXuSK3uwEVDc72Nk/YlhTDke 1YIXqFmJneZOjcHjLEQNZN/ZIvxdup0uspv9rWnfccJW6GDZCFmM4gdKpCqh3VKUnK/XiR R+VbtdU94SnjLH1OgGKwMYQ4ExyjOD7/KClmGWCpJGkcsEGG6+MRrSz/QoKkAV6web8MsE K1UtR2OE1hTaqnLEjVHvPff/kKFAF3G+uJdlA35kefurYWbUgX3/JCxfPxPEmA== 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 6A6231FC00; Wed, 6 Apr 2022 17:46:11 +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 236HkB9n022759; Wed, 6 Apr 2022 17:46:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 236HkBWE022758; Wed, 6 Apr 2022 17:46:11 GMT (envelope-from git) Date: Wed, 6 Apr 2022 17:46:11 GMT Message-Id: <202204061746.236HkBWE022758@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: a84ef318c658 - releng/13.1 - linuxkpi: Move lkpi_pcim_iomap_devres_find to .c file List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/releng/13.1 X-Git-Reftype: branch X-Git-Commit: a84ef318c658f6b7901299ff129136ea3afffe8b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649267172; 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=Obd4LL5j4zIQwLo/IuJgR/QH3klaDSUbT94mVFsfCL8=; b=YjcYfe89ADekwC6EzzSuAuRxeVbUnLU/W9elO61eq29QLs7nXDiXm6eJkPun+jBkjP6SxK Y0WIoCwVzch27wtRN+zmp/O6U+p0dP4UBwAV/bfyW5E0WLqgrzPhKITb2lh+QdOjQjAmgz PVDRh43gJxTiMEq3nQIHKZsaQpHCAWFIOqyzha8O4wtoIDZsKhMV4md+6HqG0SC8BS9IHW 9m+EXiOkKIsQdHwPbRQsPTq7Hn/qmNVlEKfeaAC6Q8VEE9Ht4zoUDxOH7/3rzvJDmCgdSN uDtg/UwLssCi9Z0DEoS+I/6IwwN4kbEhZf4pTat57d06t6/qeF7iOT98q5cM5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649267172; a=rsa-sha256; cv=none; b=cMcUsNxbMMwM3TPzHJSWop2q8IICDArZRz9fee/2CK4sCCdDgQcjPKMm2EfPNCWrg/Fff8 sn1dLh6Ba7IEp5os2h/uCRMANL17ZuC6EStWiWijGW7vosLTrjjvoW0KjwIi9tOH7QS3n0 hLcOoDmrICWVRGOiHRL+hMaSWvl8Dfbp6O9C20qpMZ6cgNAALtZwWQKt5dzUYVuN3kE5wE r9nHCCcrbgXcg+74aCqMaWdziCPSqrAQvL4aXayRfR5mp6iNg9JRJYaB4OXmquMP5ZFrIW pc8gsDSbTTnoRVKA8WcRGy6/dm2qiN9kKd4SAamoQk9CAqr2bMYVWZ/K3ym9lA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.1 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a84ef318c658f6b7901299ff129136ea3afffe8b commit a84ef318c658f6b7901299ff129136ea3afffe8b Author: Warner Losh AuthorDate: 2022-04-05 05:06:29 +0000 Commit: Warner Losh CommitDate: 2022-04-06 17:45:42 +0000 linuxkpi: Move lkpi_pcim_iomap_devres_find to .c file lkpi_pcim_iomap_devres_find encodes the size of struct pcim_iomap_devres in the code, so move from .h to .c to move from client driver to linuxkpi module. Approved by: re@ (gjb) Sponsored by: Netflix Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D34775 (cherry picked from commit 2bf3361d56f70d87a19f5d2bc8d258d418fb7a24) (cherry picked from commit 211621030e19553c7bd321b05694418920517736) --- sys/compat/linuxkpi/common/include/linux/pci.h | 21 +-------------------- sys/compat/linuxkpi/common/src/linux_pci.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index e712477fbe9e..efe0780190b7 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -347,6 +347,7 @@ 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 *); struct resource *_lkpi_pci_iomap(struct pci_dev *pdev, int bar, int mmio_size); +struct pcim_iomap_devres *lkpi_pcim_iomap_devres_find(struct pci_dev *pdev); void lkpi_pcim_iomap_table_release(struct device *, void *); static inline int @@ -1431,26 +1432,6 @@ pcim_enable_device(struct pci_dev *pdev) return (error); } -static inline struct pcim_iomap_devres * -lkpi_pcim_iomap_devres_find(struct pci_dev *pdev) -{ - struct pcim_iomap_devres *dr; - - dr = lkpi_devres_find(&pdev->dev, lkpi_pcim_iomap_table_release, - NULL, NULL); - if (dr == NULL) { - dr = lkpi_devres_alloc(lkpi_pcim_iomap_table_release, - sizeof(*dr), GFP_KERNEL | __GFP_ZERO); - if (dr != NULL) - lkpi_devres_add(&pdev->dev, dr); - } - - if (dr == NULL) - device_printf(pdev->dev.bsddev, "%s: NULL\n", __func__); - - return (dr); -} - static inline void __iomem ** pcim_iomap_table(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 328ca9c74bd1..acfc760f092f 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -550,6 +550,26 @@ lkpi_pci_devres_release(struct device *dev, void *p) } } +struct pcim_iomap_devres * +lkpi_pcim_iomap_devres_find(struct pci_dev *pdev) +{ + struct pcim_iomap_devres *dr; + + dr = lkpi_devres_find(&pdev->dev, lkpi_pcim_iomap_table_release, + NULL, NULL); + if (dr == NULL) { + dr = lkpi_devres_alloc(lkpi_pcim_iomap_table_release, + sizeof(*dr), GFP_KERNEL | __GFP_ZERO); + if (dr != NULL) + lkpi_devres_add(&pdev->dev, dr); + } + + if (dr == NULL) + device_printf(pdev->dev.bsddev, "%s: NULL\n", __func__); + + return (dr); +} + void lkpi_pcim_iomap_table_release(struct device *dev, void *p) {