pci: Use conftest to find if pci_epc_event_ops struct has core_deinit

Use the conftest to find if the struct pci_epc_event_ops has
core_deinit as callback function. This callback is added
by Nvidia in core kernel.

Bug 4346767

Change-Id: I399197917ac7746ca367f55b9dc4e3a5bd79f073
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3028740
Reviewed-by: Shardar Mohammed <smohammed@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Laxman Dewangan
2023-12-05 17:39:32 +00:00
committed by mobile promotions
parent a757343f2e
commit 1e9fc00bc2
5 changed files with 26 additions and 8 deletions

View File

@@ -7017,6 +7017,22 @@ compile_test() {
compile_check_conftest "$CODE" "NV_PWM_OPS_STRUCT_HAS_OWNER" "" "types"
;;
pci_epc_event_ops_struct_has_core_deinit)
#
# Determine if the pci_epc_event_ops struct has the core_deinit function.
#
# Added by commit 3d99b5acdd3191c ("NVIDIA: SAUCE: PCI: endpoint: Add core_deinit()
# callback support") from Nvidia PCI improvement.
#
CODE="
#include <linux/pci-epf.h>
int conftest_pci_epc_event_ops_struct_has_core_deinit(void) {
return offsetof(struct pci_epc_event_ops, core_deinit);
}"
compile_check_conftest "$CODE" "NV_PCI_EPC_EVENT_OPS_STRUCT_HAS_CORE_DEINIT" "" "types"
;;
register_shrinker_has_fmt_arg)
#
# Determine if the 'register_shrinker' function