mirror of
https://github.com/torvalds/linux.git
synced 2024-11-28 07:01:32 +00:00
IB/srpt: Use ARRAY_SIZE() instead of open-coding
Signed-off-by: Roland Dreier <roland@purestorage.com>
This commit is contained in:
parent
486d8b9f88
commit
f225066b64
@ -3264,8 +3264,7 @@ static void srpt_add_one(struct ib_device *device)
|
|||||||
for (i = 0; i < sdev->srq_size; ++i)
|
for (i = 0; i < sdev->srq_size; ++i)
|
||||||
srpt_post_recv(sdev, sdev->ioctx_ring[i]);
|
srpt_post_recv(sdev, sdev->ioctx_ring[i]);
|
||||||
|
|
||||||
WARN_ON(sdev->device->phys_port_cnt
|
WARN_ON(sdev->device->phys_port_cnt > ARRAY_SIZE(sdev->port));
|
||||||
> sizeof(sdev->port)/sizeof(sdev->port[0]));
|
|
||||||
|
|
||||||
for (i = 1; i <= sdev->device->phys_port_cnt; i++) {
|
for (i = 1; i <= sdev->device->phys_port_cnt; i++) {
|
||||||
sport = &sdev->port[i - 1];
|
sport = &sdev->port[i - 1];
|
||||||
|
Loading…
Reference in New Issue
Block a user