diff mbox

[1/1] IB/mlx5: use ARRAY_SIZE instead of sizeof/sizeof[0]

Message ID 1404244724-24528-1-git-send-email-fabf@skynet.be (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Fabian Frederick July 1, 2014, 7:58 p.m. UTC
use macro definition

Cc: Eli Cohen <eli@mellanox.com>
Cc: Roland Dreier <roland@kernel.org>
Cc: linux-rdma@vger.kernel.org
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 drivers/infiniband/hw/mlx5/qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eli Cohen July 2, 2014, 6:19 a.m. UTC | #1
Acked-by: Eli Cohen <eli@mellanox.com>

On Tue, Jul 01, 2014 at 09:58:44PM +0200, Fabian Frederick wrote:
> use macro definition
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eli Cohen July 24, 2014, 9:43 a.m. UTC | #2
On Tue, Jul 01, 2014 at 09:58:44PM +0200, Fabian Frederick wrote:
> use macro definition

Acked-by: Eli Cohen <eli@mellanox.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index d13ddf1..e9a3250 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -2501,7 +2501,7 @@  int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
 	spin_lock_irqsave(&qp->sq.lock, flags);
 
 	for (nreq = 0; wr; nreq++, wr = wr->next) {
-		if (unlikely(wr->opcode >= sizeof(mlx5_ib_opcode) / sizeof(mlx5_ib_opcode[0]))) {
+		if (unlikely(wr->opcode >= ARRAY_SIZE(mlx5_ib_opcode))) {
 			mlx5_ib_warn(dev, "\n");
 			err = -EINVAL;
 			*bad_wr = wr;