diff options
| author | Jason Gunthorpe <[email protected]> | 2019-02-13 04:12:47 +0000 |
|---|---|---|
| committer | Jason Gunthorpe <[email protected]> | 2019-02-19 17:13:39 +0000 |
| commit | ea1075edcbab7d92f4e4ccf5490043f796bf78be (patch) | |
| tree | 618fb95aa42e446d18020d6851bab321be2c3b4b /drivers/infiniband/core/cache.c | |
| parent | RDMA/nldev: Don't expose number of not-visible entries (diff) | |
| download | kernel-ea1075edcbab7d92f4e4ccf5490043f796bf78be.tar.gz kernel-ea1075edcbab7d92f4e4ccf5490043f796bf78be.zip | |
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 <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
Diffstat (limited to 'drivers/infiniband/core/cache.c')
| -rw-r--r-- | drivers/infiniband/core/cache.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c index 2338d0b3a0ca..3d137d8381a9 100644 --- a/drivers/infiniband/core/cache.c +++ b/drivers/infiniband/core/cache.c @@ -1428,7 +1428,7 @@ static void ib_cache_event(struct ib_event_handler *handler, int ib_cache_setup_one(struct ib_device *device) { - int p; + unsigned int p; int err; rwlock_init(&device->cache.lock); @@ -1447,8 +1447,8 @@ int ib_cache_setup_one(struct ib_device *device) return err; } - for (p = 0; p <= rdma_end_port(device) - rdma_start_port(device); ++p) - ib_cache_update(device, p + rdma_start_port(device), true); + rdma_for_each_port (device, p) + ib_cache_update(device, p, true); INIT_IB_EVENT_HANDLER(&device->cache.event_handler, device, ib_cache_event); |
