| 1 |
struct ibv_device { |
| 2 |
/* [...snip...] */ |
| 3 |
int placeholder; |
| 4 |
}; |
| 5 |
|
| 6 |
struct verbs_device { |
| 7 |
struct ibv_device device; /* Must be first */ |
| 8 |
/* [...snip...] */ |
| 9 |
int placeholder; |
| 10 |
}; |
| 11 |
|
| 12 |
struct mlx5_device { |
| 13 |
struct verbs_device verbs_dev; |
| 14 |
int placeholder; |
| 15 |
}; |
| 16 |
|
| 17 |
static inline struct mlx5_device *to_mdev(struct ibv_device *ibdev) |
| 18 |
{ |
| 19 |
return (struct mlx5_device *)ibdev; |
| 20 |
} |
| 21 |
|
| 22 |
static void mlx5_uninit_device(struct verbs_device *verbs_device) |
| 23 |
{ |
| 24 |
struct mlx5_device *dev = to_mdev(&verbs_device->device); |
| 25 |
__builtin_free(dev); /* { dg-bogus "not on the heap" } */ |
| 26 |
} |