diff mbox series

[37/41] scsi: st: mark expected switch fall-throughs

Message ID e0f4aa25970996146427e633bbf92be3eeee2e35.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:33 a.m. UTC
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

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

Comments

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

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:33 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: 114994 ("Missing break in switch")
> Addresses-Coverity-ID: 114995 ("Missing break in switch")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
>   drivers/scsi/st.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
> index 7ff22d3f03e3..7c7a742a5ef7 100644
> --- a/drivers/scsi/st.c
> +++ b/drivers/scsi/st.c
> @@ -337,12 +337,14 @@ static void st_analyze_sense(struct st_request *SRpnt, struct st_cmdstatus *s)
>   		switch (sense[0] & 0x7f) {
>   		case 0x71:
>   			s->deferred = 1;
> +			/* fall through */
>   		case 0x70:
>   			s->fixed_format = 1;
>   			s->flags = sense[2] & 0xe0;
>   			break;
>   		case 0x73:
>   			s->deferred = 1;
> +			/* fall through */
>   		case 0x72:
>   			s->fixed_format = 0;
>   			ucp = scsi_sense_desc_find(sense, SCSI_SENSE_BUFFERSIZE, 4);
> @@ -2721,6 +2723,7 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon
>   	switch (cmd_in) {
>   	case MTFSFM:
>   		chg_eof = 0;	/* Changed from the FSF after this */
> +		/* fall through */
>   	case MTFSF:
>   		cmd[0] = SPACE;
>   		cmd[1] = 0x01;	/* Space FileMarks */
> @@ -2735,6 +2738,7 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon
>   		break;
>   	case MTBSFM:
>   		chg_eof = 0;	/* Changed from the FSF after this */
> +		/* fall through */
>   	case MTBSF:
>   		cmd[0] = SPACE;
>   		cmd[1] = 0x01;	/* Space FileMarks */
>
Gustavo A. R. Silva Jan. 10, 2019, 7:56 p.m. UTC | #2
Hi,

Friendly ping (second one):

Who can ack/review/take this patch, please?

Thanks
--
Gustavo

On 12/19/18 6:08 PM, Gustavo A. R. Silva wrote:
> Hi,
> 
> Friendly ping:
> 
> Who can ack or review this patch, please?
> 
> Thanks
> -- 
> Gustavo
> 
> On 11/27/18 10:33 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: 114994 ("Missing break in switch")
>> Addresses-Coverity-ID: 114995 ("Missing break in switch")
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>> ---
>>   drivers/scsi/st.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
>> index 7ff22d3f03e3..7c7a742a5ef7 100644
>> --- a/drivers/scsi/st.c
>> +++ b/drivers/scsi/st.c
>> @@ -337,12 +337,14 @@ static void st_analyze_sense(struct st_request *SRpnt, struct st_cmdstatus *s)
>>           switch (sense[0] & 0x7f) {
>>           case 0x71:
>>               s->deferred = 1;
>> +            /* fall through */
>>           case 0x70:
>>               s->fixed_format = 1;
>>               s->flags = sense[2] & 0xe0;
>>               break;
>>           case 0x73:
>>               s->deferred = 1;
>> +            /* fall through */
>>           case 0x72:
>>               s->fixed_format = 0;
>>               ucp = scsi_sense_desc_find(sense, SCSI_SENSE_BUFFERSIZE, 4);
>> @@ -2721,6 +2723,7 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon
>>       switch (cmd_in) {
>>       case MTFSFM:
>>           chg_eof = 0;    /* Changed from the FSF after this */
>> +        /* fall through */
>>       case MTFSF:
>>           cmd[0] = SPACE;
>>           cmd[1] = 0x01;    /* Space FileMarks */
>> @@ -2735,6 +2738,7 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon
>>           break;
>>       case MTBSFM:
>>           chg_eof = 0;    /* Changed from the FSF after this */
>> +        /* fall through */
>>       case MTBSF:
>>           cmd[0] = SPACE;
>>           cmd[1] = 0x01;    /* Space FileMarks */
>>
Kai Mäkisara (Kolumbus) Jan. 10, 2019, 8:24 p.m. UTC | #3
> On 10 Jan 2019, at 21.56, Gustavo A. R. Silva <gustavo@embeddedor.com> wrote:
> 
> Hi,
> 
> Friendly ping (second one):
> 
> Who can ack/review/take this patch, please?
> 
Acked-by: Kai Mäkisara <kai.makisara@kolumbus.fi>

Thanks,
Kai

> Thanks
> --
> Gustavo
> 
> On 12/19/18 6:08 PM, Gustavo A. R. Silva wrote:
>> Hi,
>> Friendly ping:
>> Who can ack or review this patch, please?
>> Thanks
>> -- 
>> Gustavo
>> On 11/27/18 10:33 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: 114994 ("Missing break in switch")
>>> Addresses-Coverity-ID: 114995 ("Missing break in switch")
>>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>>> ---
>>>   drivers/scsi/st.c | 4 ++++
>>>   1 file changed, 4 insertions(+)
>>> 
>>> diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
>>> index 7ff22d3f03e3..7c7a742a5ef7 100644
>>> --- a/drivers/scsi/st.c
>>> +++ b/drivers/scsi/st.c
>>> @@ -337,12 +337,14 @@ static void st_analyze_sense(struct st_request *SRpnt, struct st_cmdstatus *s)
>>>           switch (sense[0] & 0x7f) {
>>>           case 0x71:
>>>               s->deferred = 1;
>>> +            /* fall through */
>>>           case 0x70:
>>>               s->fixed_format = 1;
>>>               s->flags = sense[2] & 0xe0;
>>>               break;
>>>           case 0x73:
>>>               s->deferred = 1;
>>> +            /* fall through */
>>>           case 0x72:
>>>               s->fixed_format = 0;
>>>               ucp = scsi_sense_desc_find(sense, SCSI_SENSE_BUFFERSIZE, 4);
>>> @@ -2721,6 +2723,7 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon
>>>       switch (cmd_in) {
>>>       case MTFSFM:
>>>           chg_eof = 0;    /* Changed from the FSF after this */
>>> +        /* fall through */
>>>       case MTFSF:
>>>           cmd[0] = SPACE;
>>>           cmd[1] = 0x01;    /* Space FileMarks */
>>> @@ -2735,6 +2738,7 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon
>>>           break;
>>>       case MTBSFM:
>>>           chg_eof = 0;    /* Changed from the FSF after this */
>>> +        /* fall through */
>>>       case MTBSF:
>>>           cmd[0] = SPACE;
>>>           cmd[1] = 0x01;    /* Space FileMarks */
>>>
Gustavo A. R. Silva Jan. 10, 2019, 8:54 p.m. UTC | #4
On 1/10/19 2:24 PM, "Kai Mäkisara (Kolumbus)" wrote:
> 
> 
>> On 10 Jan 2019, at 21.56, Gustavo A. R. Silva <gustavo@embeddedor.com> wrote:
>>
>> Hi,
>>
>> Friendly ping (second one):
>>
>> Who can ack/review/take this patch, please?
>>
> Acked-by: Kai Mäkisara <kai.makisara@kolumbus.fi>
> 

Thanks, Kai.

--
Gustavo
Martin K. Petersen Jan. 12, 2019, 2:42 a.m. UTC | #5
Kai,

>> Who can ack/review/take this patch, please?
>> 
> Acked-by: Kai Mäkisara <kai.makisara@kolumbus.fi>

Applied to 5.1/scsi-queue. Thanks!
diff mbox series

Patch

diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 7ff22d3f03e3..7c7a742a5ef7 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -337,12 +337,14 @@  static void st_analyze_sense(struct st_request *SRpnt, struct st_cmdstatus *s)
 		switch (sense[0] & 0x7f) {
 		case 0x71:
 			s->deferred = 1;
+			/* fall through */
 		case 0x70:
 			s->fixed_format = 1;
 			s->flags = sense[2] & 0xe0;
 			break;
 		case 0x73:
 			s->deferred = 1;
+			/* fall through */
 		case 0x72:
 			s->fixed_format = 0;
 			ucp = scsi_sense_desc_find(sense, SCSI_SENSE_BUFFERSIZE, 4);
@@ -2721,6 +2723,7 @@  static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon
 	switch (cmd_in) {
 	case MTFSFM:
 		chg_eof = 0;	/* Changed from the FSF after this */
+		/* fall through */
 	case MTFSF:
 		cmd[0] = SPACE;
 		cmd[1] = 0x01;	/* Space FileMarks */
@@ -2735,6 +2738,7 @@  static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon
 		break;
 	case MTBSFM:
 		chg_eof = 0;	/* Changed from the FSF after this */
+		/* fall through */
 	case MTBSF:
 		cmd[0] = SPACE;
 		cmd[1] = 0x01;	/* Space FileMarks */