提交 f225066b 编写于 作者: R Roland Dreier

IB/srpt: Use ARRAY_SIZE() instead of open-coding

Signed-off-by: NRoland Dreier <roland@purestorage.com>
上级 486d8b9f
......@@ -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];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册