diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2019-02-12 21:12:47 -0700 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2019-02-19 10:13:39 -0700 |
commit | ea1075edcbab7d92f4e4ccf5490043f796bf78be (patch) | |
tree | 618fb95aa42e446d18020d6851bab321be2c3b4b /drivers/infiniband/ulp/ipoib | |
parent | f2a0e45f36b0a210ff2388ed5fa89f81019c07a1 (diff) | |
download | linux-ea1075edcbab7d92f4e4ccf5490043f796bf78be.tar.bz2 |
RDMA: Add and use rdma_for_each_port
We have many loops iterating over all of the end port numbers on a struct
ib_device, simplify them with a for_each helper.
Reviewed-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/ulp/ipoib')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index ee4cca80f00b..48eda16db1a7 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -2495,7 +2495,7 @@ static void ipoib_add_one(struct ib_device *device) struct list_head *dev_list; struct net_device *dev; struct ipoib_dev_priv *priv; - int p; + unsigned int p; int count = 0; dev_list = kmalloc(sizeof(*dev_list), GFP_KERNEL); @@ -2504,7 +2504,7 @@ static void ipoib_add_one(struct ib_device *device) INIT_LIST_HEAD(dev_list); - for (p = rdma_start_port(device); p <= rdma_end_port(device); ++p) { + rdma_for_each_port (device, p) { if (!rdma_protocol_ib(device, p)) continue; dev = ipoib_add_port("ib%d", device, p); |