[ofw] [PATCH] mlx4 - change casting

Reuven Amitai reuven at mellanox.co.il
Tue May 6 05:16:11 PDT 2008


Hi,
 
The following patch prevent PREfast warning
 
Thanks, Reuven.
 

Index: hca/qp.c

===================================================================

--- hca/qp.c      (revision 1131)

+++ hca/qp.c      (working copy)

@@ -664,7 +664,7 @@

      }

 

      for (qp->rq.wqe_shift = 4;

-          (uint32_t)(1 << qp->rq.wqe_shift) < qp->rq.max_gs * sizeof
(struct mlx4_wqe_data_seg);

+          (1 << qp->rq.wqe_shift) < qp->rq.max_gs * (int) sizeof
(struct mlx4_wqe_data_seg);

           qp->rq.wqe_shift++)

            ; /* nothing */

 

@@ -696,7 +696,7 @@

      int wqe_size;

      struct mlx4_context *ctx = to_mctx(qp->ibv_qp.context);

 

-     wqe_size = (uint32_t)(1 << qp->sq.wqe_shift) - sizeof (struct
mlx4_wqe_ctrl_seg);

+     wqe_size = (1 << qp->sq.wqe_shift) - (int) sizeof (struct
mlx4_wqe_ctrl_seg);

      switch (type) {

      case IBV_QPT_UD:

            wqe_size -= sizeof (struct mlx4_wqe_datagram_seg);

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080506/e4a45816/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mlx4_user.patch
Type: application/octet-stream
Size: 785 bytes
Desc: mlx4_user.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080506/e4a45816/attachment.obj>


More information about the ofw mailing list