From 68ab66d75a388a300be79abbf855aa301af879fc Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 10 Jan 2012 12:30:40 +0000 Subject: [PATCH] ib_srpt: Introduce ARRAY_SIZE() in srpt_add_one() git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4058 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 2a2ff0d63..a7d508291 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -3814,8 +3814,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];