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 | IB/srpt: Accept GUIDs as port names (diff) | |
download | linux-dev-24dc831b77eca9361cf835be59fa69ea0e471afc.tar.xz linux-dev-24dc831b77eca9361cf835be59fa69ea0e471afc.zip |
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 571974cd3919..f2e48655a906 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, |