summaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/mlx5/ah.c
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@mellanox.com>2020-07-30 11:12:34 +0300
committerJason Gunthorpe <jgg@nvidia.com>2020-08-18 14:47:34 -0300
commit70c1430fba7bc904403c4202776d7bfa697a294d (patch)
tree1e1f27544e51a12cb546370a2ed2ba59f938c739 /drivers/infiniband/hw/mlx5/ah.c
parent156f378985819e55431c7d7a09c7764d029ef49f (diff)
downloadlinux-70c1430fba7bc904403c4202776d7bfa697a294d.tar.gz
linux-70c1430fba7bc904403c4202776d7bfa697a294d.tar.bz2
linux-70c1430fba7bc904403c4202776d7bfa697a294d.zip
RDMA/mlx5: Replace open-coded offsetofend() macro
Clean mlx5_ib from open-coded implementations of offsetofend(). Link: https://lore.kernel.org/r/20200730081235.1581127-3-leon@kernel.org Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx5/ah.c')
-rw-r--r--drivers/infiniband/hw/mlx5/ah.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mlx5/ah.c b/drivers/infiniband/hw/mlx5/ah.c
index 59e5ec39b447..4a60e693a04d 100644
--- a/drivers/infiniband/hw/mlx5/ah.c
+++ b/drivers/infiniband/hw/mlx5/ah.c
@@ -106,8 +106,8 @@ int mlx5_ib_create_ah(struct ib_ah *ibah, struct rdma_ah_init_attr *init_attr,
if (ah_type == RDMA_AH_ATTR_TYPE_ROCE && udata) {
int err;
struct mlx5_ib_create_ah_resp resp = {};
- u32 min_resp_len = offsetof(typeof(resp), dmac) +
- sizeof(resp.dmac);
+ u32 min_resp_len =
+ offsetofend(struct mlx5_ib_create_ah_resp, dmac);
if (udata->outlen < min_resp_len)
return -EINVAL;