Skip to content

Commit

Permalink
verbs: Use provider name when generating provider constructor
Browse files Browse the repository at this point in the history
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 <jmoroni@google.com>
  • Loading branch information
jakemoroni committed Aug 12, 2024
1 parent a3e1626 commit 98db6cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libibverbs/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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); \
}
Expand Down

0 comments on commit 98db6cd

Please sign in to comment.