diff options
author | Yuval Shaia <yuval.shaia@oracle.com> | 2017-01-25 18:41:37 +0200 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-01-27 14:33:59 -0500 |
commit | 24dc831b77eca9361cf835be59fa69ea0e471afc (patch) | |
tree | 5aa6e10dfc77e48e2c969b3f6f870b3fc18f7e5e /drivers/infiniband/core/device.c | |
parent | 2bce1a6d2209c8c776a9598741f5aa1991689dcb (diff) | |
download | op-kernel-dev-24dc831b77eca9361cf835be59fa69ea0e471afc.zip op-kernel-dev-24dc831b77eca9361cf835be59fa69ea0e471afc.tar.gz |
IB/core: Add inline function to validate port
Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/core/device.c')
-rw-r--r-- | drivers/infiniband/core/device.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index 571974c..f2e4865 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -659,7 +659,7 @@ int ib_query_port(struct ib_device *device, union ib_gid gid; int err; - if (port_num < rdma_start_port(device) || port_num > rdma_end_port(device)) + if (!rdma_is_port_valid(device, port_num)) return -EINVAL; memset(port_attr, 0, sizeof(*port_attr)); @@ -825,7 +825,7 @@ int ib_modify_port(struct ib_device *device, if (!device->modify_port) return -ENOSYS; - if (port_num < rdma_start_port(device) || port_num > rdma_end_port(device)) + if (!rdma_is_port_valid(device, port_num)) return -EINVAL; return device->modify_port(device, port_num, port_modify_mask, |