diff mbox series

rdma/cxgb4: Simplify a structure initialization

Message ID 20180731152525.12470-1-bart.vanassche@wdc.com (mailing list archive)
State Superseded
Headers show
Series rdma/cxgb4: Simplify a structure initialization | expand

Commit Message

Bart Van Assche July 31, 2018, 3:25 p.m. UTC
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@wdc.com>
Cc: Steve Wise <swise@opengridcomputing.com>
Cc: Raju Rangoju <rajur@chelsio.com>
---
 drivers/infiniband/hw/cxgb4/qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steve Wise July 31, 2018, 3:29 p.m. UTC | #1
On 7/31/2018 10:25 AM, 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@wdc.com>
> Cc: Steve Wise <swise@opengridcomputing.com>
> Cc: Raju Rangoju <rajur@chelsio.com>
> ---
>  drivers/infiniband/hw/cxgb4/qp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
>

Acked-by: Steve Wise <swise@opengridcomputing.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jason Gunthorpe July 31, 2018, 3:36 p.m. UTC | #2
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@wdc.com>
> Cc: Steve Wise <swise@opengridcomputing.com>
> Cc: Raju Rangoju <rajur@chelsio.com>
>  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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
index 62e2c0d899f5..92fdf69d5605 100644
--- a/drivers/infiniband/hw/cxgb4/qp.c
+++ 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 = { };
 
 	event.device = &srq->rhp->ibdev;
 	event.element.srq = &srq->ibsrq;