linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] RDMA/siw: Mark expected switch fall-throughs
@ 2019-07-11 16:12 Gustavo A. R. Silva
  2019-07-11 16:28 ` Bernard Metzler
  2019-07-11 18:05 ` Jason Gunthorpe
  0 siblings, 2 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2019-07-11 16:12 UTC (permalink / raw)
  To: Bernard Metzler, Doug Ledford, Jason Gunthorpe
  Cc: linux-rdma, linux-kernel, Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch
cases where we are expecting to fall through.

This patch fixes the following warnings:

drivers/infiniband/sw/siw/siw_qp_rx.c: In function ‘siw_rdmap_complete’:
drivers/infiniband/sw/siw/siw_qp_rx.c:1214:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
   wqe->rqe.flags |= SIW_WQE_SOLICITED;
   ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
drivers/infiniband/sw/siw/siw_qp_rx.c:1215:2: note: here
  case RDMAP_SEND:
  ^~~~

drivers/infiniband/sw/siw/siw_qp_tx.c: In function ‘siw_qp_sq_process’:
drivers/infiniband/sw/siw/siw_qp_tx.c:1044:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
    siw_wqe_put_mem(wqe, tx_type);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/sw/siw/siw_qp_tx.c:1045:3: note: here
   case SIW_OP_INVAL_STAG:
   ^~~~
drivers/infiniband/sw/siw/siw_qp_tx.c:1128:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
    siw_wqe_put_mem(wqe, tx_type);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/sw/siw/siw_qp_tx.c:1129:3: note: here
   case SIW_OP_INVAL_STAG:
   ^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enable
-Wimplicit-fallthrough.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---

NOTE: -Wimplicit-fallthrough will be enabled globally in v5.3. So, I
      suggest you to take this patch for 5.3-rc1.

 drivers/infiniband/sw/siw/siw_qp_rx.c | 2 ++
 drivers/infiniband/sw/siw/siw_qp_tx.c | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/drivers/infiniband/sw/siw/siw_qp_rx.c b/drivers/infiniband/sw/siw/siw_qp_rx.c
index 682a290bc11e..f87657a11657 100644
--- a/drivers/infiniband/sw/siw/siw_qp_rx.c
+++ b/drivers/infiniband/sw/siw/siw_qp_rx.c
@@ -1212,6 +1212,8 @@ static int siw_rdmap_complete(struct siw_qp *qp, int error)
 	case RDMAP_SEND_SE:
 	case RDMAP_SEND_SE_INVAL:
 		wqe->rqe.flags |= SIW_WQE_SOLICITED;
+		/* Fall through */
+
 	case RDMAP_SEND:
 	case RDMAP_SEND_INVAL:
 		if (wqe->wr_status == SIW_WR_IDLE)
diff --git a/drivers/infiniband/sw/siw/siw_qp_tx.c b/drivers/infiniband/sw/siw/siw_qp_tx.c
index f0d949e2e318..43020d2040fc 100644
--- a/drivers/infiniband/sw/siw/siw_qp_tx.c
+++ b/drivers/infiniband/sw/siw/siw_qp_tx.c
@@ -1042,6 +1042,8 @@ int siw_qp_sq_process(struct siw_qp *qp)
 		case SIW_OP_SEND_REMOTE_INV:
 		case SIW_OP_WRITE:
 			siw_wqe_put_mem(wqe, tx_type);
+			/* Fall through */
+
 		case SIW_OP_INVAL_STAG:
 		case SIW_OP_REG_MR:
 			if (tx_flags(wqe) & SIW_WQE_SIGNALLED)
@@ -1126,6 +1128,8 @@ int siw_qp_sq_process(struct siw_qp *qp)
 		case SIW_OP_READ:
 		case SIW_OP_READ_LOCAL_INV:
 			siw_wqe_put_mem(wqe, tx_type);
+			/* Fall through */
+
 		case SIW_OP_INVAL_STAG:
 		case SIW_OP_REG_MR:
 			siw_sqe_complete(qp, &wqe->sqe, wqe->bytes,
-- 
2.21.0


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

* Re: [PATCH] RDMA/siw: Mark expected switch fall-throughs
  2019-07-11 16:12 [PATCH] RDMA/siw: Mark expected switch fall-throughs Gustavo A. R. Silva
@ 2019-07-11 16:28 ` Bernard Metzler
  2019-07-11 18:05 ` Jason Gunthorpe
  1 sibling, 0 replies; 4+ messages in thread
From: Bernard Metzler @ 2019-07-11 16:28 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Doug Ledford, Jason Gunthorpe, linux-rdma, linux-kernel

-----"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote: -----

>To: "Bernard Metzler" <bmt@zurich.ibm.com>, "Doug Ledford"
><dledford@redhat.com>, "Jason Gunthorpe" <jgg@ziepe.ca>
>From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
>Date: 07/11/2019 06:12PM
>Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
>"Gustavo A. R. Silva" <gustavo@embeddedor.com>
>Subject: [EXTERNAL] [PATCH] RDMA/siw: Mark expected switch
>fall-throughs
>
>In preparation to enabling -Wimplicit-fallthrough, mark switch
>cases where we are expecting to fall through.
>
>This patch fixes the following warnings:
>
>drivers/infiniband/sw/siw/siw_qp_rx.c: In function
>‘siw_rdmap_complete’:
>drivers/infiniband/sw/siw/siw_qp_rx.c:1214:18: warning: this
>statement may fall through [-Wimplicit-fallthrough=]
>   wqe->rqe.flags |= SIW_WQE_SOLICITED;
>   ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
>drivers/infiniband/sw/siw/siw_qp_rx.c:1215:2: note: here
>  case RDMAP_SEND:
>  ^~~~
>
>drivers/infiniband/sw/siw/siw_qp_tx.c: In function
>‘siw_qp_sq_process’:
>drivers/infiniband/sw/siw/siw_qp_tx.c:1044:4: warning: this statement
>may fall through [-Wimplicit-fallthrough=]
>    siw_wqe_put_mem(wqe, tx_type);
>    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>drivers/infiniband/sw/siw/siw_qp_tx.c:1045:3: note: here
>   case SIW_OP_INVAL_STAG:
>   ^~~~
>drivers/infiniband/sw/siw/siw_qp_tx.c:1128:4: warning: this statement
>may fall through [-Wimplicit-fallthrough=]
>    siw_wqe_put_mem(wqe, tx_type);
>    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>drivers/infiniband/sw/siw/siw_qp_tx.c:1129:3: note: here
>   case SIW_OP_INVAL_STAG:
>   ^~~~
>
>Warning level 3 was used: -Wimplicit-fallthrough=3
>
>This patch is part of the ongoing efforts to enable
>-Wimplicit-fallthrough.
>
>Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>---
>
>NOTE: -Wimplicit-fallthrough will be enabled globally in v5.3. So, I
>      suggest you to take this patch for 5.3-rc1.
>
> drivers/infiniband/sw/siw/siw_qp_rx.c | 2 ++
> drivers/infiniband/sw/siw/siw_qp_tx.c | 4 ++++
> 2 files changed, 6 insertions(+)
>
>diff --git a/drivers/infiniband/sw/siw/siw_qp_rx.c
>b/drivers/infiniband/sw/siw/siw_qp_rx.c
>index 682a290bc11e..f87657a11657 100644
>--- a/drivers/infiniband/sw/siw/siw_qp_rx.c
>+++ b/drivers/infiniband/sw/siw/siw_qp_rx.c
>@@ -1212,6 +1212,8 @@ static int siw_rdmap_complete(struct siw_qp
>*qp, int error)
> 	case RDMAP_SEND_SE:
> 	case RDMAP_SEND_SE_INVAL:
> 		wqe->rqe.flags |= SIW_WQE_SOLICITED;
>+		/* Fall through */
>+
> 	case RDMAP_SEND:
> 	case RDMAP_SEND_INVAL:
> 		if (wqe->wr_status == SIW_WR_IDLE)
>diff --git a/drivers/infiniband/sw/siw/siw_qp_tx.c
>b/drivers/infiniband/sw/siw/siw_qp_tx.c
>index f0d949e2e318..43020d2040fc 100644
>--- a/drivers/infiniband/sw/siw/siw_qp_tx.c
>+++ b/drivers/infiniband/sw/siw/siw_qp_tx.c
>@@ -1042,6 +1042,8 @@ int siw_qp_sq_process(struct siw_qp *qp)
> 		case SIW_OP_SEND_REMOTE_INV:
> 		case SIW_OP_WRITE:
> 			siw_wqe_put_mem(wqe, tx_type);
>+			/* Fall through */
>+
> 		case SIW_OP_INVAL_STAG:
> 		case SIW_OP_REG_MR:
> 			if (tx_flags(wqe) & SIW_WQE_SIGNALLED)
>@@ -1126,6 +1128,8 @@ int siw_qp_sq_process(struct siw_qp *qp)
> 		case SIW_OP_READ:
> 		case SIW_OP_READ_LOCAL_INV:
> 			siw_wqe_put_mem(wqe, tx_type);
>+			/* Fall through */
>+
> 		case SIW_OP_INVAL_STAG:
> 		case SIW_OP_REG_MR:
> 			siw_sqe_complete(qp, &wqe->sqe, wqe->bytes,
>-- 
>2.21.0
>
>
Thanks Gustavo. Didn't know that becomes mandatory. Had it here and there
only, where I thought it is not obvious...but better to keep the rules
simple.

Thanks,
Bernard.


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

* Re: [PATCH] RDMA/siw: Mark expected switch fall-throughs
  2019-07-11 16:12 [PATCH] RDMA/siw: Mark expected switch fall-throughs Gustavo A. R. Silva
  2019-07-11 16:28 ` Bernard Metzler
@ 2019-07-11 18:05 ` Jason Gunthorpe
  2019-07-12 19:43   ` Gustavo A. R. Silva
  1 sibling, 1 reply; 4+ messages in thread
From: Jason Gunthorpe @ 2019-07-11 18:05 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Bernard Metzler, Doug Ledford, linux-rdma, linux-kernel

On Thu, Jul 11, 2019 at 11:12:18AM -0500, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch
> cases where we are expecting to fall through.
> 
> This patch fixes the following warnings:
> 
> drivers/infiniband/sw/siw/siw_qp_rx.c: In function ‘siw_rdmap_complete’:
> drivers/infiniband/sw/siw/siw_qp_rx.c:1214:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
>    wqe->rqe.flags |= SIW_WQE_SOLICITED;
>    ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
> drivers/infiniband/sw/siw/siw_qp_rx.c:1215:2: note: here
>   case RDMAP_SEND:
>   ^~~~
> 
> drivers/infiniband/sw/siw/siw_qp_tx.c: In function ‘siw_qp_sq_process’:
> drivers/infiniband/sw/siw/siw_qp_tx.c:1044:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
>     siw_wqe_put_mem(wqe, tx_type);
>     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/infiniband/sw/siw/siw_qp_tx.c:1045:3: note: here
>    case SIW_OP_INVAL_STAG:
>    ^~~~
> drivers/infiniband/sw/siw/siw_qp_tx.c:1128:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
>     siw_wqe_put_mem(wqe, tx_type);
>     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/infiniband/sw/siw/siw_qp_tx.c:1129:3: note: here
>    case SIW_OP_INVAL_STAG:
>    ^~~~
> 
> Warning level 3 was used: -Wimplicit-fallthrough=3
> 
> This patch is part of the ongoing efforts to enable
> -Wimplicit-fallthrough.
> 
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> 
> NOTE: -Wimplicit-fallthrough will be enabled globally in v5.3. So, I
>       suggest you to take this patch for 5.3-rc1.

Okay, I queued this for the current merge window then

Jason

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

* Re: [PATCH] RDMA/siw: Mark expected switch fall-throughs
  2019-07-11 18:05 ` Jason Gunthorpe
@ 2019-07-12 19:43   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2019-07-12 19:43 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: Bernard Metzler, Doug Ledford, linux-rdma, linux-kernel



On 7/11/19 1:05 PM, Jason Gunthorpe wrote:

>> This patch is part of the ongoing efforts to enable
>> -Wimplicit-fallthrough.
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>>
>> NOTE: -Wimplicit-fallthrough will be enabled globally in v5.3. So, I
>>       suggest you to take this patch for 5.3-rc1.
> 
> Okay, I queued this for the current merge window then
> 

Awesome. :)

Thank you both, Bernard and Jason.

--
Gustavo

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

end of thread, other threads:[~2019-07-12 20:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-11 16:12 [PATCH] RDMA/siw: Mark expected switch fall-throughs Gustavo A. R. Silva
2019-07-11 16:28 ` Bernard Metzler
2019-07-11 18:05 ` Jason Gunthorpe
2019-07-12 19:43   ` Gustavo A. R. Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).