From nobody Wed Apr 06 17:46:07 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 BD5121AA615F; Wed, 6 Apr 2022 17:46:08 +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 4KYX4J2Qxrz3DH7; Wed, 6 Apr 2022 17:46:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649267168; 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=szYC/U+qAI/984spNeF6CRIX0XYkFXcRpa7nsHXWLa4=; b=QQfFpELvnrFLzZ/NSLYu1RavdB0f+xZcf2y7oXzTor6xrnVw5WJDOww0G7/fRaxkP7sMii 1M3lFhDGut28K0u04B+go1qD3dT5txIDyVS/vQwfdPtPkNEFScI98IcJ9LWFcbdGnhqwRK pFOaWZLOd4TEhdSV3Vud/35nCNBTmVSjhrwYgg56Bj4sX2+7pgp02+P6Jks/qm9lT6YPto e2pcTk0Nm0KwX3IyMovULY+IG/GLnM57hLRECQMhm8W/TwWiNYFNXLI/XMAemoB7DoTjNm fkWBEECaZuCJDobg9yywfgR+lThPxq68h+ZmzIY+bOYlxAPXbc2k3QQTajf9Xg== 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 1C6201F76B; Wed, 6 Apr 2022 17:46:08 +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 236Hk7Bd022681; Wed, 6 Apr 2022 17:46:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 236Hk780022680; Wed, 6 Apr 2022 17:46:07 GMT (envelope-from git) Date: Wed, 6 Apr 2022 17:46:07 GMT Message-Id: <202204061746.236Hk780022680@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: 43b329596f19 - releng/13.1 - linuxkpi: Move lkpi_pci_devres_get_alloc into .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: 43b329596f19d97375ce3b7cb8ebbd191fea821a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649267168; 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=szYC/U+qAI/984spNeF6CRIX0XYkFXcRpa7nsHXWLa4=; b=MDZAOB4jKGMK+d++/OUE0HJqfWBL/D5troG/OepFW/tDVsjySG+261sv6uWaKeK4OPjVx6 Fan0a8FSXjt48sh/VHuJ4f4qfo7l9DxyMdRufcwvurSZ5tflFJ7BySAqrnWFCy96kskjBY 5Nf/Pr6kBRF2g5Ri0ZFiQxJfqWXfpYl9zTIMmea3+D+mbaGQ7iI87G2RyydpVQnCoIkeC5 uR/NXEgjHhZNIh8xsL1A44AMAgDxApUL6DV5r+rU97JPaIwExhbmhl70GBZwNTrvCfpHGD b1gvMj26sJMXvqEY16P4cAt5ND20Cma52mon6meTArE2oiH27YNrAsDknCgFpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649267168; a=rsa-sha256; cv=none; b=Fz/YegtnUNukw97mVWD/JeTBxDxhRNOtg6hMo1zoG5T4njp2P7ijMV6UVOpoEpSzjptr/7 LxOYeCEptBtHXMhatwjCWKW6s5WFezO7GvkDfrjAiSaxzXajWmy2nl+/M6/ZnxbToy0amk NimLBdRXjG+3oad7xjoVZtIoXDvLWHrfk1eoupKMsvpQ9LsfvKd6NtA35vl31fUfNXwLqJ DQse8QQ6c0AhqA/txFEuUaMRUVoHtBrCMABEl83nfSHQ/1+azDXAYCviutyn/nzTJi3qVr z/pp949CL0/sW+ZLygsXw7OrANd4heGfpfEwyIhKHKiNJ4XWjgo/X524GXfAcA== 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=43b329596f19d97375ce3b7cb8ebbd191fea821a commit 43b329596f19d97375ce3b7cb8ebbd191fea821a Author: Warner Losh AuthorDate: 2022-04-05 05:06:06 +0000 Commit: Warner Losh CommitDate: 2022-04-06 17:45:31 +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. Approved by: re@ (gjb) Sponsored by: Netflix Reviewed by: hselasky, emaste Differential Revision: https://reviews.freebsd.org/D34772 (cherry picked from commit 3ea682e21eed92f31dcfb8a34409580d36c452f7) (cherry picked from commit 2cd55de380d3d6f02c9b40ea53a319b477268f1c) --- 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) {