All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 1/1] drivers/infiniband/sw/siw/siw_qp_rx.c: suppress uninitialized var warning
@ 2020-03-23 18:46 akpm
  2020-03-24  6:46 ` Leon Romanovsky
  2020-03-24 22:51 ` Jason Gunthorpe
  0 siblings, 2 replies; 3+ messages in thread
From: akpm @ 2020-03-23 18:46 UTC (permalink / raw)
  To: akpm, bmt, dledford, jgg, linux-rdma

From: Andrew Morton <akpm@linux-foundation.org>
Subject: drivers/infiniband/sw/siw/siw_qp_rx.c: suppress uninitialized var warning

drivers/infiniband/sw/siw/siw_qp_rx.c: In function siw_proc_send:
./include/linux/spinlock.h:288:3: warning: flags may be used uninitialized in this function [-Wmaybe-uninitialized]
   _raw_spin_unlock_irqrestore(lock, flags); \
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/sw/siw/siw_qp_rx.c:335:16: note: flags was declared here
  unsigned long flags;

Cc: Bernard Metzler <bmt@zurich.ibm.com>
Cc: Doug Ledford <dledford@redhat.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/infiniband/sw/siw/siw_qp_rx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/infiniband/sw/siw/siw_qp_rx.c~drivers-infiniband-sw-siw-siw_qp_rxc-suppress-uninitialized-var-warning
+++ a/drivers/infiniband/sw/siw/siw_qp_rx.c
@@ -332,7 +332,7 @@ static struct siw_wqe *siw_rqe_get(struc
 	struct siw_srq *srq;
 	struct siw_wqe *wqe = NULL;
 	bool srq_event = false;
-	unsigned long flags;
+	unsigned long uninitialized_var(flags);
 
 	srq = qp->srq;
 	if (srq) {
_

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch 1/1] drivers/infiniband/sw/siw/siw_qp_rx.c: suppress uninitialized var warning
  2020-03-23 18:46 [patch 1/1] drivers/infiniband/sw/siw/siw_qp_rx.c: suppress uninitialized var warning akpm
@ 2020-03-24  6:46 ` Leon Romanovsky
  2020-03-24 22:51 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2020-03-24  6:46 UTC (permalink / raw)
  To: akpm; +Cc: bmt, dledford, jgg, linux-rdma

On Mon, Mar 23, 2020 at 11:46:27AM -0700, akpm@linux-foundation.org wrote:
> From: Andrew Morton <akpm@linux-foundation.org>
> Subject: drivers/infiniband/sw/siw/siw_qp_rx.c: suppress uninitialized var warning
>
> drivers/infiniband/sw/siw/siw_qp_rx.c: In function siw_proc_send:
> ./include/linux/spinlock.h:288:3: warning: flags may be used uninitialized in this function [-Wmaybe-uninitialized]
>    _raw_spin_unlock_irqrestore(lock, flags); \
>    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/infiniband/sw/siw/siw_qp_rx.c:335:16: note: flags was declared here
>   unsigned long flags;
>
> Cc: Bernard Metzler <bmt@zurich.ibm.com>
> Cc: Doug Ledford <dledford@redhat.com>
> Cc: Jason Gunthorpe <jgg@ziepe.ca>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
>  drivers/infiniband/sw/siw/siw_qp_rx.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

It is unclear to me how is that possible.

Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch 1/1] drivers/infiniband/sw/siw/siw_qp_rx.c: suppress uninitialized var warning
  2020-03-23 18:46 [patch 1/1] drivers/infiniband/sw/siw/siw_qp_rx.c: suppress uninitialized var warning akpm
  2020-03-24  6:46 ` Leon Romanovsky
@ 2020-03-24 22:51 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2020-03-24 22:51 UTC (permalink / raw)
  To: akpm; +Cc: bmt, dledford, linux-rdma

On Mon, Mar 23, 2020 at 11:46:27AM -0700, akpm@linux-foundation.org wrote:
> From: Andrew Morton <akpm@linux-foundation.org>
> Subject: drivers/infiniband/sw/siw/siw_qp_rx.c: suppress uninitialized var warning
> 
> drivers/infiniband/sw/siw/siw_qp_rx.c: In function siw_proc_send:
> ./include/linux/spinlock.h:288:3: warning: flags may be used uninitialized in this function [-Wmaybe-uninitialized]
>    _raw_spin_unlock_irqrestore(lock, flags); \
>    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/infiniband/sw/siw/siw_qp_rx.c:335:16: note: flags was declared here
>   unsigned long flags;
> 
> Cc: Bernard Metzler <bmt@zurich.ibm.com>
> Cc: Doug Ledford <dledford@redhat.com>
> Cc: Jason Gunthorpe <jgg@ziepe.ca>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  drivers/infiniband/sw/siw/siw_qp_rx.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-next, though I suppose gcc fixed this at some point as
I don't see the warning here...

Thanks,
Jason

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-24 22:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-23 18:46 [patch 1/1] drivers/infiniband/sw/siw/siw_qp_rx.c: suppress uninitialized var warning akpm
2020-03-24  6:46 ` Leon Romanovsky
2020-03-24 22:51 ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.