Ignore a compilation warning of drivers mlx5.

dlsym(if_indextoname) conversion of 'void *' pointer to function pointer type.
This commit is contained in:
fengbojiang 2023-09-18 17:38:55 +08:00
parent c408ecc698
commit a4834761df
1 changed files with 2 additions and 2 deletions

View File

@ -1046,7 +1046,7 @@ mlx5_sysfs_check_switch_info(bool device_dir,
* @return
* 0 on success, a negative errno value otherwise and rte_errno is set.
*/
static int (*real_if_indextoname)(unsigned int, char *);
static char *(*real_if_indextoname)(unsigned int, char *) = NULL;
int
mlx5_sysfs_switch_info(unsigned int ifindex, struct mlx5_switch_info *info)
{
@ -1069,7 +1069,7 @@ mlx5_sysfs_switch_info(unsigned int ifindex, struct mlx5_switch_info *info)
// for ff tools
if (!real_if_indextoname) {
real_if_indextoname = dlsym(RTLD_NEXT, "if_indextoname");
real_if_indextoname = __extension__ (char *(*)(unsigned int, char *))dlsym(RTLD_NEXT, "if_indextoname");
if (!real_if_indextoname) {
rte_errno = errno;
return -rte_errno;