diff options
author | Jack Morgenstein <jackm@dev.mellanox.co.il> | 2014-07-28 16:30:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-30 17:00:06 -0400 |
commit | f241e7497ec2d22b83002b17ae91a851d4034cb7 (patch) | |
tree | 5d8179647f85be21bad567cdce578a78ca6de875 /drivers/infiniband/hw/mlx5 | |
parent | 9603b61de1eee92977d74ff42541be20c0c5b1a7 (diff) |
mlx5: minor fixes (mainly avoidance of hidden casts)
There were many places where parameters which should be u8/u16 were
integer type.
Additionally, in 2 places, a check for a non-null pointer was added
before dereferencing the pointer (this is actually a bug fix).
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/infiniband/hw/mlx5')
-rw-r--r-- | drivers/infiniband/hw/mlx5/cq.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/hw/mlx5/mad.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/hw/mlx5/main.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/hw/mlx5/mem.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/hw/mlx5/mlx5_ib.h | 2 | ||||
-rw-r--r-- | drivers/infiniband/hw/mlx5/qp.c | 4 |
6 files changed, 7 insertions, 7 deletions
diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c index 3b4dc858cef9..e4056279166d 100644 --- a/drivers/infiniband/hw/mlx5/cq.c +++ b/drivers/infiniband/hw/mlx5/cq.c | |||
@@ -348,7 +348,7 @@ static void handle_atomic(struct mlx5_ib_qp *qp, struct mlx5_cqe64 *cqe64, | |||
348 | static void handle_atomics(struct mlx5_ib_qp *qp, struct mlx5_cqe64 *cqe64, | 348 | static void handle_atomics(struct mlx5_ib_qp *qp, struct mlx5_cqe64 *cqe64, |
349 | u16 tail, u16 head) | 349 | u16 tail, u16 head) |
350 | { | 350 | { |
351 | int idx; | 351 | u16 idx; |
352 | 352 | ||
353 | do { | 353 | do { |
354 | idx = tail & (qp->sq.wqe_cnt - 1); | 354 | idx = tail & (qp->sq.wqe_cnt - 1); |
diff --git a/drivers/infiniband/hw/mlx5/mad.c b/drivers/infiniband/hw/mlx5/mad.c index e259e7393152..b514bbb5610f 100644 --- a/drivers/infiniband/hw/mlx5/mad.c +++ b/drivers/infiniband/hw/mlx5/mad.c | |||
@@ -41,7 +41,7 @@ enum { | |||
41 | }; | 41 | }; |
42 | 42 | ||
43 | int mlx5_MAD_IFC(struct mlx5_ib_dev *dev, int ignore_mkey, int ignore_bkey, | 43 | int mlx5_MAD_IFC(struct mlx5_ib_dev *dev, int ignore_mkey, int ignore_bkey, |
44 | int port, struct ib_wc *in_wc, struct ib_grh *in_grh, | 44 | u8 port, struct ib_wc *in_wc, struct ib_grh *in_grh, |
45 | void *in_mad, void *response_mad) | 45 | void *in_mad, void *response_mad) |
46 | { | 46 | { |
47 | u8 op_modifier = 0; | 47 | u8 op_modifier = 0; |
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index f2cfd363a705..166335a95c59 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c | |||
@@ -478,7 +478,7 @@ static struct ib_ucontext *mlx5_ib_alloc_ucontext(struct ib_device *ibdev, | |||
478 | int uuarn; | 478 | int uuarn; |
479 | int err; | 479 | int err; |
480 | int i; | 480 | int i; |
481 | int reqlen; | 481 | size_t reqlen; |
482 | 482 | ||
483 | if (!dev->ib_active) | 483 | if (!dev->ib_active) |
484 | return ERR_PTR(-EAGAIN); | 484 | return ERR_PTR(-EAGAIN); |
diff --git a/drivers/infiniband/hw/mlx5/mem.c b/drivers/infiniband/hw/mlx5/mem.c index 8499aec94db6..a3e81444c825 100644 --- a/drivers/infiniband/hw/mlx5/mem.c +++ b/drivers/infiniband/hw/mlx5/mem.c | |||
@@ -148,7 +148,7 @@ int mlx5_ib_get_buf_offset(u64 addr, int page_shift, u32 *offset) | |||
148 | u64 off_mask; | 148 | u64 off_mask; |
149 | u64 buf_off; | 149 | u64 buf_off; |
150 | 150 | ||
151 | page_size = 1 << page_shift; | 151 | page_size = (u64)1 << page_shift; |
152 | page_mask = page_size - 1; | 152 | page_mask = page_size - 1; |
153 | buf_off = addr & page_mask; | 153 | buf_off = addr & page_mask; |
154 | off_size = page_size >> 6; | 154 | off_size = page_size >> 6; |
diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h index a0e204ffe367..386780f0d1e1 100644 --- a/drivers/infiniband/hw/mlx5/mlx5_ib.h +++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h | |||
@@ -461,7 +461,7 @@ void __mlx5_ib_cq_clean(struct mlx5_ib_cq *cq, u32 qpn, struct mlx5_ib_srq *srq) | |||
461 | void mlx5_ib_cq_clean(struct mlx5_ib_cq *cq, u32 qpn, struct mlx5_ib_srq *srq); | 461 | void mlx5_ib_cq_clean(struct mlx5_ib_cq *cq, u32 qpn, struct mlx5_ib_srq *srq); |
462 | void mlx5_ib_free_srq_wqe(struct mlx5_ib_srq *srq, int wqe_index); | 462 | void mlx5_ib_free_srq_wqe(struct mlx5_ib_srq *srq, int wqe_index); |
463 | int mlx5_MAD_IFC(struct mlx5_ib_dev *dev, int ignore_mkey, int ignore_bkey, | 463 | int mlx5_MAD_IFC(struct mlx5_ib_dev *dev, int ignore_mkey, int ignore_bkey, |
464 | int port, struct ib_wc *in_wc, struct ib_grh *in_grh, | 464 | u8 port, struct ib_wc *in_wc, struct ib_grh *in_grh, |
465 | void *in_mad, void *response_mad); | 465 | void *in_mad, void *response_mad); |
466 | struct ib_ah *create_ib_ah(struct ib_ah_attr *ah_attr, | 466 | struct ib_ah *create_ib_ah(struct ib_ah_attr *ah_attr, |
467 | struct mlx5_ib_ah *ah); | 467 | struct mlx5_ib_ah *ah); |
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index b8bb6ad6350c..7efe6e3f3542 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c | |||
@@ -2539,7 +2539,7 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, | |||
2539 | case IB_WR_RDMA_WRITE_WITH_IMM: | 2539 | case IB_WR_RDMA_WRITE_WITH_IMM: |
2540 | set_raddr_seg(seg, wr->wr.rdma.remote_addr, | 2540 | set_raddr_seg(seg, wr->wr.rdma.remote_addr, |
2541 | wr->wr.rdma.rkey); | 2541 | wr->wr.rdma.rkey); |
2542 | seg += sizeof(struct mlx5_wqe_raddr_seg); | 2542 | seg += sizeof(struct mlx5_wqe_raddr_seg); |
2543 | size += sizeof(struct mlx5_wqe_raddr_seg) / 16; | 2543 | size += sizeof(struct mlx5_wqe_raddr_seg) / 16; |
2544 | break; | 2544 | break; |
2545 | 2545 | ||
@@ -2668,7 +2668,7 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, | |||
2668 | case IB_QPT_SMI: | 2668 | case IB_QPT_SMI: |
2669 | case IB_QPT_GSI: | 2669 | case IB_QPT_GSI: |
2670 | set_datagram_seg(seg, wr); | 2670 | set_datagram_seg(seg, wr); |
2671 | seg += sizeof(struct mlx5_wqe_datagram_seg); | 2671 | seg += sizeof(struct mlx5_wqe_datagram_seg); |
2672 | size += sizeof(struct mlx5_wqe_datagram_seg) / 16; | 2672 | size += sizeof(struct mlx5_wqe_datagram_seg) / 16; |
2673 | if (unlikely((seg == qend))) | 2673 | if (unlikely((seg == qend))) |
2674 | seg = mlx5_get_send_wqe(qp, 0); | 2674 | seg = mlx5_get_send_wqe(qp, 0); |