diff mbox series

[32/41] scsi: myrb: Mark expected switch fall-throughs

Message ID 15cf75b544d6b2eae77ba98cd201620b44abec36.1543374820.git.gustavo@embeddedor.com (mailing list archive)
State Deferred
Headers show
Series scsi: Mark expected switch fall-throughs | expand

Commit Message

Gustavo A. R. Silva Nov. 28, 2018, 4:32 a.m. UTC
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 1465234 ("Missing break in switch")
Addresses-Coverity-ID: 1465238 ("Missing break in switch")
Addresses-Coverity-ID: 1465242 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/scsi/myrb.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Gustavo A. R. Silva Dec. 20, 2018, 12:07 a.m. UTC | #1
Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:32 PM, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> Addresses-Coverity-ID: 1465234 ("Missing break in switch")
> Addresses-Coverity-ID: 1465238 ("Missing break in switch")
> Addresses-Coverity-ID: 1465242 ("Missing break in switch")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
>   drivers/scsi/myrb.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/scsi/myrb.c b/drivers/scsi/myrb.c
> index 0642f2d0a3bb..539ac8ce4fcd 100644
> --- a/drivers/scsi/myrb.c
> +++ b/drivers/scsi/myrb.c
> @@ -1528,6 +1528,7 @@ static int myrb_ldev_queuecommand(struct Scsi_Host *shost,
>   			scmd->scsi_done(scmd);
>   			return 0;
>   		}
> +		/* fall through */
>   	case WRITE_6:
>   		lba = (((scmd->cmnd[1] & 0x1F) << 16) |
>   		       (scmd->cmnd[2] << 8) |
> @@ -1544,6 +1545,7 @@ static int myrb_ldev_queuecommand(struct Scsi_Host *shost,
>   			scmd->scsi_done(scmd);
>   			return 0;
>   		}
> +		/* fall through */
>   	case WRITE_10:
>   	case VERIFY:		/* 0x2F */
>   	case WRITE_VERIFY:	/* 0x2E */
> @@ -1560,6 +1562,7 @@ static int myrb_ldev_queuecommand(struct Scsi_Host *shost,
>   			scmd->scsi_done(scmd);
>   			return 0;
>   		}
> +		/* fall through */
>   	case WRITE_12:
>   	case VERIFY_12: /* 0xAF */
>   	case WRITE_VERIFY_12:	/* 0xAE */
>
Hannes Reinecke Dec. 20, 2018, 6:49 a.m. UTC | #2
On 12/20/18 1:07 AM, Gustavo A. R. Silva wrote:
> Hi,
> 
> Friendly ping:
> 
> Who can ack or review this patch, please?
> 
> Thanks
> -- 
> Gustavo
> 
> On 11/27/18 10:32 PM, Gustavo A. R. Silva wrote:
>> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
>> where we are expecting to fall through.
>>
>> Addresses-Coverity-ID: 1465234 ("Missing break in switch")
>> Addresses-Coverity-ID: 1465238 ("Missing break in switch")
>> Addresses-Coverity-ID: 1465242 ("Missing break in switch")
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>> ---
>>   drivers/scsi/myrb.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
Martin K. Petersen Dec. 21, 2018, 12:52 a.m. UTC | #3
Gustavo A.,

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

Applied to 4.21/scsi-queue. Thanks.
diff mbox series

Patch

diff --git a/drivers/scsi/myrb.c b/drivers/scsi/myrb.c
index 0642f2d0a3bb..539ac8ce4fcd 100644
--- a/drivers/scsi/myrb.c
+++ b/drivers/scsi/myrb.c
@@ -1528,6 +1528,7 @@  static int myrb_ldev_queuecommand(struct Scsi_Host *shost,
 			scmd->scsi_done(scmd);
 			return 0;
 		}
+		/* fall through */
 	case WRITE_6:
 		lba = (((scmd->cmnd[1] & 0x1F) << 16) |
 		       (scmd->cmnd[2] << 8) |
@@ -1544,6 +1545,7 @@  static int myrb_ldev_queuecommand(struct Scsi_Host *shost,
 			scmd->scsi_done(scmd);
 			return 0;
 		}
+		/* fall through */
 	case WRITE_10:
 	case VERIFY:		/* 0x2F */
 	case WRITE_VERIFY:	/* 0x2E */
@@ -1560,6 +1562,7 @@  static int myrb_ldev_queuecommand(struct Scsi_Host *shost,
 			scmd->scsi_done(scmd);
 			return 0;
 		}
+		/* fall through */
 	case WRITE_12:
 	case VERIFY_12: /* 0xAF */
 	case WRITE_VERIFY_12:	/* 0xAE */