Re: [PATCH] rdma/cxgb4: Simplify a structure initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 31, 2018 at 08:25:25AM -0700, Bart Van Assche wrote:
> This patch avoids that sparse reports the following warning:
> 
> drivers/infiniband/hw/cxgb4/qp.c:2269:34: warning: Using plain integer as NULL pointer
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@xxxxxxx>
> Cc: Steve Wise <swise@xxxxxxxxxxxxxxxxxxxxx>
> Cc: Raju Rangoju <rajur@xxxxxxxxxxx>
>  drivers/infiniband/hw/cxgb4/qp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
> index 62e2c0d899f5..92fdf69d5605 100644
> +++ b/drivers/infiniband/hw/cxgb4/qp.c
> @@ -2266,7 +2266,7 @@ struct ib_qp *c4iw_get_qp(struct ib_device *dev, int qpn)
>  
>  void c4iw_dispatch_srq_limit_reached_event(struct c4iw_srq *srq)
>  {
> -	struct ib_event event = {0};
> +	struct ib_event event = { };

Generally speaking, tree wide, I actually prefer {} to {0} - clang
even produces a useful incomplete structure initializer warning for
{0}.

Would prefer to see new patches use {}

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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux