From 5f70e19b7977cc691ebeca5cabcf037ba6f52d2e Mon Sep 17 00:00:00 2001 From: Jacob Moroni Date: Mon, 12 Aug 2024 03:43:30 +0000 Subject: [PATCH] verbs: Use provider name when generating provider constructor [ Upstream commit 98db6cdb708ebe1f32d8855a317dfe0680ec22b6 ] Previously, the token pasting operator was not being applied to any of the PROVIDER_DRIVER macro aguments, so every provider's constructor had the same name of "drv__register_driver". Now, these constructors will be named using the provider name as the prefix, resulting in names like "irdma_register_driver". Fixes: 50b2aeb ("verbs: Expose the struct verbs_device_ops for each provider to the linker") Signed-off-by: Jacob Moroni Signed-off-by: Nicolas Morey --- libibverbs/driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libibverbs/driver.h b/libibverbs/driver.h index 9b5cca742..7a2b9173a 100644 --- a/libibverbs/driver.h +++ b/libibverbs/driver.h @@ -476,7 +476,7 @@ void verbs_register_driver(const struct verbs_device_ops *ops); #define PROVIDER_DRIVER(provider_name, drv_struct) \ extern const struct verbs_device_ops verbs_provider_##provider_name \ __attribute__((alias(stringify(drv_struct)))); \ - static __attribute__((constructor)) void drv##__register_driver(void) \ + static __attribute__((constructor)) void provider_name##_register_driver(void) \ { \ verbs_register_driver(&drv_struct); \ }