* [PATCH] scsi: ibmvscsi_tgt: Mark expected switch fall-throughs
@ 2019-07-29 11:29 Gustavo A. R. Silva
2019-07-29 16:46 ` Kees Cook
2019-07-30 20:00 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2019-07-29 11:29 UTC (permalink / raw)
To: Michael Cyr, James E.J. Bottomley, Martin K. Petersen
Cc: linux-scsi, target-devel, linux-kernel, Gustavo A. R. Silva,
Stephen Rothwell, Kees Cook
Mark switch cases where we are expecting to fall through.
This patch fixes the following warnings (Building: powerpc allyesconfig):
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c: In function 'ibmvscsis_adapter_info':
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:1582:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (connection_broken(vscsi))
^
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:1584:2: note: here
default:
^~~~~~~
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c: In function 'ibmvscsis_ping_response':
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:2494:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
vscsi->flags |= CLIENT_FAILED;
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:2495:2: note: here
case H_DROPPED:
^~~~
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:2496:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
vscsi->flags |= RESPONSE_Q_DOWN;
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:2497:2: note: here
case H_REMOTE_PARM:
^~~~
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
index 7f9535392a93..a929fe76102b 100644
--- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
+++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
@@ -1581,6 +1581,7 @@ static long ibmvscsis_adapter_info(struct scsi_info *vscsi,
case H_PERMISSION:
if (connection_broken(vscsi))
flag_bits = (RESPONSE_Q_DOWN | CLIENT_FAILED);
+ /* Fall through */
default:
dev_err(&vscsi->dev, "adapter_info: h_copy_rdma to client failed, rc %ld\n",
rc);
@@ -2492,8 +2493,10 @@ static long ibmvscsis_ping_response(struct scsi_info *vscsi)
break;
case H_CLOSED:
vscsi->flags |= CLIENT_FAILED;
+ /* Fall through */
case H_DROPPED:
vscsi->flags |= RESPONSE_Q_DOWN;
+ /* Fall through */
case H_REMOTE_PARM:
dev_err(&vscsi->dev, "ping_response: h_send_crq failed, rc %ld\n",
rc);
--
2.22.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: ibmvscsi_tgt: Mark expected switch fall-throughs
2019-07-29 11:29 [PATCH] scsi: ibmvscsi_tgt: Mark expected switch fall-throughs Gustavo A. R. Silva
@ 2019-07-29 16:46 ` Kees Cook
2019-07-30 20:00 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Kees Cook @ 2019-07-29 16:46 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Michael Cyr, James E.J. Bottomley, Martin K. Petersen,
linux-scsi, target-devel, linux-kernel, Stephen Rothwell
On Mon, Jul 29, 2019 at 06:29:02AM -0500, Gustavo A. R. Silva wrote:
> Mark switch cases where we are expecting to fall through.
>
> This patch fixes the following warnings (Building: powerpc allyesconfig):
>
> drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c: In function 'ibmvscsis_adapter_info':
> drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:1582:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
> if (connection_broken(vscsi))
> ^
> drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:1584:2: note: here
> default:
> ^~~~~~~
> drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c: In function 'ibmvscsis_ping_response':
> drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:2494:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
> vscsi->flags |= CLIENT_FAILED;
> drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:2495:2: note: here
> case H_DROPPED:
> ^~~~
> drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:2496:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
> vscsi->flags |= RESPONSE_Q_DOWN;
> drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:2497:2: note: here
> case H_REMOTE_PARM:
> ^~~~
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
-Kees
> ---
> drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
> index 7f9535392a93..a929fe76102b 100644
> --- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
> +++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
> @@ -1581,6 +1581,7 @@ static long ibmvscsis_adapter_info(struct scsi_info *vscsi,
> case H_PERMISSION:
> if (connection_broken(vscsi))
> flag_bits = (RESPONSE_Q_DOWN | CLIENT_FAILED);
> + /* Fall through */
> default:
> dev_err(&vscsi->dev, "adapter_info: h_copy_rdma to client failed, rc %ld\n",
> rc);
> @@ -2492,8 +2493,10 @@ static long ibmvscsis_ping_response(struct scsi_info *vscsi)
> break;
> case H_CLOSED:
> vscsi->flags |= CLIENT_FAILED;
> + /* Fall through */
> case H_DROPPED:
> vscsi->flags |= RESPONSE_Q_DOWN;
> + /* Fall through */
> case H_REMOTE_PARM:
> dev_err(&vscsi->dev, "ping_response: h_send_crq failed, rc %ld\n",
> rc);
> --
> 2.22.0
>
--
Kees Cook
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: ibmvscsi_tgt: Mark expected switch fall-throughs
2019-07-29 11:29 [PATCH] scsi: ibmvscsi_tgt: Mark expected switch fall-throughs Gustavo A. R. Silva
2019-07-29 16:46 ` Kees Cook
@ 2019-07-30 20:00 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2019-07-30 20:00 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Michael Cyr, James E.J. Bottomley, Martin K. Petersen,
linux-scsi, target-devel, linux-kernel, Stephen Rothwell,
Kees Cook
Gustavo,
> Mark switch cases where we are expecting to fall through.
Applied to 5.4/scsi-queue, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-07-30 20:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29 11:29 [PATCH] scsi: ibmvscsi_tgt: Mark expected switch fall-throughs Gustavo A. R. Silva
2019-07-29 16:46 ` Kees Cook
2019-07-30 20:00 ` Martin K. Petersen
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).