Re: [PATCH 09/28] mlx5: Fix gcc 6.4 uninitialized variable warning
From: Yishai Hadas <hidden>
Date: 2016-09-14 15:39:10
On 9/6/2016 12:07 AM, Jason Gunthorpe wrote:
gcc 6.4 remarks:
../providers/mlx5/cq.c:647:10: warning: 'wc_byte_len' may be used uninitialized in this function [-Wmaybe-uninitialized]
err = mlx5_copy_to_send_wqe(mqp, wqe_ctr, cqe,
lazy ? wc_byte_len : wc->byte_len);
The path is because handle_good_req_lazy does not set its wc_byte_len
outputs under certain case conditions.wc_byte_len defined as uint32_t uninitialized_var(wc_byte_len) to prevent this warning, isn't this macro applicable ?
Perhaps it is possible that the hardware never produces a completion with opcodes and scatter flags that could trigger this,
It can't happen, no real functional issue.
quoted hunk
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> --- libmlx5/src/cq.c | 3 +++ 1 file changed, 3 insertions(+)diff --git a/libmlx5/src/cq.c b/libmlx5/src/cq.c index 88097037eea0..163205bddeb8 100644 --- a/libmlx5/src/cq.c +++ b/libmlx5/src/cq.c@@ -235,7 +235,10 @@ static inline void handle_good_req_lazy(struct mlx5_cqe64 *cqe, uint32_t *pwc_by break; case MLX5_OPCODE_UMR: *umr_opcode = wq->wr_data[idx]; + *pwc_byte_len = 0;
This case is a data path flow, need to prevent adding non applicable code.
break; + default: + *pwc_byte_len = 0; } }
-- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html