From: Fabian Frederick Date: Tue, 12 Aug 2014 23:20:08 +0000 (-0400) Subject: IB/mlx5: Use ARRAY_SIZE instead of sizeof/sizeof[0] X-Git-Tag: submit/tizen/20160607.132125~4072^2^9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a8f731ebd1b4f94cf52ff07fe524414b4fbf9793;p=sdk%2Femulator%2Femulator-kernel.git IB/mlx5: Use ARRAY_SIZE instead of sizeof/sizeof[0] Acked-by: Eli Cohen Signed-off-by: Fabian Frederick Signed-off-by: Doug Ledford Signed-off-by: Roland Dreier --- diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index bbbcf38..416cb72 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;