Skip to content

Commit

Permalink
IB/srpt: Use ARRAY_SIZE() instead of open-coding
Browse files Browse the repository at this point in the history
Signed-off-by: Roland Dreier <roland@purestorage.com>
  • Loading branch information
Roland Dreier committed Feb 2, 2012
1 parent 486d8b9 commit f225066
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/infiniband/ulp/srpt/ib_srpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -3264,8 +3264,7 @@ static void srpt_add_one(struct ib_device *device)
for (i = 0; i < sdev->srq_size; ++i)
srpt_post_recv(sdev, sdev->ioctx_ring[i]);

WARN_ON(sdev->device->phys_port_cnt
> sizeof(sdev->port)/sizeof(sdev->port[0]));
WARN_ON(sdev->device->phys_port_cnt > ARRAY_SIZE(sdev->port));

for (i = 1; i <= sdev->device->phys_port_cnt; i++) {
sport = &sdev->port[i - 1];
Expand Down

0 comments on commit f225066

Please sign in to comment.