Re: [PATCH] scsi/NCR5380: Avoid compiler warning when -Wimplicit-fallthrough is enabled

2019-04-09 Thread Gustavo A. R. Silva



On 4/8/19 7:22 PM, Finn Thain wrote:
> 
> It has been queued up by Martin and James on git.kernel.org. Apparently it 
> is to be pushed in the v5.2 merge window.
> 

Awesome.

Thanks
--
Gustavo


Re: [PATCH] scsi/NCR5380: Avoid compiler warning when -Wimplicit-fallthrough is enabled

2019-04-08 Thread Gustavo A. R. Silva
Hi all,

Friendly ping:

Who can take this?

Thanks

On 3/7/19 3:49 PM, Finn Thain wrote:
> Adjust comments accordingly.
> 
> Cc: Gustavo A. R. Silva 
> Cc: Michael Schmitz 
> Signed-off-by: Finn Thain 
> ---
>  drivers/scsi/NCR5380.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
> index 7fed9bb72784..fe0535affc14 100644
> --- a/drivers/scsi/NCR5380.c
> +++ b/drivers/scsi/NCR5380.c
> @@ -1932,13 +1932,13 @@ static void NCR5380_information_transfer(struct 
> Scsi_Host *instance)
>   if (!hostdata->connected)
>   return;
>  
> - /* Fall through to reject message */
> -
> + /* Reject message */
> + /* Fall through */
> + default:
>   /*
>* If we get something weird that we 
> aren't expecting,
> -  * reject it.
> +  * log it.
>*/
> - default:
>   if (tmp == EXTENDED_MESSAGE)
>   scmd_printk(KERN_INFO, cmd,
>   "rejecting unknown 
> extended message code %02x, length %d\n",
> 


Re: [PATCH] scsi: mpt3sas: Add missing breaks in switch statements

2019-02-28 Thread Gustavo A. R. Silva



On 2/27/19 8:37 AM, Martin K. Petersen wrote:
> 
> Gustavo,
> 
>> Fix the following warnings by adding the proper missing breaks:
>>
>> drivers/scsi/mpt3sas/mpt3sas_base.c: In function 
>> ‘_base_display_OEMs_branding’:
>> drivers/scsi/mpt3sas/mpt3sas_base.c:3548:4: warning: this statement may fall 
>> thr
> 
> Applied to 5.1/scsi-queue, thanks.
> 

Thank you, Martin.

There many patches in this series:

https://lore.kernel.org/patchwork/project/lkml/list/?series=374317

that never were acked/reviewed even after I have
pinged twice.

I wonder if you could apply them.

Thanks
--
Gustavo


[PATCH v2] scsi: NCR5380: Mark expected switch fall-through

2019-02-28 Thread 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 warning:

In file included from drivers/scsi/dmx3191d.c:48:
drivers/scsi/NCR5380.c: In function ‘NCR5380_information_transfer’:
drivers/scsi/NCR5380.c:1933:9: warning: this statement may fall through 
[-Wimplicit-fallthrough=]
  if (!hostdata->connected)
 ^
drivers/scsi/NCR5380.c:1937:5: note: here
 default:
 ^~~

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

Notice that, in this particular case, the code comment is modified
in accordance with what GCC is expecting to find.

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

Signed-off-by: Gustavo A. R. Silva 
---
Changes in v2:
 - Update commit log.
 - Move code comment after the default label and
   retain reason for fall-through in comment as
   requested by Michael Schmitz.

 drivers/scsi/NCR5380.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 01c23d27f290..985d1c053578 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -1933,13 +1933,12 @@ static void NCR5380_information_transfer(struct 
Scsi_Host *instance)
if (!hostdata->connected)
return;
 
-   /* Fall through to reject message */
-
+   /* Fall through - to reject message */
+   default:
/*
-* If we get something weird that we 
aren't expecting,
-* reject it.
+* If we get something weird that we
+* aren't expecting, reject it.
 */
-   default:
if (tmp == EXTENDED_MESSAGE)
scmd_printk(KERN_INFO, cmd,
"rejecting unknown 
extended message code %02x, length %d\n",
-- 
2.21.0



Re: [PATCH] scsi: aacraid: Fix missing break in switch statement

2019-02-27 Thread Gustavo A. R. Silva



On 2/27/19 8:33 AM, Martin K. Petersen wrote:
> 
> Gustavo,
> 
>> Add missing break statement and fix identation issue.
> 
> So much bad indentation in this driver. Tried various tab widths and it
> is still all over the place.
> 
> Anyway. After staring at the firmware header I have convinced myself
> that your fix is correct. Applied to 5.1/scsi-queue.
> 

That's great.

Thanks, Martin.

--
Gustavo


[PATCH] scsi: mpt3sas: Add missing breaks in switch statements

2019-02-15 Thread Gustavo A. R. Silva
Fix the following warnings by adding the proper missing breaks:

drivers/scsi/mpt3sas/mpt3sas_base.c: In function ‘_base_display_OEMs_branding’:
drivers/scsi/mpt3sas/mpt3sas_base.c:3548:4: warning: this statement may fall 
through [-Wimplicit-fallthrough=]
switch (ioc->pdev->subsystem_device) {
^~
drivers/scsi/mpt3sas/mpt3sas_base.c:3566:3: note: here
   case MPI2_MFGPAGE_DEVID_SAS2308_2:
   ^~~~
drivers/scsi/mpt3sas/mpt3sas_base.c:3567:4: warning: this statement may fall 
through [-Wimplicit-fallthrough=]
switch (ioc->pdev->subsystem_device) {
^~
drivers/scsi/mpt3sas/mpt3sas_base.c:3601:3: note: here
   case MPI25_MFGPAGE_DEVID_SAS3008:
   ^~~~
drivers/scsi/mpt3sas/mpt3sas_base.c:3735:4: warning: this statement may fall 
through [-Wimplicit-fallthrough=]
switch (ioc->pdev->subsystem_device) {
^~
drivers/scsi/mpt3sas/mpt3sas_base.c:3745:3: note: here
   case MPI2_MFGPAGE_DEVID_SAS2308_2:
   ^~~~
drivers/scsi/mpt3sas/mpt3sas_base.c:3746:4: warning: this statement may fall 
through [-Wimplicit-fallthrough=]
switch (ioc->pdev->subsystem_device) {
^~
drivers/scsi/mpt3sas/mpt3sas_base.c:3768:3: note: here
   default:
   ^~~

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 
---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c 
b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 0a6cb8f0680c..e57774472e75 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -3563,6 +3563,7 @@ _base_display_OEMs_branding(struct MPT3SAS_ADAPTER *ioc)
 ioc->pdev->subsystem_device);
break;
}
+   break;
case MPI2_MFGPAGE_DEVID_SAS2308_2:
switch (ioc->pdev->subsystem_device) {
case MPT2SAS_INTEL_RS25GB008_SSDID:
@@ -3598,6 +3599,7 @@ _base_display_OEMs_branding(struct MPT3SAS_ADAPTER *ioc)
 ioc->pdev->subsystem_device);
break;
}
+   break;
case MPI25_MFGPAGE_DEVID_SAS3008:
switch (ioc->pdev->subsystem_device) {
case MPT3SAS_INTEL_RMS3JC080_SSDID:
@@ -3742,6 +3744,7 @@ _base_display_OEMs_branding(struct MPT3SAS_ADAPTER *ioc)
 ioc->pdev->subsystem_device);
break;
}
+   break;
case MPI2_MFGPAGE_DEVID_SAS2308_2:
switch (ioc->pdev->subsystem_device) {
case MPT2SAS_HP_2_4_INTERNAL_SSDID:
@@ -3765,6 +3768,7 @@ _base_display_OEMs_branding(struct MPT3SAS_ADAPTER *ioc)
 ioc->pdev->subsystem_device);
break;
}
+   break;
default:
ioc_info(ioc, "HP SAS HBA: Subsystem ID: 0x%X\n",
 ioc->pdev->subsystem_device);
-- 
2.20.1



[PATCH] scsi: aacraid: Fix missing break in switch statement

2019-02-15 Thread Gustavo A. R. Silva
Add missing break statement and fix identation issue.

This bug was found thanks to the ongoing efforts to enable
-Wimplicit-fallthrough.

Fixes: 9cb62fa24e0d ("aacraid: Log firmware AIF messages")
Cc: sta...@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/aacraid/commsup.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 0bdc6b0f725f..e67e032936ef 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -1303,8 +1303,9 @@ static void aac_handle_aif(struct aac_dev * dev, struct 
fib * fibptr)
  ADD : DELETE;
break;
}
-   case AifBuManagerEvent:
-   aac_handle_aif_bu(dev, aifcmd);
+   break;
+   case AifBuManagerEvent:
+   aac_handle_aif_bu(dev, aifcmd);
break;
}
 
-- 
2.20.1



[PATCH] xen-scsiback: mark expected switch fall-through

2019-02-12 Thread 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 warning:

drivers/xen/xen-scsiback.c: In function ‘scsiback_frontend_changed’:
drivers/xen/xen-scsiback.c:1185:6: warning: this statement may fall through 
[-Wimplicit-fallthrough=]
   if (xenbus_dev_is_online(dev))
  ^
drivers/xen/xen-scsiback.c:1188:2: note: here
  case XenbusStateUnknown:
  ^~~~

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

Notice that, in this particular case, the code comment is modified
in accordance with what GCC is expecting to find.

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

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/xen/xen-scsiback.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
index e59937293a32..ba0942e481bc 100644
--- a/drivers/xen/xen-scsiback.c
+++ b/drivers/xen/xen-scsiback.c
@@ -1184,7 +1184,7 @@ static void scsiback_frontend_changed(struct 
xenbus_device *dev,
xenbus_switch_state(dev, XenbusStateClosed);
if (xenbus_dev_is_online(dev))
break;
-   /* fall through if not online */
+   /* fall through - if not online */
case XenbusStateUnknown:
device_unregister(&dev->dev);
break;
-- 
2.20.1



[PATCH] scsi: mptfusion: mark expected switch fall-through

2019-02-11 Thread 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 warning:

drivers/message/fusion/mptbase.c: In function ‘mptbase_reply’:
drivers/message/fusion/mptbase.c:643:6: warning: this statement may fall 
through [-Wimplicit-fallthrough=]
   if (event != MPI_EVENT_EVENT_CHANGE)
  ^
drivers/message/fusion/mptbase.c:646:2: note: here
  case MPI_FUNCTION_CONFIG:
  ^~~~

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

Notice that, in this particular case, the code comment is modified
in accordance with what GCC is expecting to find.

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

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/message/fusion/mptbase.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index ba551d8dfba4..d8882b0a1338 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -642,7 +642,7 @@ mptbase_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *req, 
MPT_FRAME_HDR *reply)
freereq = 0;
if (event != MPI_EVENT_EVENT_CHANGE)
break;
-   /* else: fall through */
+   /* fall through */
case MPI_FUNCTION_CONFIG:
case MPI_FUNCTION_SAS_IO_UNIT_CONTROL:
ioc->mptbase_cmds.status |= MPT_MGMT_STATUS_COMMAND_GOOD;
-- 
2.20.1



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

2019-01-10 Thread Gustavo A. R. Silva




On 1/10/19 2:24 PM, "Kai Mäkisara (Kolumbus)" wrote:




On 10 Jan 2019, at 21.56, Gustavo A. R. Silva  wrote:

Hi,

Friendly ping (second one):

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


Acked-by: Kai Mäkisara 



Thanks, Kai.

--
Gustavo



Re: [PATCH 10/41] scsi: bfa: bfa_fcs_lport: Mark expected switch fall-throughs

2019-01-10 Thread Gustavo A. R. Silva

Hi,

Friendly ping (second one):

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

Thanks
--
Gustavo

On 12/19/18 9:39 AM, Gustavo A. R. Silva wrote:

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:27 PM, Gustavo A. R. Silva wrote:

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

Notice that, in this particular case, I replaced "!!! fall through !!!"
with a "fall through" annotation, which is what GCC is expecting to
find.

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/bfa/bfa_fcs_lport.c | 8 ++--
  1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
index b4f2c1d8742e..646f09f66443 100644
--- a/drivers/scsi/bfa/bfa_fcs_lport.c
+++ b/drivers/scsi/bfa/bfa_fcs_lport.c
@@ -6430,9 +6430,7 @@ bfa_fcs_vport_sm_logo_for_stop(struct bfa_fcs_vport_s 
*vport,
  switch (event) {
  case BFA_FCS_VPORT_SM_OFFLINE:
  bfa_sm_send_event(vport->lps, BFA_LPS_SM_OFFLINE);
-    /*
- * !!! fall through !!!
- */
+    /* fall through */
  case BFA_FCS_VPORT_SM_RSP_OK:
  case BFA_FCS_VPORT_SM_RSP_ERROR:
@@ -6458,9 +6456,7 @@ bfa_fcs_vport_sm_logo(struct bfa_fcs_vport_s *vport,
  switch (event) {
  case BFA_FCS_VPORT_SM_OFFLINE:
  bfa_sm_send_event(vport->lps, BFA_LPS_SM_OFFLINE);
-    /*
- * !!! fall through !!!
- */
+    /* fall through */
  case BFA_FCS_VPORT_SM_RSP_OK:
  case BFA_FCS_VPORT_SM_RSP_ERROR:



Re: [PATCH 24/41] scsi: lpfc: lpfc_hbadisc: Mark expected switch fall-throughs

2019-01-10 Thread Gustavo A. R. Silva

Hi,

Friendly ping (second one):

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

Thanks
--
Gustavo

On 11/27/18 10:31 PM, Gustavo A. R. Silva wrote:

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

Notice that, in this particular case, I replaced "Drop thru" with a
"fall through" annotation, which is what GCC is expecting to find.

Addresses-Coverity-ID: 114976 ("Missing break in switch")
Addresses-Coverity-ID: 114977 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/lpfc/lpfc_hbadisc.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index 6c2fb55d739b..1a61806739ff 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -4645,9 +4645,11 @@ lpfc_check_sli_ndlp(struct lpfc_hba *phba,
case CMD_GEN_REQUEST64_CR:
if (iocb->context_un.ndlp == ndlp)
return 1;
+   /* fall through */
case CMD_ELS_REQUEST64_CR:
if (icmd->un.elsreq64.remoteID == ndlp->nlp_DID)
return 1;
+   /* fall through */
case CMD_XMIT_ELS_RSP64_CX:
if (iocb->context1 == (uint8_t *) ndlp)
return 1;
@@ -5791,7 +5793,7 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
  
  	case LPFC_LINK_UP:

lpfc_issue_clear_la(phba, vport);
-   /* Drop thru */
+   /* fall through */
case LPFC_LINK_UNKNOWN:
case LPFC_WARM_START:
case LPFC_INIT_START:



Re: [PATCH 34/41] scsi: osst: mark expected switch fall-throughs

2019-01-10 Thread Gustavo A. R. Silva

Hi,

Friendly ping (second one):

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

Thanks
--
Gustavo

On 12/19/18 6:07 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: 114983 ("Missing break in switch")
Addresses-Coverity-ID: 114984 ("Missing break in switch")
Addresses-Coverity-ID: 114985 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/osst.c | 6 ++
  1 file changed, 6 insertions(+)

diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index 664c1238a87f..7e877b43785d 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -216,12 +216,14 @@ static void osst_analyze_sense(struct osst_request 
*SRpnt, struct st_cmdstatus *
  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);
@@ -591,6 +593,7 @@ static void osst_init_aux(struct osst_tape * STp, int 
frame_type, int frame_seq_
  dat->dat_list[0].flags    = frame_type==OS_FRAME_TYPE_MARKER?
  OS_DAT_FLAGS_MARK:OS_DAT_FLAGS_DATA;
  dat->dat_list[0].reserved = 0;
+    /* fall through */
    case    OS_FRAME_TYPE_EOD:
  aux->update_frame_cntr    = htonl(0);
  par->partition_num    = OS_DATA_PARTITION;
@@ -4086,6 +4089,7 @@ static int osst_int_ioctl(struct osst_tape * STp, struct 
osst_request ** aSRpnt,
  switch (cmd_in) {
   case MTFSFM:
  chg_eof = 0; /* Changed from the FSF after this */
+    /* fall through */
   case MTFSF:
  if (STp->raw)
 return (-EIO);
@@ -4101,6 +4105,7 @@ static int osst_int_ioctl(struct osst_tape * STp, struct 
osst_request ** aSRpnt,
   case MTBSF:
  chg_eof = 0; /* Changed from the FSF after this */
+    /* fall through */
   case MTBSFM:
  if (STp->raw)
 return (-EIO);
@@ -4312,6 +4317,7 @@ static int osst_int_ioctl(struct osst_tape * STp, struct 
osst_request ** aSRpnt,
 name, STp->block_size);
   return 0;
   }
+    /* fall through */
   case MTSETDENSITY:   /* Set tape density */
   case MTSETDRVBUFFER: /* Set drive buffering */
   case SET_DENS_AND_BLK:   /* Set density and block size */



Re: [PATCH 35/41] scsi: ppa: mark expected switch fall-through

2019-01-10 Thread Gustavo A. R. Silva

Hi,

Friendly ping (second one):

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

Thanks
--
Gustavo

On 12/19/18 6:07 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: 114988 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/ppa.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c
index ee86a0c62dbf..d2ba5458 100644
--- a/drivers/scsi/ppa.c
+++ b/drivers/scsi/ppa.c
@@ -717,6 +717,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd 
*cmd)
  }
  cmd->SCp.phase++;
  }
+    /* fall through */
  case 2:    /* Phase 2 - We are now talking to the scsi bus */
  if (!ppa_select(dev, scmd_id(cmd))) {



Re: [PATCH 33/41] scsi: osd: osd_initiator: mark expected switch fall-throughs

2019-01-10 Thread Gustavo A. R. Silva

Hi,

Friendly ping (second one):

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

Thanks
--
Gustavo

On 12/19/18 6:07 PM, 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.

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/osd/osd_initiator.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
index 60cf7c5eb880..cb26f26d5ec1 100644
--- a/drivers/scsi/osd/osd_initiator.c
+++ b/drivers/scsi/osd/osd_initiator.c
@@ -1849,6 +1849,7 @@ int osd_req_decode_sense_full(struct osd_request *or,
  32, 1, dump, sizeof(dump), true);
  OSD_SENSE_PRINT2("response_integrity [%s]\n", dump);
  }
+    /* fall through */
  case osd_sense_attribute_identification:
  {
  struct osd_sense_attributes_data_descriptor
@@ -1879,7 +1880,7 @@ int osd_req_decode_sense_full(struct osd_request *or,
  attr_page, attr_id);
  }
  }
-    /*These are not legal for OSD*/
+    /* fall through - These are not legal for OSD */
  case scsi_sense_field_replaceable_unit:
  OSD_SENSE_PRINT2("scsi_sense_field_replaceable_unit\n");
  break;



Re: [PATCH 06/41] scsi: aic7xxx: mark expected switch fall-throughs

2019-01-10 Thread Gustavo A. R. Silva

Hi,

Friendly ping (second one):

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

Thanks
--
Gustavo

On 12/19/18 9:37 AM, Gustavo A. R. Silva wrote:

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:26 PM, Gustavo A. R. Silva wrote:

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

Notice that, in some cases, I replaced "FALLTHROUGH" with a "fall through"
annotation and then placed it at the bottom of the corresponding switch
case, which is what GCC is expecting to find.

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/aic7xxx/aic7xxx_core.c | 12 +---
  1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c 
b/drivers/scsi/aic7xxx/aic7xxx_core.c
index f3362f4ab16e..d4a7263e4b8f 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -4920,24 +4920,30 @@ ahc_fini_scbdata(struct ahc_softc *ahc)
  }
  ahc_dma_tag_destroy(ahc, scb_data->sg_dmat);
  }
+    /* fall through */
  case 6:
  ahc_dmamap_unload(ahc, scb_data->sense_dmat,
    scb_data->sense_dmamap);
+    /* fall through */
  case 5:
  ahc_dmamem_free(ahc, scb_data->sense_dmat, scb_data->sense,
  scb_data->sense_dmamap);
  ahc_dmamap_destroy(ahc, scb_data->sense_dmat,
 scb_data->sense_dmamap);
+    /* fall through */
  case 4:
  ahc_dma_tag_destroy(ahc, scb_data->sense_dmat);
+    /* fall through */
  case 3:
  ahc_dmamap_unload(ahc, scb_data->hscb_dmat,
    scb_data->hscb_dmamap);
+    /* fall through */
  case 2:
  ahc_dmamem_free(ahc, scb_data->hscb_dmat, scb_data->hscbs,
  scb_data->hscb_dmamap);
  ahc_dmamap_destroy(ahc, scb_data->hscb_dmat,
 scb_data->hscb_dmamap);
+    /* fall through */
  case 1:
  ahc_dma_tag_destroy(ahc, scb_data->hscb_dmat);
  break;
@@ -6002,8 +6008,8 @@ ahc_search_qinfifo(struct ahc_softc *ahc, int target, 
char channel,
  if ((scb->flags & SCB_ACTIVE) == 0)
  printk("Inactive SCB in Waiting List\n");
  ahc_done(ahc, scb);
-    /* FALLTHROUGH */
  }
+    /* fall through */
  case SEARCH_REMOVE:
  next = ahc_rem_wscb(ahc, next, prev);
  break;
@@ -7008,8 +7014,8 @@ ahc_download_instr(struct ahc_softc *ahc, u_int instrptr, 
uint8_t *dconsts)
  }
  address -= address_offset;
  fmt3_ins->address = address;
-    /* FALLTHROUGH */
  }
+    /* fall through */
  case AIC_OP_OR:
  case AIC_OP_AND:
  case AIC_OP_XOR:
@@ -7035,7 +7041,7 @@ ahc_download_instr(struct ahc_softc *ahc, u_int instrptr, 
uint8_t *dconsts)
  fmt1_ins->opcode = AIC_OP_AND;
  fmt1_ins->immediate = 0xff;
  }
-    /* FALLTHROUGH */
+    /* fall through */
  case AIC_OP_ROL:
  if ((ahc->features & AHC_ULTRA2) != 0) {
  int i, count;



Re: [PATCH 38/41] scsi: sym53c8xx_2: sym_hipd: mark expected switch fall-throughs

2019-01-10 Thread Gustavo A. R. Silva

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:34 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: 114996 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/sym53c8xx_2/sym_hipd.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c 
b/drivers/scsi/sym53c8xx_2/sym_hipd.c
index 0a2a54517b15..054fb0599263 100644
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.c
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c
@@ -3072,6 +3072,7 @@ static void sym_sir_bad_scsi_status(struct sym_hcb *np, 
int num, struct sym_ccb
  sym_print_addr(cp->cmd, "%s\n",
  s_status == S_BUSY ? "BUSY" : "QUEUE FULL\n");
  }
+    /* fall through */
  default:    /* S_INT, S_INT_COND_MET, S_CONFLICT */
  sym_complete_error (np, cp);
  break;
@@ -4632,6 +4633,7 @@ static void sym_int_sir(struct sym_hcb *np)
   *  Negotiation failed.
   *  Target does not want answer message.
   */
+    /* fall through */
  case SIR_NEGO_PROTO:
  sym_nego_default(np, tp, cp);
  goto out;



Re: [PATCH 05/41] scsi: aic7xxx: aic79xx: mark expected switch fall-through

2019-01-10 Thread Gustavo A. R. Silva

Hi,

Friendly ping (second one):

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

Thanks
--
Gustavo

On 12/19/18 9:36 AM, Gustavo A. R. Silva wrote:

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:26 PM, Gustavo A. R. Silva wrote:

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

Notice that, in some cases, I replaced "FALLTHROUGH" with a "fall through"
annotation and then placed it at the bottom of the corresponding switch
case, which is what GCC is expecting to find.

Addresses-Coverity-ID: 114961 ("Missing break in switch")
Addresses-Coverity-ID: 114962 ("Missing break in switch")
Addresses-Coverity-ID: 114963 ("Missing break in switch")
Addresses-Coverity-ID: 114964 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/aic7xxx/aic79xx_core.c | 14 +-
  1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c 
b/drivers/scsi/aic7xxx/aic79xx_core.c
index 9ee75c9a9aa1..7e5044bf05c0 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -2285,6 +2285,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
  switch (scb->hscb->task_management) {
  case SIU_TASKMGMT_ABORT_TASK:
  tag = SCB_GET_TAG(scb);
+    /* fall through */
  case SIU_TASKMGMT_ABORT_TASK_SET:
  case SIU_TASKMGMT_CLEAR_TASK_SET:
  lun = scb->hscb->lun;
@@ -2295,6 +2296,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
  break;
  case SIU_TASKMGMT_LUN_RESET:
  lun = scb->hscb->lun;
+    /* fall through */
  case SIU_TASKMGMT_TARGET_RESET:
  {
  struct ahd_devinfo devinfo;
@@ -6550,8 +6552,8 @@ ahd_fini_scbdata(struct ahd_softc *ahd)
  kfree(sns_map);
  }
  ahd_dma_tag_destroy(ahd, scb_data->sense_dmat);
-    /* FALLTHROUGH */
  }
+    /* fall through */
  case 6:
  {
  struct map_node *sg_map;
@@ -6565,8 +6567,8 @@ ahd_fini_scbdata(struct ahd_softc *ahd)
  kfree(sg_map);
  }
  ahd_dma_tag_destroy(ahd, scb_data->sg_dmat);
-    /* FALLTHROUGH */
  }
+    /* fall through */
  case 5:
  {
  struct map_node *hscb_map;
@@ -7209,6 +7211,7 @@ ahd_init(struct ahd_softc *ahd)
  case FLX_CSTAT_OVER:
  case FLX_CSTAT_UNDER:
  warn_user++;
+    /* fall through */
  case FLX_CSTAT_INVALID:
  case FLX_CSTAT_OKAY:
  if (warn_user == 0 && bootverbose == 0)
@@ -8413,7 +8416,7 @@ ahd_search_scb_list(struct ahd_softc *ahd, int target, 
char channel,
  if ((scb->flags & SCB_ACTIVE) == 0)
  printk("Inactive SCB in Waiting List\n");
  ahd_done_with_status(ahd, scb, status);
-    /* FALLTHROUGH */
+    /* fall through */
  case SEARCH_REMOVE:
  ahd_rem_wscb(ahd, scbid, prev, next, tid);
  *list_tail = prev;
@@ -8422,6 +8425,7 @@ ahd_search_scb_list(struct ahd_softc *ahd, int target, 
char channel,
  break;
  case SEARCH_PRINT:
  printk("0x%x ", scbid);
+    /* fall through */
  case SEARCH_COUNT:
  prev = scbid;
  break;
@@ -9547,8 +9551,8 @@ ahd_download_instr(struct ahd_softc *ahd, u_int instrptr, 
uint8_t *dconsts)
  {
  fmt3_ins = &instr.format3;
  fmt3_ins->address = ahd_resolve_seqaddr(ahd, fmt3_ins->address);
-    /* FALLTHROUGH */
  }
+    /* fall through */
  case AIC_OP_OR:
  case AIC_OP_AND:
  case AIC_OP_XOR:
@@ -9559,7 +9563,7 @@ ahd_download_instr(struct ahd_softc *ahd, u_int instrptr, 
uint8_t *dconsts)
  fmt1_ins->immediate = dconsts[fmt1_ins->immediate];
  }
  fmt1_ins->parity = 0;
-    /* FALLTHROUGH */
+    /* fall through */
  case AIC_OP_ROL:
  {
  int i, count;



Re: [PATCH 07/41] scsi: be2iscsi: be_iscsi: Mark expected switch fall-through

2019-01-10 Thread Gustavo A. R. Silva

Hi,

Friendly ping (second one):

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

Thanks
--
Gustavo

On 12/19/18 9:37 AM, Gustavo A. R. Silva wrote:

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:26 PM, Gustavo A. R. Silva wrote:

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

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/be2iscsi/be_iscsi.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c
index 96b96e2ab91a..ed1bd369baa0 100644
--- a/drivers/scsi/be2iscsi/be_iscsi.c
+++ b/drivers/scsi/be2iscsi/be_iscsi.c
@@ -679,6 +679,7 @@ int beiscsi_set_param(struct iscsi_cls_conn *cls_conn,
  case ISCSI_PARAM_MAX_XMIT_DLENGTH:
  if (conn->max_xmit_dlength > 65536)
  conn->max_xmit_dlength = 65536;
+    /* fall through */
  default:
  return 0;
  }



Re: [PATCH 08/41] scsi: be2iscsi: be_main: Mark expected switch fall-through

2019-01-10 Thread Gustavo A. R. Silva

Hi,

Friendly ping (second one):

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

Thanks
--
Gustavo

On 12/19/18 9:38 AM, Gustavo A. R. Silva wrote:

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:27 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: 1357387 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/be2iscsi/be_main.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index effb6fc95af4..b6449da1320c 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -1539,6 +1539,7 @@ beiscsi_hdl_get_handle(struct beiscsi_conn *beiscsi_conn,
  break;
  case UNSOL_DATA_DIGEST_ERROR_NOTIFY:
  error = 1;
+    /* fall through */
  case UNSOL_DATA_NOTIFY:
  pasync_handle = pasync_ctx->async_entry[ci].data;
  break;



Re: [PATCH 09/41] scsi: bfa: bfa_fcpim: Mark expected switch fall-throughs

2019-01-10 Thread Gustavo A. R. Silva

Hi,

Friendly ping (second one):

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

Thanks
--
Gustavo

On 12/19/18 9:38 AM, Gustavo A. R. Silva wrote:

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:27 PM, Gustavo A. R. Silva wrote:

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

Notice that I replaced "Fall through !!!" with a "fall through"
annotation, which is what GCC is expecting to find.

Addresses-Coverity-ID: 114971 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/bfa/bfa_fcpim.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c
index 2c85f5b1f9c1..7e996bcf026c 100644
--- a/drivers/scsi/bfa/bfa_fcpim.c
+++ b/drivers/scsi/bfa/bfa_fcpim.c
@@ -2586,6 +2586,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim)
  case FCP_IODIR_RW:
  bfa_stats(itnim, input_reqs);
  bfa_stats(itnim, output_reqs);
+    /* fall through */
  default:
  bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_fn_lpu(ioim->bfa));
  }
@@ -2820,6 +2821,7 @@ bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
  case BFI_IOIM_STS_TIMEDOUT:
  bfa_stats(ioim->itnim, iocomp_timedout);
+    /* fall through */
  case BFI_IOIM_STS_ABORTED:
  rsp->io_status = BFI_IOIM_STS_ABORTED;
  bfa_stats(ioim->itnim, iocomp_aborted);
@@ -3215,9 +3217,7 @@ bfa_tskim_sm_cleanup_qfull(struct bfa_tskim_s *tskim,
  switch (event) {
  case BFA_TSKIM_SM_DONE:
  bfa_reqq_wcancel(&tskim->reqq_wait);
-    /*
- * Fall through !!!
- */
+    /* fall through */
  case BFA_TSKIM_SM_QRESUME:
  bfa_sm_set_state(tskim, bfa_tskim_sm_cleanup);
  bfa_tskim_send_abort(tskim);



Re: [PATCH 11/41] scsi: bfa: bfa_fcs_rport: Mark expected switch fall-throughs

2019-01-10 Thread Gustavo A. R. Silva

Hi,

Friendly ping (second one):

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

Thanks
--
Gustavo

On 12/19/18 9:39 AM, Gustavo A. R. Silva wrote:

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:27 PM, Gustavo A. R. Silva wrote:

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

Notice that I replaced "!! fall through !!" and "!!! fall through !!!"
comments with "fall through" annotations, which is what GCC is
expecting to find.

Addresses-Coverity-ID: 744899 ("Missing break in switch")
Addresses-Coverity-ID: 744900 ("Missing break in switch")
Addresses-Coverity-ID: 744901 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/bfa/bfa_fcs_rport.c | 19 +++
  1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/drivers/scsi/bfa/bfa_fcs_rport.c b/drivers/scsi/bfa/bfa_fcs_rport.c
index de50349a39ce..1e400f2aaece 100644
--- a/drivers/scsi/bfa/bfa_fcs_rport.c
+++ b/drivers/scsi/bfa/bfa_fcs_rport.c
@@ -427,17 +427,13 @@ bfa_fcs_rport_sm_plogi(struct bfa_fcs_rport_s *rport, 
enum rport_event event)
  case RPSM_EVENT_LOGO_RCVD:
  bfa_fcs_rport_send_logo_acc(rport);
-    /*
- * !! fall through !!
- */
+    /* fall through */
  case RPSM_EVENT_PRLO_RCVD:
  if (rport->prlo == BFA_TRUE)
  bfa_fcs_rport_send_prlo_acc(rport);
  bfa_fcxp_discard(rport->fcxp);
-    /*
- * !! fall through !!
- */
+    /* fall through */
  case RPSM_EVENT_FAILED:
  if (rport->plogi_retries < BFA_FCS_RPORT_MAX_RETRIES) {
  rport->plogi_retries++;
@@ -868,9 +864,7 @@ bfa_fcs_rport_sm_adisc_online(struct bfa_fcs_rport_s *rport,
   * At least go offline when a PLOGI is received.
   */
  bfa_fcxp_discard(rport->fcxp);
-    /*
- * !!! fall through !!!
- */
+    /* fall through */
  case RPSM_EVENT_FAILED:
  case RPSM_EVENT_ADDRESS_CHANGE:
@@ -1056,6 +1050,7 @@ bfa_fcs_rport_sm_fc4_logosend(struct bfa_fcs_rport_s 
*rport,
  case RPSM_EVENT_LOGO_RCVD:
  bfa_fcs_rport_send_logo_acc(rport);
+    /* fall through */
  case RPSM_EVENT_PRLO_RCVD:
  if (rport->prlo == BFA_TRUE)
  bfa_fcs_rport_send_prlo_acc(rport);
@@ -1144,9 +1139,7 @@ bfa_fcs_rport_sm_hcb_offline(struct bfa_fcs_rport_s 
*rport,
  bfa_fcs_rport_send_plogiacc(rport, NULL);
  break;
  }
-    /*
- * !! fall through !!
- */
+    /* fall through */
  case RPSM_EVENT_ADDRESS_CHANGE:
  if (!bfa_fcs_lport_is_online(rport->port)) {
@@ -1303,6 +1296,7 @@ bfa_fcs_rport_sm_hcb_logosend(struct bfa_fcs_rport_s 
*rport,
  case RPSM_EVENT_LOGO_RCVD:
  bfa_fcs_rport_send_logo_acc(rport);
+    /* fall through */
  case RPSM_EVENT_PRLO_RCVD:
  if (rport->prlo == BFA_TRUE)
  bfa_fcs_rport_send_prlo_acc(rport);
@@ -1346,6 +1340,7 @@ bfa_fcs_rport_sm_logo_sending(struct bfa_fcs_rport_s 
*rport,
  case RPSM_EVENT_LOGO_RCVD:
  bfa_fcs_rport_send_logo_acc(rport);
+    /* fall through */
  case RPSM_EVENT_PRLO_RCVD:
  if (rport->prlo == BFA_TRUE)
  bfa_fcs_rport_send_prlo_acc(rport);



Re: [PATCH 12/41] scsi: bfa: bfa_ioc: Mark expected switch fall-throughs

2019-01-10 Thread Gustavo A. R. Silva

Hi,

Friendly ping (second one):

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

Thanks
--
Gustavo

On 12/19/18 9:39 AM, Gustavo A. R. Silva wrote:

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:27 PM, Gustavo A. R. Silva wrote:

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

Notice that, in this particular case, I replaced "!!! fall through !!!"
comment with "fall through" annotations, which is what GCC is expecting
to find.

Addresses-Coverity-ID: 146155 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/bfa/bfa_ioc.c | 9 +++--
  1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c
index 16d3aeb0e572..32b24e51cce6 100644
--- a/drivers/scsi/bfa/bfa_ioc.c
+++ b/drivers/scsi/bfa/bfa_ioc.c
@@ -978,9 +978,7 @@ bfa_iocpf_sm_enabling(struct bfa_iocpf_s *iocpf, enum 
iocpf_event event)
  case IOCPF_E_INITFAIL:
  bfa_iocpf_timer_stop(ioc);
-    /*
- * !!! fall through !!!
- */
+    /* fall through */
  case IOCPF_E_TIMEOUT:
  writel(1, ioc->ioc_regs.ioc_sem_reg);
@@ -1056,9 +1054,7 @@ bfa_iocpf_sm_disabling(struct bfa_iocpf_s *iocpf, enum 
iocpf_event event)
  case IOCPF_E_FAIL:
  bfa_iocpf_timer_stop(ioc);
-    /*
- * !!! fall through !!!
- */
+    /* fall through */
  case IOCPF_E_TIMEOUT:
  bfa_ioc_set_cur_ioc_fwstate(ioc, BFI_IOC_FAIL);
@@ -6007,6 +6003,7 @@ bfa_dconf_sm_final_sync(struct bfa_dconf_mod_s *dconf,
  case BFA_DCONF_SM_IOCDISABLE:
  case BFA_DCONF_SM_FLASH_COMP:
  bfa_timer_stop(&dconf->timer);
+    /* fall through */
  case BFA_DCONF_SM_TIMEOUT:
  bfa_sm_set_state(dconf, bfa_dconf_sm_uninit);
  bfa_fsm_send_event(&dconf->bfa->iocfc, IOCFC_E_DCONF_DONE);



Re: [PATCH 13/41] scsi: csiostor: csio_wr: mark expected switch fall-through

2019-01-10 Thread Gustavo A. R. Silva

Hi,

Friendly ping (second one):

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

Martin: apparently, the only maintainers for
this driver are you and James.

Thanks
--
Gustavo

On 12/19/18 9:39 AM, Gustavo A. R. Silva wrote:

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:28 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: 1056538 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/csiostor/csio_wr.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/csiostor/csio_wr.c b/drivers/scsi/csiostor/csio_wr.c
index dc12933533d5..b6861ea66c9f 100644
--- a/drivers/scsi/csiostor/csio_wr.c
+++ b/drivers/scsi/csiostor/csio_wr.c
@@ -808,6 +808,7 @@ csio_wr_destroy_queues(struct csio_hw *hw, bool cmd)
  csio_q_eqid(hw, i) = CSIO_MAX_QID;
  }
+    /* fall through */
  case CSIO_INGRESS:
  if (csio_q_iqid(hw, i) != CSIO_MAX_QID) {
  csio_wr_cleanup_iq_ftr(hw, i);



Re: [PATCH 14/41] scsi: esas2r: esas2r_init: mark expected switch fall-throughs

2019-01-10 Thread Gustavo A. R. Silva

Hi,

Friendly ping (second one):

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

Thanks
--
Gustavo

On 12/19/18 9:39 AM, Gustavo A. R. Silva wrote:

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:28 PM, Gustavo A. R. Silva wrote:

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

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/esas2r/esas2r_init.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/esas2r/esas2r_init.c 
b/drivers/scsi/esas2r/esas2r_init.c
index 46b2c83ba21f..950cd92df2ff 100644
--- a/drivers/scsi/esas2r/esas2r_init.c
+++ b/drivers/scsi/esas2r/esas2r_init.c
@@ -1241,6 +1241,7 @@ static bool esas2r_format_init_msg(struct esas2r_adapter 
*a,
  a->init_msg = ESAS2R_INIT_MSG_GET_INIT;
  break;
  }
+    /* fall through */
  case ESAS2R_INIT_MSG_GET_INIT:
  if (msg == ESAS2R_INIT_MSG_GET_INIT) {
@@ -1254,7 +1255,7 @@ static bool esas2r_format_init_msg(struct esas2r_adapter 
*a,
  esas2r_hdebug("FAILED");
  }
  }
-    /* fall through */
+    /* fall through */
  default:
  rq->req_stat = RS_SUCCESS;



Re: [PATCH 16/41] scsi: imm: mark expected switch fall-throughs

2019-01-10 Thread Gustavo A. R. Silva

Hi,

Friendly ping (second one):

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

Martin: apparently, the only maintainers for this
driver are you and James.

Thanks
--
Gustavo

On 11/27/18 10:29 PM, Gustavo A. R. Silva wrote:

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

Notice that, in this particular case, I placed all the "Phase N - ..."
comments on the same line as its corresponding switch case. The same
way in which similar comments appear in drivers/scsi/ppa.c. This makes
it possible to place the "fall through" annotations at the bottom of
each switch case, which is what GCC is expecting to find.

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/imm.c | 33 +
  1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c
index 8c6627bc8a39..629e0bc70d3e 100644
--- a/drivers/scsi/imm.c
+++ b/drivers/scsi/imm.c
@@ -796,21 +796,21 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd 
*cmd)
return 0;
}
return 1;   /* wait until imm_wakeup claims parport */
-   /* Phase 1 - Connected */
-   case 1:
+
+   case 1: /* Phase 1 - Connected */
imm_connect(dev, CONNECT_EPP_MAYBE);
cmd->SCp.phase++;
+   /* fall through */
  
-		/* Phase 2 - We are now talking to the scsi bus */

-   case 2:
+   case 2: /* Phase 2 - We are now talking to the scsi bus */
if (!imm_select(dev, scmd_id(cmd))) {
imm_fail(dev, DID_NO_CONNECT);
return 0;
}
cmd->SCp.phase++;
+   /* fall through */
  
-		/* Phase 3 - Ready to accept a command */

-   case 3:
+   case 3: /* Phase 3 - Ready to accept a command */
w_ctr(ppb, 0x0c);
if (!(r_str(ppb) & 0x80))
return 1;
@@ -818,9 +818,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd 
*cmd)
if (!imm_send_command(cmd))
return 0;
cmd->SCp.phase++;
+   /* fall through */
  
-		/* Phase 4 - Setup scatter/gather buffers */

-   case 4:
+   case 4: /* Phase 4 - Setup scatter/gather buffers */
if (scsi_bufflen(cmd)) {
cmd->SCp.buffer = scsi_sglist(cmd);
cmd->SCp.this_residual = cmd->SCp.buffer->length;
@@ -834,8 +834,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd 
*cmd)
cmd->SCp.phase++;
if (cmd->SCp.this_residual & 0x01)
cmd->SCp.this_residual++;
-   /* Phase 5 - Pre-Data transfer stage */
-   case 5:
+   /* fall through */
+
+   case 5: /* Phase 5 - Pre-Data transfer stage */
/* Spin lock for BUSY */
w_ctr(ppb, 0x0c);
if (!(r_str(ppb) & 0x80))
@@ -850,9 +851,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd 
*cmd)
if (imm_negotiate(dev))
return 0;
cmd->SCp.phase++;
+   /* fall through */
  
-		/* Phase 6 - Data transfer stage */

-   case 6:
+   case 6: /* Phase 6 - Data transfer stage */
/* Spin lock for BUSY */
w_ctr(ppb, 0x0c);
if (!(r_str(ppb) & 0x80))
@@ -866,9 +867,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd 
*cmd)
return 1;
}
cmd->SCp.phase++;
+   /* fall through */
  
-		/* Phase 7 - Post data transfer stage */

-   case 7:
+   case 7: /* Phase 7 - Post data transfer stage */
if ((dev->dp) && (dev->rd)) {
if ((dev->mode == IMM_NIBBLE) || (dev->mode == 
IMM_PS2)) {
w_ctr(ppb, 0x4);
@@ -878,9 +879,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd 
*cmd)
}
}
cmd->SCp.phase++;
+   /* fall through */
  
-		/* Phase 8 - Read status/message */

-   case 8:
+   case 8: /* Phase 8 - Read status/message */
/* Check for data overrun */
if (imm_wait(dev) != (unsigned char) 0xb8) {
imm_fail(dev, DID_ERROR);



Re: [PATCH 22/41] scsi: lpfc: lpfc_ct: Mark expected switch fall-throughs

2019-01-10 Thread Gustavo A. R. Silva

Hi,

Friendly ping (second one):

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

Thanks
--
Gustavo

On 11/27/18 10:31 PM, Gustavo A. R. Silva wrote:

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

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/lpfc/lpfc_ct.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index 6305ffeba7ea..b2b7fcc23654 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -3050,6 +3050,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct 
lpfc_nodelist *ndlp,
case SLI_MGMT_GHAT:
case SLI_MGMT_GRPL:
rsp_size = FC_MAX_NS_RSP;
+   /* fall through */
case SLI_MGMT_DHBA:
case SLI_MGMT_DHAT:
pe = (struct lpfc_fdmi_port_entry *)&CtReq->un.PortID;
@@ -3062,6 +3063,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct 
lpfc_nodelist *ndlp,
case SLI_MGMT_GPAT:
case SLI_MGMT_GPAS:
rsp_size = FC_MAX_NS_RSP;
+   /* fall through */
case SLI_MGMT_DPRT:
case SLI_MGMT_DPA:
pe = (struct lpfc_fdmi_port_entry *)&CtReq->un.PortID;



Re: [PATCH 23/41] scsi: lpfc: lpfc_els: Mark expected switch fall-throughs

2019-01-10 Thread Gustavo A. R. Silva

Hi,

Friendly ping (second one):

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

Thanks
--
Gustavo

On 11/27/18 10:31 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: 114978 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/lpfc/lpfc_els.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 5c34bfa624ef..1f20c35e0f84 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -8649,6 +8649,7 @@ lpfc_cmpl_reg_new_vport(struct lpfc_hba *phba, 
LPFC_MBOXQ_t *pmb)
lpfc_nlp_put(ndlp);
return;
}
+   /* fall through */
  
  		default:

/* Try to recover from this error */



Re: [PATCH 26/41] scsi: lpfc: lpfc_nvme: Mark expected switch fall-through

2019-01-10 Thread Gustavo A. R. Silva

Hi,

Friendly ping (second one):

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

Thanks
--
Gustavo

On 11/27/18 10:31 PM, Gustavo A. R. Silva wrote:

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

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/lpfc/lpfc_nvme.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c
index ba831def9301..942fe58c433d 100644
--- a/drivers/scsi/lpfc/lpfc_nvme.c
+++ b/drivers/scsi/lpfc/lpfc_nvme.c
@@ -1115,6 +1115,7 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct 
lpfc_iocbq *pwqeIn,
 lpfc_ncmd, nCmd,
 lpfc_ncmd->cur_iocbq.sli4_xritag,
 bf_get(lpfc_wcqe_c_xb, wcqe));
+   /* fall through */
default:
  out_err:
lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_IOERR,



Re: [PATCH 27/41] scsi: lpfc: lpfc_scsi: Mark expected switch fall-throughs

2019-01-10 Thread Gustavo A. R. Silva

Hi,

Friendly ping (second one):

Who can ack/review/take 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.

Notice that, in this particular case, I replaced "Drop thru" with
"fall through" annotations, which is what GCC is expecting to find.

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/lpfc/lpfc_scsi.c | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index baed2b891efb..0eeed6c4c2ee 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -1427,7 +1427,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct 
scsi_cmnd *sc,
  
  	break;

}
-   /* Drop thru */
+   /* fall through */
case SCSI_PROT_WRITE_INSERT:
/*
 * For WRITE_INSERT, force the error
@@ -1546,7 +1546,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct 
scsi_cmnd *sc,
rc = BG_ERR_TGT | BG_ERR_CHECK;
break;
}
-   /* Drop thru */
+   /* fall through */
case SCSI_PROT_WRITE_INSERT:
/*
 * For WRITE_INSERT, force the
@@ -1628,7 +1628,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct 
scsi_cmnd *sc,
switch (op) {
case SCSI_PROT_WRITE_PASS:
rc = BG_ERR_CHECK;
-   /* Drop thru */
+   /* fall through */
  
  			case SCSI_PROT_WRITE_INSERT:

/*
@@ -4115,7 +4115,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct 
lpfc_iocbq *pIocbIn,
lpfc_cmd->cur_iocbq.sli4_lxritag,
0, 0);
}
-   /* else: fall through */
+   /* fall through */
default:
cmd->result = DID_ERROR << 16;
break;



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

2019-01-10 Thread Gustavo A. R. Silva

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 
---
  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 */



Re: [PATCH 39/41] scsi: sym53c8xx_2: sym_nvram: Mark expected switch fall-through

2019-01-10 Thread Gustavo A. R. Silva

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:34 PM, Gustavo A. R. Silva wrote:

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

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/sym53c8xx_2/sym_nvram.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/sym53c8xx_2/sym_nvram.c 
b/drivers/scsi/sym53c8xx_2/sym_nvram.c
index 5662fbb3ff60..0d37b4f07b5e 100644
--- a/drivers/scsi/sym53c8xx_2/sym_nvram.c
+++ b/drivers/scsi/sym53c8xx_2/sym_nvram.c
@@ -708,6 +708,7 @@ static int sym_read_Tekram_nvram (struct sym_device *np, 
Tekram_nvram *nvram)
    data, len);
  if (!x)
  break;
+    /* fall through */
  default:
  x = sym_read_T93C46_nvram(np, nvram);
  break;



[PATCH] scsi: mvsas: use struct_size() in kzalloc()

2019-01-04 Thread Gustavo A. R. Silva
One of the more common cases of allocation size calculations is finding the
size of a structure that has a zero-sized array at the end, along with memory
for some number of elements for that array. For example:

struct foo {
int stuff;
void *entry[];
};

instance = kzalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL);

Instead of leaving these open-coded and prone to type mistakes, we can now
use the new struct_size() helper:

instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL);

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/mvsas/mv_init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c
index 030d911ee374..cd6ba7ed0ab4 100644
--- a/drivers/scsi/mvsas/mv_init.c
+++ b/drivers/scsi/mvsas/mv_init.c
@@ -366,9 +366,9 @@ static struct mvs_info *mvs_pci_alloc(struct pci_dev *pdev,
struct mvs_info *mvi = NULL;
struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
 
-   mvi = kzalloc(sizeof(*mvi) +
-   (1L << mvs_chips[ent->driver_data].slot_width) *
-   sizeof(struct mvs_slot_info), GFP_KERNEL);
+   mvi = kzalloc(struct_size(mvi, slot_info,
+ (1L << mvs_chips[ent->driver_data].slot_width)),
+ GFP_KERNEL);
if (!mvi)
return NULL;
 
-- 
2.20.1



[PATCH] scsi: advansys: use struct_size() in kzalloc()

2019-01-04 Thread Gustavo A. R. Silva
One of the more common cases of allocation size calculations is finding the
size of a structure that has a zero-sized array at the end, along with memory
for some number of elements for that array. For example:

struct foo {
int stuff;
void *entry[];
};

instance = kzalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL);

Instead of leaving these open-coded and prone to type mistakes, we can now
use the new struct_size() helper:

instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL);

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/advansys.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index d37584403c33..6c274e6e1c33 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -7576,8 +7576,8 @@ static int asc_build_req(struct asc_board *boardp, struct 
scsi_cmnd *scp,
return ASC_ERROR;
}
 
-   asc_sg_head = kzalloc(sizeof(asc_scsi_q->sg_head) +
-   use_sg * sizeof(struct asc_sg_list), GFP_ATOMIC);
+   asc_sg_head = kzalloc(struct_size(asc_sg_head, sg_list, use_sg),
+ GFP_ATOMIC);
if (!asc_sg_head) {
scsi_dma_unmap(scp);
scp->result = HOST_BYTE(DID_SOFT_ERROR);
-- 
2.20.1



[PATCH] scsi: smartpqi_init: fix boolean expression in pqi_device_remove_start

2019-01-03 Thread Gustavo A. R. Silva
Fix boolean expression by using logical AND operator '&&'
instead of bitwise operator '&'.

This issue was detected with the help of Coccinelle.

Fixes: 1e46731efd9c ("scsi: smartpqi: check for null device pointers")
Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/smartpqi/smartpqi_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c 
b/drivers/scsi/smartpqi/smartpqi_init.c
index e2fa3f476227..40f58238ce4a 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -323,7 +323,7 @@ static inline void pqi_device_remove_start(struct 
pqi_scsi_dev *device)
 static inline bool pqi_device_in_remove(struct pqi_ctrl_info *ctrl_info,
struct pqi_scsi_dev *device)
 {
-   return device->in_remove & !ctrl_info->in_shutdown;
+   return device->in_remove && !ctrl_info->in_shutdown;
 }
 
 static inline void pqi_schedule_rescan_worker_with_delay(
-- 
2.20.1



[PATCH] scsi: mpt3sas: mpt3sas_scsih: Mark expected switch fall-through

2018-12-20 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 1475400 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c 
b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 22df12698d43..6be39dc27103 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -10377,6 +10377,7 @@ _scsih_probe(struct pci_dev *pdev, const struct 
pci_device_id *id)
case MPI26_MFGPAGE_DEVID_CFG_SEC_3916:
dev_info(&pdev->dev,
"HBA is in Configurable Secure mode\n");
+   /* fall through */
case MPI26_MFGPAGE_DEVID_HARD_SEC_3816:
case MPI26_MFGPAGE_DEVID_HARD_SEC_3916:
ioc->is_aero_ioc = ioc->is_gen35_ioc = 1;
-- 
2.20.1



Re: [PATCH 31/41] scsi: mpt3sas: mpt3sas_scsih: Mark expected switch fall-through

2018-12-20 Thread Gustavo A. R. Silva

Hi Suganath,

On 12/19/18 10:19 PM, Suganath Prabu Subramani wrote:

Hi Gustavo,

This patch may not apply smoothly over 4.21/scsi-queue.
Our previous patch for Aero had some changes in this switch case.
Can you resend this patch with latest code base ?



Okay. I'll send a separate patch.

Thanks for the feedback.
--
Gustavo


Re: [PATCH 38/41] scsi: sym53c8xx_2: sym_hipd: mark expected switch fall-throughs

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:34 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: 114996 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/sym53c8xx_2/sym_hipd.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c 
b/drivers/scsi/sym53c8xx_2/sym_hipd.c
index 0a2a54517b15..054fb0599263 100644
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.c
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c
@@ -3072,6 +3072,7 @@ static void sym_sir_bad_scsi_status(struct sym_hcb *np, 
int num, struct sym_ccb
sym_print_addr(cp->cmd, "%s\n",
s_status == S_BUSY ? "BUSY" : "QUEUE FULL\n");
}
+   /* fall through */
default:/* S_INT, S_INT_COND_MET, S_CONFLICT */
sym_complete_error (np, cp);
break;
@@ -4632,6 +4633,7 @@ static void sym_int_sir(struct sym_hcb *np)
 *  Negotiation failed.
 *  Target does not want answer message.
 */
+   /* fall through */
case SIR_NEGO_PROTO:
sym_nego_default(np, tp, cp);
goto out;



Re: [PATCH 33/41] scsi: osd: osd_initiator: mark expected switch fall-throughs

2018-12-19 Thread Gustavo A. R. Silva

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.

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/osd/osd_initiator.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
index 60cf7c5eb880..cb26f26d5ec1 100644
--- a/drivers/scsi/osd/osd_initiator.c
+++ b/drivers/scsi/osd/osd_initiator.c
@@ -1849,6 +1849,7 @@ int osd_req_decode_sense_full(struct osd_request *or,
32, 1, dump, sizeof(dump), true);
OSD_SENSE_PRINT2("response_integrity [%s]\n", dump);
}
+   /* fall through */
case osd_sense_attribute_identification:
{
struct osd_sense_attributes_data_descriptor
@@ -1879,7 +1880,7 @@ int osd_req_decode_sense_full(struct osd_request *or,
attr_page, attr_id);
}
}
-   /*These are not legal for OSD*/
+   /* fall through - These are not legal for OSD */
case scsi_sense_field_replaceable_unit:
OSD_SENSE_PRINT2("scsi_sense_field_replaceable_unit\n");
break;



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

2018-12-19 Thread Gustavo A. R. Silva

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 
---
  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 */



Re: [PATCH 35/41] scsi: ppa: mark expected switch fall-through

2018-12-19 Thread Gustavo A. R. Silva

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: 114988 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/ppa.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c
index ee86a0c62dbf..d2ba5458 100644
--- a/drivers/scsi/ppa.c
+++ b/drivers/scsi/ppa.c
@@ -717,6 +717,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd 
*cmd)
}
cmd->SCp.phase++;
}
+   /* fall through */
  
  	case 2:		/* Phase 2 - We are now talking to the scsi bus */

if (!ppa_select(dev, scmd_id(cmd))) {



Re: [PATCH 39/41] scsi: sym53c8xx_2: sym_nvram: Mark expected switch fall-through

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:34 PM, Gustavo A. R. Silva wrote:

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

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/sym53c8xx_2/sym_nvram.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/sym53c8xx_2/sym_nvram.c 
b/drivers/scsi/sym53c8xx_2/sym_nvram.c
index 5662fbb3ff60..0d37b4f07b5e 100644
--- a/drivers/scsi/sym53c8xx_2/sym_nvram.c
+++ b/drivers/scsi/sym53c8xx_2/sym_nvram.c
@@ -708,6 +708,7 @@ static int sym_read_Tekram_nvram (struct sym_device *np, 
Tekram_nvram *nvram)
  data, len);
if (!x)
break;
+   /* fall through */
default:
x = sym_read_T93C46_nvram(np, nvram);
break;



Re: [PATCH 36/41] scsi: qla4xxx: ql4_os: mark expected switch fall-through

2018-12-19 Thread Gustavo A. R. Silva

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.

Notice that, in this particular case, I replaced "allow fall-through"
with a "fall through" annotation, which is what GCC is expecting to
find.

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/qla4xxx/ql4_os.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 1c702cd22359..7fd3491ea2d9 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -2876,7 +2876,7 @@ static int qla4xxx_session_get_param(struct 
iscsi_cls_session *cls_sess,
chap_tbl.secret_len);
}
}
-   /* allow fall-through */
+   /* fall through */
default:
return iscsi_session_get_param(cls_sess, param, buf);
}



Re: [PATCH 34/41] scsi: osst: mark expected switch fall-throughs

2018-12-19 Thread Gustavo A. R. Silva

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: 114983 ("Missing break in switch")
Addresses-Coverity-ID: 114984 ("Missing break in switch")
Addresses-Coverity-ID: 114985 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/osst.c | 6 ++
  1 file changed, 6 insertions(+)

diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index 664c1238a87f..7e877b43785d 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -216,12 +216,14 @@ static void osst_analyze_sense(struct osst_request 
*SRpnt, struct st_cmdstatus *
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);
@@ -591,6 +593,7 @@ static void osst_init_aux(struct osst_tape * STp, int 
frame_type, int frame_seq_
dat->dat_list[0].flags= frame_type==OS_FRAME_TYPE_MARKER?

OS_DAT_FLAGS_MARK:OS_DAT_FLAGS_DATA;
dat->dat_list[0].reserved = 0;
+   /* fall through */
  case  OS_FRAME_TYPE_EOD:
aux->update_frame_cntr= htonl(0);
par->partition_num= OS_DATA_PARTITION;
@@ -4086,6 +4089,7 @@ static int osst_int_ioctl(struct osst_tape * STp, struct 
osst_request ** aSRpnt,
switch (cmd_in) {
 case MTFSFM:
chg_eof = 0; /* Changed from the FSF after this */
+   /* fall through */
 case MTFSF:
if (STp->raw)
   return (-EIO);
@@ -4101,6 +4105,7 @@ static int osst_int_ioctl(struct osst_tape * STp, struct 
osst_request ** aSRpnt,
  
  	 case MTBSF:

chg_eof = 0; /* Changed from the FSF after this */
+   /* fall through */
 case MTBSFM:
if (STp->raw)
   return (-EIO);
@@ -4312,6 +4317,7 @@ static int osst_int_ioctl(struct osst_tape * STp, struct 
osst_request ** aSRpnt,
   name, STp->block_size);
 return 0;
 }
+   /* fall through */
 case MTSETDENSITY:   /* Set tape density */
 case MTSETDRVBUFFER: /* Set drive buffering */
 case SET_DENS_AND_BLK:   /* Set density and block size */



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

2018-12-19 Thread Gustavo A. R. Silva

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 
---
  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 */



Re: [PATCH 31/41] scsi: mpt3sas: mpt3sas_scsih: Mark expected switch fall-through

2018-12-19 Thread Gustavo A. R. Silva

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: 1475400 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/mpt3sas/mpt3sas_scsih.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c 
b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 5b9806d0719e..920b80ce4748 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -10370,6 +10370,7 @@ _scsih_probe(struct pci_dev *pdev, const struct 
pci_device_id *id)
case MPI26_MFGPAGE_DEVID_CFG_SEC_3916:
dev_info(&pdev->dev,
"HBA is in Configurable Secure mode\n");
+   /* fall through */
case MPI26_MFGPAGE_DEVID_SAS3508:
case MPI26_MFGPAGE_DEVID_SAS3508_1:
case MPI26_MFGPAGE_DEVID_SAS3408:



Re: [PATCH 16/41] scsi: imm: mark expected switch fall-throughs

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:29 PM, Gustavo A. R. Silva wrote:

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

Notice that, in this particular case, I placed all the "Phase N - ..."
comments on the same line as its corresponding switch case. The same
way in which similar comments appear in drivers/scsi/ppa.c. This makes
it possible to place the "fall through" annotations at the bottom of
each switch case, which is what GCC is expecting to find.

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/imm.c | 33 +
  1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c
index 8c6627bc8a39..629e0bc70d3e 100644
--- a/drivers/scsi/imm.c
+++ b/drivers/scsi/imm.c
@@ -796,21 +796,21 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd 
*cmd)
return 0;
}
return 1;   /* wait until imm_wakeup claims parport */
-   /* Phase 1 - Connected */
-   case 1:
+
+   case 1: /* Phase 1 - Connected */
imm_connect(dev, CONNECT_EPP_MAYBE);
cmd->SCp.phase++;
+   /* fall through */
  
-		/* Phase 2 - We are now talking to the scsi bus */

-   case 2:
+   case 2: /* Phase 2 - We are now talking to the scsi bus */
if (!imm_select(dev, scmd_id(cmd))) {
imm_fail(dev, DID_NO_CONNECT);
return 0;
}
cmd->SCp.phase++;
+   /* fall through */
  
-		/* Phase 3 - Ready to accept a command */

-   case 3:
+   case 3: /* Phase 3 - Ready to accept a command */
w_ctr(ppb, 0x0c);
if (!(r_str(ppb) & 0x80))
return 1;
@@ -818,9 +818,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd 
*cmd)
if (!imm_send_command(cmd))
return 0;
cmd->SCp.phase++;
+   /* fall through */
  
-		/* Phase 4 - Setup scatter/gather buffers */

-   case 4:
+   case 4: /* Phase 4 - Setup scatter/gather buffers */
if (scsi_bufflen(cmd)) {
cmd->SCp.buffer = scsi_sglist(cmd);
cmd->SCp.this_residual = cmd->SCp.buffer->length;
@@ -834,8 +834,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd 
*cmd)
cmd->SCp.phase++;
if (cmd->SCp.this_residual & 0x01)
cmd->SCp.this_residual++;
-   /* Phase 5 - Pre-Data transfer stage */
-   case 5:
+   /* fall through */
+
+   case 5: /* Phase 5 - Pre-Data transfer stage */
/* Spin lock for BUSY */
w_ctr(ppb, 0x0c);
if (!(r_str(ppb) & 0x80))
@@ -850,9 +851,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd 
*cmd)
if (imm_negotiate(dev))
return 0;
cmd->SCp.phase++;
+   /* fall through */
  
-		/* Phase 6 - Data transfer stage */

-   case 6:
+   case 6: /* Phase 6 - Data transfer stage */
/* Spin lock for BUSY */
w_ctr(ppb, 0x0c);
if (!(r_str(ppb) & 0x80))
@@ -866,9 +867,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd 
*cmd)
return 1;
}
cmd->SCp.phase++;
+   /* fall through */
  
-		/* Phase 7 - Post data transfer stage */

-   case 7:
+   case 7: /* Phase 7 - Post data transfer stage */
if ((dev->dp) && (dev->rd)) {
if ((dev->mode == IMM_NIBBLE) || (dev->mode == 
IMM_PS2)) {
w_ctr(ppb, 0x4);
@@ -878,9 +879,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd 
*cmd)
}
}
cmd->SCp.phase++;
+   /* fall through */
  
-		/* Phase 8 - Read status/message */

-   case 8:
+   case 8: /* Phase 8 - Read status/message */
/* Check for data overrun */
if (imm_wait(dev) != (unsigned char) 0xb8) {
imm_fail(dev, DID_ERROR);



Re: [PATCH 28/41] scsi: lpfc: lpfc_sli: Mark expected switch fall-throughs

2018-12-19 Thread Gustavo A. R. Silva

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.

Notice that, in this particular case, I replaced "Drop thru" and
"Fall Thru" with "fall through" annotations, which is what GCC
is expecting to find.

Also, in some cases a dash is added as a token in order to separate
the "fall through" annotation from the rest of the comment on the
same line, which is what GCC is expecting to find.

Addresses-Coverity-ID: 114979 ("Missing break in switch")
Addresses-Coverity-ID: 114980 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/lpfc/lpfc_sli.c | 20 +++-
  1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 3912a2d0b95d..cbcda5a91068 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -9334,6 +9334,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct 
lpfc_iocbq *iocbq,
cmnd = CMD_XMIT_SEQUENCE64_CR;
if (phba->link_flag & LS_LOOPBACK_MODE)
bf_set(wqe_xo, &wqe->xmit_sequence.wge_ctl, 1);
+   /* fall through */
case CMD_XMIT_SEQUENCE64_CR:
/* word3 iocb=io_tag32 wqe=reserved */
wqe->xmit_sequence.rsvd3 = 0;
@@ -13460,6 +13461,7 @@ lpfc_sli4_sp_handle_rcqe(struct lpfc_hba *phba, struct 
lpfc_rcqe *rcqe)
case FC_STATUS_RQ_BUF_LEN_EXCEEDED:
lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
"2537 Receive Frame Truncated!!\n");
+   /* fall through */
case FC_STATUS_RQ_SUCCESS:
spin_lock_irqsave(&phba->hbalock, iflags);
lpfc_sli4_rq_release(hrq, drq);
@@ -13859,7 +13861,7 @@ lpfc_sli4_nvmet_handle_rcqe(struct lpfc_hba *phba, 
struct lpfc_queue *cq,
case FC_STATUS_RQ_BUF_LEN_EXCEEDED:
lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
"6126 Receive Frame Truncated!!\n");
-   /* Drop thru */
+   /* fall through */
case FC_STATUS_RQ_SUCCESS:
spin_lock_irqsave(&phba->hbalock, iflags);
lpfc_sli4_rq_release(hrq, drq);
@@ -14769,7 +14771,7 @@ lpfc_eq_create(struct lpfc_hba *phba, struct lpfc_queue 
*eq, uint32_t imax)
eq->entry_count);
if (eq->entry_count < 256)
return -EINVAL;
-   /* otherwise default to smallest count (drop through) */
+   /* fall through - otherwise default to smallest count */
case 256:
bf_set(lpfc_eq_context_count, &eq_create->u.request.context,
   LPFC_EQ_CNT_256);
@@ -14899,7 +14901,7 @@ lpfc_cq_create(struct lpfc_hba *phba, struct lpfc_queue 
*cq,
   LPFC_CQ_CNT_WORD7);
break;
}
-   /* Fall Thru */
+   /* fall through */
default:
lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
"0361 Unsupported CQ count: "
@@ -14910,7 +14912,7 @@ lpfc_cq_create(struct lpfc_hba *phba, struct lpfc_queue 
*cq,
status = -EINVAL;
goto out;
}
-   /* otherwise default to smallest count (drop through) */
+   /* fall through - otherwise default to smallest count */
case 256:
bf_set(lpfc_cq_context_count, &cq_create->u.request.context,
   LPFC_CQ_CNT_256);
@@ -15070,7 +15072,7 @@ lpfc_cq_create_set(struct lpfc_hba *phba, struct 
lpfc_queue **cqp,
   LPFC_CQ_CNT_WORD7);
break;
}
-   /* Fall Thru */
+   /* fall through */
default:
lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
"3118 Bad CQ count. (%d)\n",
@@ -15079,7 +15081,7 @@ lpfc_cq_create_set(struct lpfc_hba *phba, struct 
lpfc_queue **cqp,
status = -EINVAL;
goto out;
}
-   /* otherwise default to smallest (drop thru) */
+   /* fall through - otherwise default to smallest 
*/
case 256:
bf_set(lpfc_mbx_cq_create_set_cqe_cnt,
   &cq_se

Re: [PATCH 22/41] scsi: lpfc: lpfc_ct: Mark expected switch fall-throughs

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:31 PM, Gustavo A. R. Silva wrote:

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

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/lpfc/lpfc_ct.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index 6305ffeba7ea..b2b7fcc23654 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -3050,6 +3050,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct 
lpfc_nodelist *ndlp,
case SLI_MGMT_GHAT:
case SLI_MGMT_GRPL:
rsp_size = FC_MAX_NS_RSP;
+   /* fall through */
case SLI_MGMT_DHBA:
case SLI_MGMT_DHAT:
pe = (struct lpfc_fdmi_port_entry *)&CtReq->un.PortID;
@@ -3062,6 +3063,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct 
lpfc_nodelist *ndlp,
case SLI_MGMT_GPAT:
case SLI_MGMT_GPAS:
rsp_size = FC_MAX_NS_RSP;
+   /* fall through */
case SLI_MGMT_DPRT:
case SLI_MGMT_DPA:
pe = (struct lpfc_fdmi_port_entry *)&CtReq->un.PortID;



Re: [PATCH 18/41] scsi: isci: remote_device: Mark expected switch fall-throughs

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:30 PM, Gustavo A. R. Silva wrote:

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

Notice that, in this particular case, a dash is added as a token in
order to separate the "fall through" annotations from the rest of
the comment on the same line, which is what GCC is expecting to find.

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/isci/remote_device.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/isci/remote_device.c 
b/drivers/scsi/isci/remote_device.c
index cc51f38b116d..9d29edb9f590 100644
--- a/drivers/scsi/isci/remote_device.c
+++ b/drivers/scsi/isci/remote_device.c
@@ -310,7 +310,7 @@ static void isci_remote_device_not_ready(struct isci_host 
*ihost,
/* Kill all outstanding requests for the device. */
sci_remote_device_terminate_requests(idev);
  
-		/* Fall through into the default case... */

+   /* Fall through - into the default case... */
default:
clear_bit(IDEV_IO_READY, &idev->flags);
break;
@@ -593,7 +593,7 @@ enum sci_status sci_remote_device_event_handler(struct 
isci_remote_device *idev,
  
  			break;

}
-   /* Else, fall through and treat as unhandled... */
+   /* fall through - and treat as unhandled... */
default:
dev_dbg(scirdev_to_dev(idev),
"%s: device: %p event code: %x: %s\n",



Re: [PATCH 24/41] scsi: lpfc: lpfc_hbadisc: Mark expected switch fall-throughs

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:31 PM, Gustavo A. R. Silva wrote:

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

Notice that, in this particular case, I replaced "Drop thru" with a
"fall through" annotation, which is what GCC is expecting to find.

Addresses-Coverity-ID: 114976 ("Missing break in switch")
Addresses-Coverity-ID: 114977 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/lpfc/lpfc_hbadisc.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index 6c2fb55d739b..1a61806739ff 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -4645,9 +4645,11 @@ lpfc_check_sli_ndlp(struct lpfc_hba *phba,
case CMD_GEN_REQUEST64_CR:
if (iocb->context_un.ndlp == ndlp)
return 1;
+   /* fall through */
case CMD_ELS_REQUEST64_CR:
if (icmd->un.elsreq64.remoteID == ndlp->nlp_DID)
return 1;
+   /* fall through */
case CMD_XMIT_ELS_RSP64_CX:
if (iocb->context1 == (uint8_t *) ndlp)
return 1;
@@ -5791,7 +5793,7 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
  
  	case LPFC_LINK_UP:

lpfc_issue_clear_la(phba, vport);
-   /* Drop thru */
+   /* fall through */
case LPFC_LINK_UNKNOWN:
case LPFC_WARM_START:
case LPFC_INIT_START:



Re: [PATCH 27/41] scsi: lpfc: lpfc_scsi: Mark expected switch fall-throughs

2018-12-19 Thread Gustavo A. R. Silva

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.

Notice that, in this particular case, I replaced "Drop thru" with
"fall through" annotations, which is what GCC is expecting to find.

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/lpfc/lpfc_scsi.c | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index baed2b891efb..0eeed6c4c2ee 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -1427,7 +1427,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct 
scsi_cmnd *sc,
  
  	break;

}
-   /* Drop thru */
+   /* fall through */
case SCSI_PROT_WRITE_INSERT:
/*
 * For WRITE_INSERT, force the error
@@ -1546,7 +1546,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct 
scsi_cmnd *sc,
rc = BG_ERR_TGT | BG_ERR_CHECK;
break;
}
-   /* Drop thru */
+   /* fall through */
case SCSI_PROT_WRITE_INSERT:
/*
 * For WRITE_INSERT, force the
@@ -1628,7 +1628,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct 
scsi_cmnd *sc,
switch (op) {
case SCSI_PROT_WRITE_PASS:
rc = BG_ERR_CHECK;
-   /* Drop thru */
+   /* fall through */
  
  			case SCSI_PROT_WRITE_INSERT:

/*
@@ -4115,7 +4115,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct 
lpfc_iocbq *pIocbIn,
lpfc_cmd->cur_iocbq.sli4_lxritag,
0, 0);
}
-   /* else: fall through */
+   /* fall through */
default:
cmd->result = DID_ERROR << 16;
break;



Re: [PATCH 23/41] scsi: lpfc: lpfc_els: Mark expected switch fall-throughs

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:31 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: 114978 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/lpfc/lpfc_els.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 5c34bfa624ef..1f20c35e0f84 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -8649,6 +8649,7 @@ lpfc_cmpl_reg_new_vport(struct lpfc_hba *phba, 
LPFC_MBOXQ_t *pmb)
lpfc_nlp_put(ndlp);
return;
}
+   /* fall through */
  
  		default:

/* Try to recover from this error */



Re: [PATCH 25/41] scsi: lpfc: lpfc_nportdisc: Mark expected switch fall-through

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:31 PM, Gustavo A. R. Silva wrote:

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

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/lpfc/lpfc_nportdisc.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c 
b/drivers/scsi/lpfc/lpfc_nportdisc.c
index 7d5693cfaa87..e8583496feaf 100644
--- a/drivers/scsi/lpfc/lpfc_nportdisc.c
+++ b/drivers/scsi/lpfc/lpfc_nportdisc.c
@@ -360,6 +360,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct 
lpfc_nodelist *ndlp,
case  NLP_STE_NPR_NODE:
if (!(ndlp->nlp_flag & NLP_NPR_ADISC))
break;
+   /* fall through */
case  NLP_STE_REG_LOGIN_ISSUE:
case  NLP_STE_PRLI_ISSUE:
case  NLP_STE_UNMAPPED_NODE:



Re: [PATCH 26/41] scsi: lpfc: lpfc_nvme: Mark expected switch fall-through

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:31 PM, Gustavo A. R. Silva wrote:

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

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/lpfc/lpfc_nvme.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c
index ba831def9301..942fe58c433d 100644
--- a/drivers/scsi/lpfc/lpfc_nvme.c
+++ b/drivers/scsi/lpfc/lpfc_nvme.c
@@ -1115,6 +1115,7 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct 
lpfc_iocbq *pwqeIn,
 lpfc_ncmd, nCmd,
 lpfc_ncmd->cur_iocbq.sli4_xritag,
 bf_get(lpfc_wcqe_c_xb, wcqe));
+   /* fall through */
default:
  out_err:
lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_IOERR,



Re: [PATCH 20/41] scsi: isci: request: mark expected switch fall-through

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:30 PM, Gustavo A. R. Silva wrote:

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

Notice that, in this particular case, a dash is added as a token in
order to separate the "Fall through" annotation from the rest of the
comment on the same line, which is what GCC is expecting to find.

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/isci/request.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c
index 2f151708b59a..1b18cf55167e 100644
--- a/drivers/scsi/isci/request.c
+++ b/drivers/scsi/isci/request.c
@@ -894,7 +894,7 @@ sci_io_request_terminate(struct isci_request *ireq)
 * and don't wait for the task response.
 */
sci_change_state(&ireq->sm, SCI_REQ_ABORTING);
-   /* Fall through and handle like ABORTING... */
+   /* Fall through - and handle like ABORTING... */
case SCI_REQ_ABORTING:
if (!isci_remote_device_is_safe_to_abort(ireq->target_device))
set_bit(IREQ_PENDING_ABORT, &ireq->flags);



Re: [PATCH 17/41] scsi: isci: phy: Mark expected switch fall-through

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:29 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: 703127 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/isci/phy.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/isci/phy.c b/drivers/scsi/isci/phy.c
index 1deca8c5a94f..7f9b3f20e5e4 100644
--- a/drivers/scsi/isci/phy.c
+++ b/drivers/scsi/isci/phy.c
@@ -778,6 +778,7 @@ enum sci_status sci_phy_event_handler(struct isci_phy 
*iphy, u32 event_code)
break;
case SCU_EVENT_LINK_FAILURE:
scu_link_layer_set_txcomsas_timeout(iphy, 
SCU_SAS_LINK_LAYER_TXCOMSAS_NEGTIME_DEFAULT);
+   /* fall through */
case SCU_EVENT_HARD_RESET_RECEIVED:
/* Start the oob/sn state machine over again */
sci_change_state(&iphy->sm, SCI_PHY_STARTING);



Re: [PATCH 19/41] scsi: isci: remote_node_context: mark expected switch fall-throughs

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:30 PM, Gustavo A. R. Silva wrote:

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

Notice that, in this particular case, a dash is added as a token in
order to separate the "Fall through" annotations from the rest of
the comment on the same line, which is what GCC is expecting to find.

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/isci/remote_node_context.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/isci/remote_node_context.c 
b/drivers/scsi/isci/remote_node_context.c
index e3f2a5359d71..474a43460963 100644
--- a/drivers/scsi/isci/remote_node_context.c
+++ b/drivers/scsi/isci/remote_node_context.c
@@ -601,9 +601,9 @@ enum sci_status sci_remote_node_context_suspend(
 __func__, sci_rnc);
return SCI_FAILURE_INVALID_STATE;
}
-   /* Fall through and handle like SCI_RNC_POSTING */
+   /* Fall through - and handle like SCI_RNC_POSTING */
case SCI_RNC_RESUMING:
-   /* Fall through and handle like SCI_RNC_POSTING */
+   /* Fall through - and handle like SCI_RNC_POSTING */
case SCI_RNC_POSTING:
/* Set the destination state to AWAIT - this signals the
 * entry into the SCI_RNC_READY state that a suspension



Re: [PATCH 14/41] scsi: esas2r: esas2r_init: mark expected switch fall-throughs

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:28 PM, Gustavo A. R. Silva wrote:

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

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/esas2r/esas2r_init.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/esas2r/esas2r_init.c 
b/drivers/scsi/esas2r/esas2r_init.c
index 46b2c83ba21f..950cd92df2ff 100644
--- a/drivers/scsi/esas2r/esas2r_init.c
+++ b/drivers/scsi/esas2r/esas2r_init.c
@@ -1241,6 +1241,7 @@ static bool esas2r_format_init_msg(struct esas2r_adapter 
*a,
a->init_msg = ESAS2R_INIT_MSG_GET_INIT;
break;
}
+   /* fall through */
  
  	case ESAS2R_INIT_MSG_GET_INIT:

if (msg == ESAS2R_INIT_MSG_GET_INIT) {
@@ -1254,7 +1255,7 @@ static bool esas2r_format_init_msg(struct esas2r_adapter 
*a,
esas2r_hdebug("FAILED");
}
}
-   /* fall through */
+   /* fall through */
  
  	default:

rq->req_stat = RS_SUCCESS;



Re: [PATCH 13/41] scsi: csiostor: csio_wr: mark expected switch fall-through

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:28 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: 1056538 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/csiostor/csio_wr.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/csiostor/csio_wr.c b/drivers/scsi/csiostor/csio_wr.c
index dc12933533d5..b6861ea66c9f 100644
--- a/drivers/scsi/csiostor/csio_wr.c
+++ b/drivers/scsi/csiostor/csio_wr.c
@@ -808,6 +808,7 @@ csio_wr_destroy_queues(struct csio_hw *hw, bool cmd)
  
  csio_q_eqid(hw, i) = CSIO_MAX_QID;

}
+   /* fall through */
case CSIO_INGRESS:
if (csio_q_iqid(hw, i) != CSIO_MAX_QID) {
csio_wr_cleanup_iq_ftr(hw, i);



Re: [PATCH 12/41] scsi: bfa: bfa_ioc: Mark expected switch fall-throughs

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:27 PM, Gustavo A. R. Silva wrote:

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

Notice that, in this particular case, I replaced "!!! fall through !!!"
comment with "fall through" annotations, which is what GCC is expecting
to find.

Addresses-Coverity-ID: 146155 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/bfa/bfa_ioc.c | 9 +++--
  1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c
index 16d3aeb0e572..32b24e51cce6 100644
--- a/drivers/scsi/bfa/bfa_ioc.c
+++ b/drivers/scsi/bfa/bfa_ioc.c
@@ -978,9 +978,7 @@ bfa_iocpf_sm_enabling(struct bfa_iocpf_s *iocpf, enum 
iocpf_event event)
  
  	case IOCPF_E_INITFAIL:

bfa_iocpf_timer_stop(ioc);
-   /*
-* !!! fall through !!!
-*/
+   /* fall through */
  
  	case IOCPF_E_TIMEOUT:

writel(1, ioc->ioc_regs.ioc_sem_reg);
@@ -1056,9 +1054,7 @@ bfa_iocpf_sm_disabling(struct bfa_iocpf_s *iocpf, enum 
iocpf_event event)
  
  	case IOCPF_E_FAIL:

bfa_iocpf_timer_stop(ioc);
-   /*
-* !!! fall through !!!
-*/
+   /* fall through */
  
  	case IOCPF_E_TIMEOUT:

bfa_ioc_set_cur_ioc_fwstate(ioc, BFI_IOC_FAIL);
@@ -6007,6 +6003,7 @@ bfa_dconf_sm_final_sync(struct bfa_dconf_mod_s *dconf,
case BFA_DCONF_SM_IOCDISABLE:
case BFA_DCONF_SM_FLASH_COMP:
bfa_timer_stop(&dconf->timer);
+   /* fall through */
case BFA_DCONF_SM_TIMEOUT:
bfa_sm_set_state(dconf, bfa_dconf_sm_uninit);
bfa_fsm_send_event(&dconf->bfa->iocfc, IOCFC_E_DCONF_DONE);



Re: [PATCH 11/41] scsi: bfa: bfa_fcs_rport: Mark expected switch fall-throughs

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:27 PM, Gustavo A. R. Silva wrote:

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

Notice that I replaced "!! fall through !!" and "!!! fall through !!!"
comments with "fall through" annotations, which is what GCC is
expecting to find.

Addresses-Coverity-ID: 744899 ("Missing break in switch")
Addresses-Coverity-ID: 744900 ("Missing break in switch")
Addresses-Coverity-ID: 744901 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/bfa/bfa_fcs_rport.c | 19 +++
  1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/drivers/scsi/bfa/bfa_fcs_rport.c b/drivers/scsi/bfa/bfa_fcs_rport.c
index de50349a39ce..1e400f2aaece 100644
--- a/drivers/scsi/bfa/bfa_fcs_rport.c
+++ b/drivers/scsi/bfa/bfa_fcs_rport.c
@@ -427,17 +427,13 @@ bfa_fcs_rport_sm_plogi(struct bfa_fcs_rport_s *rport, 
enum rport_event event)
  
  	case RPSM_EVENT_LOGO_RCVD:

bfa_fcs_rport_send_logo_acc(rport);
-   /*
-* !! fall through !!
-*/
+   /* fall through */
case RPSM_EVENT_PRLO_RCVD:
if (rport->prlo == BFA_TRUE)
bfa_fcs_rport_send_prlo_acc(rport);
  
  		bfa_fcxp_discard(rport->fcxp);

-   /*
-* !! fall through !!
-*/
+   /* fall through */
case RPSM_EVENT_FAILED:
if (rport->plogi_retries < BFA_FCS_RPORT_MAX_RETRIES) {
rport->plogi_retries++;
@@ -868,9 +864,7 @@ bfa_fcs_rport_sm_adisc_online(struct bfa_fcs_rport_s *rport,
 * At least go offline when a PLOGI is received.
 */
bfa_fcxp_discard(rport->fcxp);
-   /*
-* !!! fall through !!!
-*/
+   /* fall through */
  
  	case RPSM_EVENT_FAILED:

case RPSM_EVENT_ADDRESS_CHANGE:
@@ -1056,6 +1050,7 @@ bfa_fcs_rport_sm_fc4_logosend(struct bfa_fcs_rport_s 
*rport,
  
  	case RPSM_EVENT_LOGO_RCVD:

bfa_fcs_rport_send_logo_acc(rport);
+   /* fall through */
case RPSM_EVENT_PRLO_RCVD:
if (rport->prlo == BFA_TRUE)
bfa_fcs_rport_send_prlo_acc(rport);
@@ -1144,9 +1139,7 @@ bfa_fcs_rport_sm_hcb_offline(struct bfa_fcs_rport_s 
*rport,
bfa_fcs_rport_send_plogiacc(rport, NULL);
break;
}
-   /*
-* !! fall through !!
-*/
+   /* fall through */
  
  	case RPSM_EVENT_ADDRESS_CHANGE:

if (!bfa_fcs_lport_is_online(rport->port)) {
@@ -1303,6 +1296,7 @@ bfa_fcs_rport_sm_hcb_logosend(struct bfa_fcs_rport_s 
*rport,
  
  	case RPSM_EVENT_LOGO_RCVD:

bfa_fcs_rport_send_logo_acc(rport);
+   /* fall through */
case RPSM_EVENT_PRLO_RCVD:
if (rport->prlo == BFA_TRUE)
bfa_fcs_rport_send_prlo_acc(rport);
@@ -1346,6 +1340,7 @@ bfa_fcs_rport_sm_logo_sending(struct bfa_fcs_rport_s 
*rport,
  
  	case RPSM_EVENT_LOGO_RCVD:

bfa_fcs_rport_send_logo_acc(rport);
+   /* fall through */
case RPSM_EVENT_PRLO_RCVD:
if (rport->prlo == BFA_TRUE)
bfa_fcs_rport_send_prlo_acc(rport);



Re: [PATCH 10/41] scsi: bfa: bfa_fcs_lport: Mark expected switch fall-throughs

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:27 PM, Gustavo A. R. Silva wrote:

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

Notice that, in this particular case, I replaced "!!! fall through !!!"
with a "fall through" annotation, which is what GCC is expecting to
find.

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/bfa/bfa_fcs_lport.c | 8 ++--
  1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
index b4f2c1d8742e..646f09f66443 100644
--- a/drivers/scsi/bfa/bfa_fcs_lport.c
+++ b/drivers/scsi/bfa/bfa_fcs_lport.c
@@ -6430,9 +6430,7 @@ bfa_fcs_vport_sm_logo_for_stop(struct bfa_fcs_vport_s 
*vport,
switch (event) {
case BFA_FCS_VPORT_SM_OFFLINE:
bfa_sm_send_event(vport->lps, BFA_LPS_SM_OFFLINE);
-   /*
-* !!! fall through !!!
-*/
+   /* fall through */
  
  	case BFA_FCS_VPORT_SM_RSP_OK:

case BFA_FCS_VPORT_SM_RSP_ERROR:
@@ -6458,9 +6456,7 @@ bfa_fcs_vport_sm_logo(struct bfa_fcs_vport_s *vport,
switch (event) {
case BFA_FCS_VPORT_SM_OFFLINE:
bfa_sm_send_event(vport->lps, BFA_LPS_SM_OFFLINE);
-   /*
-* !!! fall through !!!
-*/
+   /* fall through */
  
  	case BFA_FCS_VPORT_SM_RSP_OK:

case BFA_FCS_VPORT_SM_RSP_ERROR:



Re: [PATCH 09/41] scsi: bfa: bfa_fcpim: Mark expected switch fall-throughs

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:27 PM, Gustavo A. R. Silva wrote:

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

Notice that I replaced "Fall through !!!" with a "fall through"
annotation, which is what GCC is expecting to find.

Addresses-Coverity-ID: 114971 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/bfa/bfa_fcpim.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c
index 2c85f5b1f9c1..7e996bcf026c 100644
--- a/drivers/scsi/bfa/bfa_fcpim.c
+++ b/drivers/scsi/bfa/bfa_fcpim.c
@@ -2586,6 +2586,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim)
case FCP_IODIR_RW:
bfa_stats(itnim, input_reqs);
bfa_stats(itnim, output_reqs);
+   /* fall through */
default:
bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_fn_lpu(ioim->bfa));
}
@@ -2820,6 +2821,7 @@ bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
  
  	case BFI_IOIM_STS_TIMEDOUT:

bfa_stats(ioim->itnim, iocomp_timedout);
+   /* fall through */
case BFI_IOIM_STS_ABORTED:
rsp->io_status = BFI_IOIM_STS_ABORTED;
bfa_stats(ioim->itnim, iocomp_aborted);
@@ -3215,9 +3217,7 @@ bfa_tskim_sm_cleanup_qfull(struct bfa_tskim_s *tskim,
switch (event) {
case BFA_TSKIM_SM_DONE:
bfa_reqq_wcancel(&tskim->reqq_wait);
-   /*
-* Fall through !!!
-*/
+   /* fall through */
case BFA_TSKIM_SM_QRESUME:
bfa_sm_set_state(tskim, bfa_tskim_sm_cleanup);
bfa_tskim_send_abort(tskim);



Re: [PATCH 08/41] scsi: be2iscsi: be_main: Mark expected switch fall-through

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:27 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: 1357387 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/be2iscsi/be_main.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index effb6fc95af4..b6449da1320c 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -1539,6 +1539,7 @@ beiscsi_hdl_get_handle(struct beiscsi_conn *beiscsi_conn,
break;
case UNSOL_DATA_DIGEST_ERROR_NOTIFY:
error = 1;
+   /* fall through */
case UNSOL_DATA_NOTIFY:
pasync_handle = pasync_ctx->async_entry[ci].data;
break;



Re: [PATCH 07/41] scsi: be2iscsi: be_iscsi: Mark expected switch fall-through

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:26 PM, Gustavo A. R. Silva wrote:

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

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/be2iscsi/be_iscsi.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c
index 96b96e2ab91a..ed1bd369baa0 100644
--- a/drivers/scsi/be2iscsi/be_iscsi.c
+++ b/drivers/scsi/be2iscsi/be_iscsi.c
@@ -679,6 +679,7 @@ int beiscsi_set_param(struct iscsi_cls_conn *cls_conn,
case ISCSI_PARAM_MAX_XMIT_DLENGTH:
if (conn->max_xmit_dlength > 65536)
conn->max_xmit_dlength = 65536;
+   /* fall through */
default:
return 0;
}



Re: [PATCH 06/41] scsi: aic7xxx: mark expected switch fall-throughs

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:26 PM, Gustavo A. R. Silva wrote:

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

Notice that, in some cases, I replaced "FALLTHROUGH" with a "fall through"
annotation and then placed it at the bottom of the corresponding switch
case, which is what GCC is expecting to find.

Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/aic7xxx/aic7xxx_core.c | 12 +---
  1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c 
b/drivers/scsi/aic7xxx/aic7xxx_core.c
index f3362f4ab16e..d4a7263e4b8f 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -4920,24 +4920,30 @@ ahc_fini_scbdata(struct ahc_softc *ahc)
}
ahc_dma_tag_destroy(ahc, scb_data->sg_dmat);
}
+   /* fall through */
case 6:
ahc_dmamap_unload(ahc, scb_data->sense_dmat,
  scb_data->sense_dmamap);
+   /* fall through */
case 5:
ahc_dmamem_free(ahc, scb_data->sense_dmat, scb_data->sense,
scb_data->sense_dmamap);
ahc_dmamap_destroy(ahc, scb_data->sense_dmat,
   scb_data->sense_dmamap);
+   /* fall through */
case 4:
ahc_dma_tag_destroy(ahc, scb_data->sense_dmat);
+   /* fall through */
case 3:
ahc_dmamap_unload(ahc, scb_data->hscb_dmat,
  scb_data->hscb_dmamap);
+   /* fall through */
case 2:
ahc_dmamem_free(ahc, scb_data->hscb_dmat, scb_data->hscbs,
scb_data->hscb_dmamap);
ahc_dmamap_destroy(ahc, scb_data->hscb_dmat,
   scb_data->hscb_dmamap);
+   /* fall through */
case 1:
ahc_dma_tag_destroy(ahc, scb_data->hscb_dmat);
break;
@@ -6002,8 +6008,8 @@ ahc_search_qinfifo(struct ahc_softc *ahc, int target, 
char channel,
if ((scb->flags & SCB_ACTIVE) == 0)
printk("Inactive SCB in Waiting 
List\n");
ahc_done(ahc, scb);
-   /* FALLTHROUGH */
}
+   /* fall through */
case SEARCH_REMOVE:
next = ahc_rem_wscb(ahc, next, prev);
break;
@@ -7008,8 +7014,8 @@ ahc_download_instr(struct ahc_softc *ahc, u_int instrptr, 
uint8_t *dconsts)
}
address -= address_offset;
fmt3_ins->address = address;
-   /* FALLTHROUGH */
}
+   /* fall through */
case AIC_OP_OR:
case AIC_OP_AND:
case AIC_OP_XOR:
@@ -7035,7 +7041,7 @@ ahc_download_instr(struct ahc_softc *ahc, u_int instrptr, 
uint8_t *dconsts)
fmt1_ins->opcode = AIC_OP_AND;
fmt1_ins->immediate = 0xff;
}
-   /* FALLTHROUGH */
+   /* fall through */
case AIC_OP_ROL:
if ((ahc->features & AHC_ULTRA2) != 0) {
int i, count;



Re: [PATCH 05/41] scsi: aic7xxx: aic79xx: mark expected switch fall-through

2018-12-19 Thread Gustavo A. R. Silva

Hi,

Friendly ping:

Who can ack or review this patch, please?

Thanks
--
Gustavo

On 11/27/18 10:26 PM, Gustavo A. R. Silva wrote:

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

Notice that, in some cases, I replaced "FALLTHROUGH" with a "fall through"
annotation and then placed it at the bottom of the corresponding switch
case, which is what GCC is expecting to find.

Addresses-Coverity-ID: 114961 ("Missing break in switch")
Addresses-Coverity-ID: 114962 ("Missing break in switch")
Addresses-Coverity-ID: 114963 ("Missing break in switch")
Addresses-Coverity-ID: 114964 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
  drivers/scsi/aic7xxx/aic79xx_core.c | 14 +-
  1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c 
b/drivers/scsi/aic7xxx/aic79xx_core.c
index 9ee75c9a9aa1..7e5044bf05c0 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -2285,6 +2285,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
switch (scb->hscb->task_management) {
case SIU_TASKMGMT_ABORT_TASK:
tag = SCB_GET_TAG(scb);
+   /* fall through */
case SIU_TASKMGMT_ABORT_TASK_SET:
case SIU_TASKMGMT_CLEAR_TASK_SET:
lun = scb->hscb->lun;
@@ -2295,6 +2296,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
break;
case SIU_TASKMGMT_LUN_RESET:
lun = scb->hscb->lun;
+   /* fall through */
case SIU_TASKMGMT_TARGET_RESET:
{
struct ahd_devinfo devinfo;
@@ -6550,8 +6552,8 @@ ahd_fini_scbdata(struct ahd_softc *ahd)
kfree(sns_map);
}
ahd_dma_tag_destroy(ahd, scb_data->sense_dmat);
-   /* FALLTHROUGH */
}
+   /* fall through */
case 6:
{
struct map_node *sg_map;
@@ -6565,8 +6567,8 @@ ahd_fini_scbdata(struct ahd_softc *ahd)
kfree(sg_map);
}
ahd_dma_tag_destroy(ahd, scb_data->sg_dmat);
-   /* FALLTHROUGH */
}
+   /* fall through */
case 5:
{
struct map_node *hscb_map;
@@ -7209,6 +7211,7 @@ ahd_init(struct ahd_softc *ahd)
case FLX_CSTAT_OVER:
case FLX_CSTAT_UNDER:
warn_user++;
+   /* fall through */
case FLX_CSTAT_INVALID:
case FLX_CSTAT_OKAY:
if (warn_user == 0 && bootverbose == 0)
@@ -8413,7 +8416,7 @@ ahd_search_scb_list(struct ahd_softc *ahd, int target, 
char channel,
if ((scb->flags & SCB_ACTIVE) == 0)
printk("Inactive SCB in Waiting List\n");
ahd_done_with_status(ahd, scb, status);
-   /* FALLTHROUGH */
+   /* fall through */
case SEARCH_REMOVE:
ahd_rem_wscb(ahd, scbid, prev, next, tid);
*list_tail = prev;
@@ -8422,6 +8425,7 @@ ahd_search_scb_list(struct ahd_softc *ahd, int target, 
char channel,
break;
case SEARCH_PRINT:
printk("0x%x ", scbid);
+   /* fall through */
case SEARCH_COUNT:
prev = scbid;
break;
@@ -9547,8 +9551,8 @@ ahd_download_instr(struct ahd_softc *ahd, u_int instrptr, 
uint8_t *dconsts)
{
fmt3_ins = &instr.format3;
fmt3_ins->address = ahd_resolve_seqaddr(ahd, fmt3_ins->address);
-   /* FALLTHROUGH */
}
+   /* fall through */
case AIC_OP_OR:
case AIC_OP_AND:
case AIC_OP_XOR:
@@ -9559,7 +9563,7 @@ ahd_download_instr(struct ahd_softc *ahd, u_int instrptr, 
uint8_t *dconsts)
fmt1_ins->immediate = dconsts[fmt1_ins->immediate];
}
fmt1_ins->parity = 0;
-   /* FALLTHROUGH */
+   /* fall through */
case AIC_OP_ROL:
{
int i, count;



Re: [PATCH 00/41] scsi: Mark expected switch fall-throughs

2018-12-18 Thread Gustavo A. R. Silva




On 12/18/18 9:45 PM, Martin K. Petersen wrote:


If you haven't received feedback on a patch you should poke the relevant
driver maintainer.



Got it. Will do so.

Thanks
--
Gustavo


Re: [PATCH 33/41] scsi: osd: osd_initiator: mark expected switch fall-throughs

2018-12-18 Thread Gustavo A. R. Silva




On 12/18/18 11:13 AM, Boaz Harrosh wrote:

On 28/11/18 06:32, Gustavo A. R. Silva wrote:

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

Signed-off-by: Gustavo A. R. Silva 


ACK-by: Boaz Harrosh 



Thank you, Boaz.
--
Gustavo


Re: [PATCH 00/41] scsi: Mark expected switch fall-throughs

2018-12-18 Thread Gustavo A. R. Silva

Hi Martin,

Friendly ping:

Only 8 out the 41 patches in this series have been applied so far.

I wonder if you could apply the rest of this series, except:

 [PATCH 02/41] scsi: NCR5380: Mark expected switch fall-through

(I'll send a v2 of this patch)

Thanks
--
Gustavo

On 11/27/18 10:18 PM, Gustavo A. R. Silva wrote:

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

I reviewed case by case and concluded that each of them is an
intentional fall-through. However, it doesn't hurt that the
maintainers and supporters of each driver take a look. :)

Each commit log contains the particular details for the changes in the
corresponding file.

This series fix a total of 110 of the following type of warnings in
drivers/scsi:

drivers/scsi/aic7xxx/aic7xxx_core.c:4921:3: warning: this statement may fall 
through [-Wimplicit-fallthrough=]
ahc_dma_tag_destroy(ahc, scb_data->sg_dmat);
^~~
drivers/scsi/aic7xxx/aic7xxx_core.c:4923:2: note: here
   case 6:
   ^~~~

Thanks!

Gustavo A. R. Silva (41):
   scsi: BusLogic: mark expected switch fall-through
   scsi: NCR5380: Mark expected switch fall-through
   scsi: aacraid: aachba: Mark expected switch fall-throughs
   scsi: aacraid: linit: Mark expected switch fall-through
   scsi: aic7xxx: aic79xx: mark expected switch fall-through
   scsi: aic7xxx: mark expected switch fall-throughs
   scsi: be2iscsi: be_iscsi: Mark expected switch fall-through
   scsi: be2iscsi: be_main: Mark expected switch fall-through
   scsi: bfa: bfa_fcpim: Mark expected switch fall-throughs
   scsi: bfa: bfa_fcs_lport: Mark expected switch fall-throughs
   scsi: bfa: bfa_fcs_rport: Mark expected switch fall-throughs
   scsi: bfa: bfa_ioc: Mark expected switch fall-throughs
   scsi: csiostor: csio_wr: mark expected switch fall-through
   scsi: esas2r: esas2r_init: mark expected switch fall-throughs
   scsi: hpsa: mark expected switch fall-throughs
   scsi: imm: mark expected switch fall-throughs
   scsi: isci: phy: Mark expected switch fall-through
   scsi: isci: remote_device: Mark expected switch fall-throughs
   scsi: isci: remote_node_context: mark expected switch fall-throughs
   scsi: isci: request: mark expected switch fall-through
   scsi: libfc: fc_rport: Mark expected switch fall-through
   scsi: lpfc: lpfc_ct: Mark expected switch fall-throughs
   scsi: lpfc: lpfc_els: Mark expected switch fall-throughs
   scsi: lpfc: lpfc_hbadisc: Mark expected switch fall-throughs
   scsi: lpfc: lpfc_nportdisc: Mark expected switch fall-through
   scsi: lpfc: lpfc_nvme: Mark expected switch fall-through
   scsi: lpfc: lpfc_scsi: Mark expected switch fall-throughs
   scsi: lpfc: lpfc_sli: Mark expected switch fall-throughs
   scsi: megaraid: megaraid_sas_base: Mark expected switch fall-through
   scsi: megaraid_sas_fusion: Mark expected switch fall-through
   scsi: mpt3sas: mpt3sas_scsih: Mark expected switch fall-through
   scsi: myrb: Mark expected switch fall-throughs
   scsi: osd: osd_initiator: mark expected switch fall-throughs
   scsi: osst: mark expected switch fall-throughs
   scsi: ppa: mark expected switch fall-through
   scsi: qla4xxx: ql4_os: mark expected switch fall-through
   scsi: st: mark expected switch fall-throughs
   scsi: sym53c8xx_2: sym_hipd: mark expected switch fall-throughs
   scsi: sym53c8xx_2: sym_nvram: Mark expected switch fall-through
   scsi: ufs: ufshcd: mark expected switch fall-throughs
   scsi: xen-scsifront: mark expected switch fall-through

  drivers/scsi/BusLogic.c |  1 +
  drivers/scsi/NCR5380.c  |  3 +-
  drivers/scsi/aacraid/aachba.c   |  5 +++-
  drivers/scsi/aacraid/linit.c|  1 +
  drivers/scsi/aic7xxx/aic79xx_core.c | 14 +
  drivers/scsi/aic7xxx/aic7xxx_core.c | 12 ++--
  drivers/scsi/be2iscsi/be_iscsi.c|  1 +
  drivers/scsi/be2iscsi/be_main.c |  1 +
  drivers/scsi/bfa/bfa_fcpim.c|  6 ++--
  drivers/scsi/bfa/bfa_fcs_lport.c|  8 ++---
  drivers/scsi/bfa/bfa_fcs_rport.c| 19 +---
  drivers/scsi/bfa/bfa_ioc.c  |  9 ++
  drivers/scsi/csiostor/csio_wr.c |  1 +
  drivers/scsi/esas2r/esas2r_init.c   |  3 +-
  drivers/scsi/hpsa.c |  5 
  drivers/scsi/imm.c  | 33 +++--
  drivers/scsi/isci/phy.c |  1 +
  drivers/scsi/isci/remote_device.c   |  4 +--
  drivers/scsi/isci/remote_node_context.c |  4 +--
  drivers/scsi/isci/request.c |  2 +-
  drivers/scsi/libfc/fc_rport.c   |  1 +
  drivers/scsi/lpfc/lpfc_ct.c |  2 ++
  drivers/scsi/lpfc/lpfc_els.c|  1 +
  drivers/scsi/lpfc/lpfc_hbadisc.c|  4 ++-
  drivers/scsi/lpfc/lpfc_nportdisc.c  |  1 +
  driv

[PATCH] scsi: mptfusion: Fix potential Spectre v1 vulnerabilities

2018-12-14 Thread Gustavo A. R. Silva
karg.hdr.id and port are indirectly controlled by user-space, hence leading
to a potential exploitation of the Spectre variant 1 vulnerability.

This issue was detected with the help of Smatch:

drivers/message/fusion/mptctl.c:1360 mptctl_getiocinfo() warn: potential 
spectre issue 'ioc->pfacts' [r]
drivers/message/fusion/mptctl.c:2788 mptctl_hp_targetinfo() warn: potential 
spectre issue 'hd->sel_timeout' [r] (local cap)

Fix this by sanitizing  both karg.hdr.id and port before using them to
index ioc->pfacts and hd->sel_timeout.

Notice that given that speculation windows are large, the policy is
to kill the speculation on the first load and not worry if it can be
completed with a dependent load/store [1].

[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2

Cc: sta...@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva 
---
 drivers/message/fusion/mptctl.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c
index 8d22d6134a89..f6c1311ae86f 100644
--- a/drivers/message/fusion/mptctl.c
+++ b/drivers/message/fusion/mptctl.c
@@ -66,6 +66,8 @@
 #include 
 #include 
 
+#include 
+
 #define COPYRIGHT  "Copyright (c) 1999-2008 LSI Corporation"
 #define MODULEAUTHOR   "LSI Corporation"
 #include "mptbase.h"
@@ -1306,7 +1308,7 @@ mptctl_getiocinfo (unsigned long arg, unsigned int 
data_size)
kfree(karg);
return -EINVAL;
}
-   port = karg->hdr.port;
+   port = array_index_nospec(karg->hdr.port, 2);
 
karg->port = port;
pdev = (struct pci_dev *) ioc->pcidev;
@@ -2689,6 +2691,7 @@ mptctl_hp_targetinfo(unsigned long arg)
}
if (karg.hdr.id >= MPT_MAX_FC_DEVICES)
return -EINVAL;
+   karg.hdr.id = array_index_nospec(karg.hdr.id, MPT_MAX_FC_DEVICES);
dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_hp_targetinfo 
called.\n",
ioc->name));
 
-- 
2.19.2



Re: [PATCH 02/41] scsi: NCR5380: Mark expected switch fall-through

2018-11-28 Thread Gustavo A. R. Silva

Hi Michael,

On 11/28/18 2:22 AM, Michael Schmitz wrote:


I believe the 'if we get something weird' comment block relates to the
default branch of the switch, _not_ the fall through from the case above
(extended message received that we end up rejecting). Ordering the
comments like you did just for GCC's sake is misleading.

The comment block should perhaps be moved after the default label. And
it would be nice if the reason for the fall through could be retained in
the comment.



Oh Okay. I'll do that.

Thanks for the feedback.
--
Gustavo


[PATCH 22/41] scsi: lpfc: lpfc_ct: Mark expected switch fall-throughs

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/lpfc/lpfc_ct.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index 6305ffeba7ea..b2b7fcc23654 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -3050,6 +3050,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct 
lpfc_nodelist *ndlp,
case SLI_MGMT_GHAT:
case SLI_MGMT_GRPL:
rsp_size = FC_MAX_NS_RSP;
+   /* fall through */
case SLI_MGMT_DHBA:
case SLI_MGMT_DHAT:
pe = (struct lpfc_fdmi_port_entry *)&CtReq->un.PortID;
@@ -3062,6 +3063,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct 
lpfc_nodelist *ndlp,
case SLI_MGMT_GPAT:
case SLI_MGMT_GPAS:
rsp_size = FC_MAX_NS_RSP;
+   /* fall through */
case SLI_MGMT_DPRT:
case SLI_MGMT_DPA:
pe = (struct lpfc_fdmi_port_entry *)&CtReq->un.PortID;
-- 
2.17.1



[PATCH 26/41] scsi: lpfc: lpfc_nvme: Mark expected switch fall-through

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/lpfc/lpfc_nvme.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c
index ba831def9301..942fe58c433d 100644
--- a/drivers/scsi/lpfc/lpfc_nvme.c
+++ b/drivers/scsi/lpfc/lpfc_nvme.c
@@ -1115,6 +1115,7 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct 
lpfc_iocbq *pwqeIn,
 lpfc_ncmd, nCmd,
 lpfc_ncmd->cur_iocbq.sli4_xritag,
 bf_get(lpfc_wcqe_c_xb, wcqe));
+   /* fall through */
default:
 out_err:
lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_IOERR,
-- 
2.17.1



[PATCH 27/41] scsi: lpfc: lpfc_scsi: Mark expected switch fall-throughs

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Notice that, in this particular case, I replaced "Drop thru" with
"fall through" annotations, which is what GCC is expecting to find.

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/lpfc/lpfc_scsi.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index baed2b891efb..0eeed6c4c2ee 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -1427,7 +1427,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct 
scsi_cmnd *sc,
 
break;
}
-   /* Drop thru */
+   /* fall through */
case SCSI_PROT_WRITE_INSERT:
/*
 * For WRITE_INSERT, force the error
@@ -1546,7 +1546,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct 
scsi_cmnd *sc,
rc = BG_ERR_TGT | BG_ERR_CHECK;
break;
}
-   /* Drop thru */
+   /* fall through */
case SCSI_PROT_WRITE_INSERT:
/*
 * For WRITE_INSERT, force the
@@ -1628,7 +1628,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct 
scsi_cmnd *sc,
switch (op) {
case SCSI_PROT_WRITE_PASS:
rc = BG_ERR_CHECK;
-   /* Drop thru */
+   /* fall through */
 
case SCSI_PROT_WRITE_INSERT:
/*
@@ -4115,7 +4115,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct 
lpfc_iocbq *pIocbIn,
lpfc_cmd->cur_iocbq.sli4_lxritag,
0, 0);
}
-   /* else: fall through */
+   /* fall through */
default:
cmd->result = DID_ERROR << 16;
break;
-- 
2.17.1



[PATCH 38/41] scsi: sym53c8xx_2: sym_hipd: mark expected switch fall-throughs

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 114996 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/sym53c8xx_2/sym_hipd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c 
b/drivers/scsi/sym53c8xx_2/sym_hipd.c
index 0a2a54517b15..054fb0599263 100644
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.c
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c
@@ -3072,6 +3072,7 @@ static void sym_sir_bad_scsi_status(struct sym_hcb *np, 
int num, struct sym_ccb
sym_print_addr(cp->cmd, "%s\n",
s_status == S_BUSY ? "BUSY" : "QUEUE FULL\n");
}
+   /* fall through */
default:/* S_INT, S_INT_COND_MET, S_CONFLICT */
sym_complete_error (np, cp);
break;
@@ -4632,6 +4633,7 @@ static void sym_int_sir(struct sym_hcb *np)
 *  Negotiation failed.
 *  Target does not want answer message.
 */
+   /* fall through */
case SIR_NEGO_PROTO:
sym_nego_default(np, tp, cp);
goto out;
-- 
2.17.1



[PATCH 35/41] scsi: ppa: mark expected switch fall-through

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 114988 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/ppa.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c
index ee86a0c62dbf..d2ba5458 100644
--- a/drivers/scsi/ppa.c
+++ b/drivers/scsi/ppa.c
@@ -717,6 +717,7 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd 
*cmd)
}
cmd->SCp.phase++;
}
+   /* fall through */
 
case 2: /* Phase 2 - We are now talking to the scsi bus */
if (!ppa_select(dev, scmd_id(cmd))) {
-- 
2.17.1



[PATCH 25/41] scsi: lpfc: lpfc_nportdisc: Mark expected switch fall-through

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/lpfc/lpfc_nportdisc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c 
b/drivers/scsi/lpfc/lpfc_nportdisc.c
index 7d5693cfaa87..e8583496feaf 100644
--- a/drivers/scsi/lpfc/lpfc_nportdisc.c
+++ b/drivers/scsi/lpfc/lpfc_nportdisc.c
@@ -360,6 +360,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct 
lpfc_nodelist *ndlp,
case  NLP_STE_NPR_NODE:
if (!(ndlp->nlp_flag & NLP_NPR_ADISC))
break;
+   /* fall through */
case  NLP_STE_REG_LOGIN_ISSUE:
case  NLP_STE_PRLI_ISSUE:
case  NLP_STE_UNMAPPED_NODE:
-- 
2.17.1



[PATCH 16/41] scsi: imm: mark expected switch fall-throughs

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Notice that, in this particular case, I placed all the "Phase N - ..."
comments on the same line as its corresponding switch case. The same
way in which similar comments appear in drivers/scsi/ppa.c. This makes
it possible to place the "fall through" annotations at the bottom of
each switch case, which is what GCC is expecting to find.

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/imm.c | 33 +
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c
index 8c6627bc8a39..629e0bc70d3e 100644
--- a/drivers/scsi/imm.c
+++ b/drivers/scsi/imm.c
@@ -796,21 +796,21 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd 
*cmd)
return 0;
}
return 1;   /* wait until imm_wakeup claims parport */
-   /* Phase 1 - Connected */
-   case 1:
+
+   case 1: /* Phase 1 - Connected */
imm_connect(dev, CONNECT_EPP_MAYBE);
cmd->SCp.phase++;
+   /* fall through */
 
-   /* Phase 2 - We are now talking to the scsi bus */
-   case 2:
+   case 2: /* Phase 2 - We are now talking to the scsi bus */
if (!imm_select(dev, scmd_id(cmd))) {
imm_fail(dev, DID_NO_CONNECT);
return 0;
}
cmd->SCp.phase++;
+   /* fall through */
 
-   /* Phase 3 - Ready to accept a command */
-   case 3:
+   case 3: /* Phase 3 - Ready to accept a command */
w_ctr(ppb, 0x0c);
if (!(r_str(ppb) & 0x80))
return 1;
@@ -818,9 +818,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd 
*cmd)
if (!imm_send_command(cmd))
return 0;
cmd->SCp.phase++;
+   /* fall through */
 
-   /* Phase 4 - Setup scatter/gather buffers */
-   case 4:
+   case 4: /* Phase 4 - Setup scatter/gather buffers */
if (scsi_bufflen(cmd)) {
cmd->SCp.buffer = scsi_sglist(cmd);
cmd->SCp.this_residual = cmd->SCp.buffer->length;
@@ -834,8 +834,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd 
*cmd)
cmd->SCp.phase++;
if (cmd->SCp.this_residual & 0x01)
cmd->SCp.this_residual++;
-   /* Phase 5 - Pre-Data transfer stage */
-   case 5:
+   /* fall through */
+
+   case 5: /* Phase 5 - Pre-Data transfer stage */
/* Spin lock for BUSY */
w_ctr(ppb, 0x0c);
if (!(r_str(ppb) & 0x80))
@@ -850,9 +851,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd 
*cmd)
if (imm_negotiate(dev))
return 0;
cmd->SCp.phase++;
+   /* fall through */
 
-   /* Phase 6 - Data transfer stage */
-   case 6:
+   case 6: /* Phase 6 - Data transfer stage */
/* Spin lock for BUSY */
w_ctr(ppb, 0x0c);
if (!(r_str(ppb) & 0x80))
@@ -866,9 +867,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd 
*cmd)
return 1;
}
cmd->SCp.phase++;
+   /* fall through */
 
-   /* Phase 7 - Post data transfer stage */
-   case 7:
+   case 7: /* Phase 7 - Post data transfer stage */
if ((dev->dp) && (dev->rd)) {
if ((dev->mode == IMM_NIBBLE) || (dev->mode == 
IMM_PS2)) {
w_ctr(ppb, 0x4);
@@ -878,9 +879,9 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd 
*cmd)
}
}
cmd->SCp.phase++;
+   /* fall through */
 
-   /* Phase 8 - Read status/message */
-   case 8:
+   case 8: /* Phase 8 - Read status/message */
/* Check for data overrun */
if (imm_wait(dev) != (unsigned char) 0xb8) {
imm_fail(dev, DID_ERROR);
-- 
2.17.1



[PATCH 20/41] scsi: isci: request: mark expected switch fall-through

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Notice that, in this particular case, a dash is added as a token in
order to separate the "Fall through" annotation from the rest of the
comment on the same line, which is what GCC is expecting to find.

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/isci/request.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c
index 2f151708b59a..1b18cf55167e 100644
--- a/drivers/scsi/isci/request.c
+++ b/drivers/scsi/isci/request.c
@@ -894,7 +894,7 @@ sci_io_request_terminate(struct isci_request *ireq)
 * and don't wait for the task response.
 */
sci_change_state(&ireq->sm, SCI_REQ_ABORTING);
-   /* Fall through and handle like ABORTING... */
+   /* Fall through - and handle like ABORTING... */
case SCI_REQ_ABORTING:
if (!isci_remote_device_is_safe_to_abort(ireq->target_device))
set_bit(IREQ_PENDING_ABORT, &ireq->flags);
-- 
2.17.1



[PATCH 23/41] scsi: lpfc: lpfc_els: Mark expected switch fall-throughs

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 114978 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/lpfc/lpfc_els.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 5c34bfa624ef..1f20c35e0f84 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -8649,6 +8649,7 @@ lpfc_cmpl_reg_new_vport(struct lpfc_hba *phba, 
LPFC_MBOXQ_t *pmb)
lpfc_nlp_put(ndlp);
return;
}
+   /* fall through */
 
default:
/* Try to recover from this error */
-- 
2.17.1



[PATCH 18/41] scsi: isci: remote_device: Mark expected switch fall-throughs

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Notice that, in this particular case, a dash is added as a token in
order to separate the "fall through" annotations from the rest of
the comment on the same line, which is what GCC is expecting to find.

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/isci/remote_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/isci/remote_device.c 
b/drivers/scsi/isci/remote_device.c
index cc51f38b116d..9d29edb9f590 100644
--- a/drivers/scsi/isci/remote_device.c
+++ b/drivers/scsi/isci/remote_device.c
@@ -310,7 +310,7 @@ static void isci_remote_device_not_ready(struct isci_host 
*ihost,
/* Kill all outstanding requests for the device. */
sci_remote_device_terminate_requests(idev);
 
-   /* Fall through into the default case... */
+   /* Fall through - into the default case... */
default:
clear_bit(IDEV_IO_READY, &idev->flags);
break;
@@ -593,7 +593,7 @@ enum sci_status sci_remote_device_event_handler(struct 
isci_remote_device *idev,
 
break;
}
-   /* Else, fall through and treat as unhandled... */
+   /* fall through - and treat as unhandled... */
default:
dev_dbg(scirdev_to_dev(idev),
"%s: device: %p event code: %x: %s\n",
-- 
2.17.1



[PATCH 04/41] scsi: aacraid: linit: Mark expected switch fall-through

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/aacraid/linit.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 2d4e4ddc5ace..42defee90eb2 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -759,6 +759,7 @@ static int aac_eh_abort(struct scsi_cmnd* cmd)
!(aac->raw_io_64) ||
((cmd->cmnd[1] & 0x1f) != SAI_READ_CAPACITY_16))
break;
+   /* fall through */
case INQUIRY:
case READ_CAPACITY:
/*
-- 
2.17.1



[PATCH 13/41] scsi: csiostor: csio_wr: mark expected switch fall-through

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 1056538 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/csiostor/csio_wr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/csiostor/csio_wr.c b/drivers/scsi/csiostor/csio_wr.c
index dc12933533d5..b6861ea66c9f 100644
--- a/drivers/scsi/csiostor/csio_wr.c
+++ b/drivers/scsi/csiostor/csio_wr.c
@@ -808,6 +808,7 @@ csio_wr_destroy_queues(struct csio_hw *hw, bool cmd)
 
csio_q_eqid(hw, i) = CSIO_MAX_QID;
}
+   /* fall through */
case CSIO_INGRESS:
if (csio_q_iqid(hw, i) != CSIO_MAX_QID) {
csio_wr_cleanup_iq_ftr(hw, i);
-- 
2.17.1



[PATCH 14/41] scsi: esas2r: esas2r_init: mark expected switch fall-throughs

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/esas2r/esas2r_init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/esas2r/esas2r_init.c 
b/drivers/scsi/esas2r/esas2r_init.c
index 46b2c83ba21f..950cd92df2ff 100644
--- a/drivers/scsi/esas2r/esas2r_init.c
+++ b/drivers/scsi/esas2r/esas2r_init.c
@@ -1241,6 +1241,7 @@ static bool esas2r_format_init_msg(struct esas2r_adapter 
*a,
a->init_msg = ESAS2R_INIT_MSG_GET_INIT;
break;
}
+   /* fall through */
 
case ESAS2R_INIT_MSG_GET_INIT:
if (msg == ESAS2R_INIT_MSG_GET_INIT) {
@@ -1254,7 +1255,7 @@ static bool esas2r_format_init_msg(struct esas2r_adapter 
*a,
esas2r_hdebug("FAILED");
}
}
-   /* fall through */
+   /* fall through */
 
default:
rq->req_stat = RS_SUCCESS;
-- 
2.17.1



[PATCH 05/41] scsi: aic7xxx: aic79xx: mark expected switch fall-through

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Notice that, in some cases, I replaced "FALLTHROUGH" with a "fall through"
annotation and then placed it at the bottom of the corresponding switch
case, which is what GCC is expecting to find.

Addresses-Coverity-ID: 114961 ("Missing break in switch")
Addresses-Coverity-ID: 114962 ("Missing break in switch")
Addresses-Coverity-ID: 114963 ("Missing break in switch")
Addresses-Coverity-ID: 114964 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/aic7xxx/aic79xx_core.c | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c 
b/drivers/scsi/aic7xxx/aic79xx_core.c
index 9ee75c9a9aa1..7e5044bf05c0 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -2285,6 +2285,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
switch (scb->hscb->task_management) {
case SIU_TASKMGMT_ABORT_TASK:
tag = SCB_GET_TAG(scb);
+   /* fall through */
case SIU_TASKMGMT_ABORT_TASK_SET:
case SIU_TASKMGMT_CLEAR_TASK_SET:
lun = scb->hscb->lun;
@@ -2295,6 +2296,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
break;
case SIU_TASKMGMT_LUN_RESET:
lun = scb->hscb->lun;
+   /* fall through */
case SIU_TASKMGMT_TARGET_RESET:
{
struct ahd_devinfo devinfo;
@@ -6550,8 +6552,8 @@ ahd_fini_scbdata(struct ahd_softc *ahd)
kfree(sns_map);
}
ahd_dma_tag_destroy(ahd, scb_data->sense_dmat);
-   /* FALLTHROUGH */
}
+   /* fall through */
case 6:
{
struct map_node *sg_map;
@@ -6565,8 +6567,8 @@ ahd_fini_scbdata(struct ahd_softc *ahd)
kfree(sg_map);
}
ahd_dma_tag_destroy(ahd, scb_data->sg_dmat);
-   /* FALLTHROUGH */
}
+   /* fall through */
case 5:
{
struct map_node *hscb_map;
@@ -7209,6 +7211,7 @@ ahd_init(struct ahd_softc *ahd)
case FLX_CSTAT_OVER:
case FLX_CSTAT_UNDER:
warn_user++;
+   /* fall through */
case FLX_CSTAT_INVALID:
case FLX_CSTAT_OKAY:
if (warn_user == 0 && bootverbose == 0)
@@ -8413,7 +8416,7 @@ ahd_search_scb_list(struct ahd_softc *ahd, int target, 
char channel,
if ((scb->flags & SCB_ACTIVE) == 0)
printk("Inactive SCB in Waiting List\n");
ahd_done_with_status(ahd, scb, status);
-   /* FALLTHROUGH */
+   /* fall through */
case SEARCH_REMOVE:
ahd_rem_wscb(ahd, scbid, prev, next, tid);
*list_tail = prev;
@@ -8422,6 +8425,7 @@ ahd_search_scb_list(struct ahd_softc *ahd, int target, 
char channel,
break;
case SEARCH_PRINT:
printk("0x%x ", scbid);
+   /* fall through */
case SEARCH_COUNT:
prev = scbid;
break;
@@ -9547,8 +9551,8 @@ ahd_download_instr(struct ahd_softc *ahd, u_int instrptr, 
uint8_t *dconsts)
{
fmt3_ins = &instr.format3;
fmt3_ins->address = ahd_resolve_seqaddr(ahd, fmt3_ins->address);
-   /* FALLTHROUGH */
}
+   /* fall through */
case AIC_OP_OR:
case AIC_OP_AND:
case AIC_OP_XOR:
@@ -9559,7 +9563,7 @@ ahd_download_instr(struct ahd_softc *ahd, u_int instrptr, 
uint8_t *dconsts)
fmt1_ins->immediate = dconsts[fmt1_ins->immediate];
}
fmt1_ins->parity = 0;
-   /* FALLTHROUGH */
+   /* fall through */
case AIC_OP_ROL:
{
int i, count;
-- 
2.17.1



[PATCH 15/41] scsi: hpsa: mark expected switch fall-throughs

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 1195463 ("Missing break in switch")
Addresses-Coverity-ID: 1195464 ("Missing break in switch")
Addresses-Coverity-ID: 1195465 ("Missing break in switch")
Addresses-Coverity-ID: 1195466 ("Missing break in switch")
Addresses-Coverity-ID: 1357338 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/hpsa.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index c9cccf35e9d7..bc64e8a0449d 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -4663,6 +4663,7 @@ static int fixup_ioaccel_cdb(u8 *cdb, int *cdb_len)
case WRITE_6:
case WRITE_12:
is_write = 1;
+   /* fall through */
case READ_6:
case READ_12:
if (*cdb_len == 6) {
@@ -5093,6 +5094,7 @@ static int hpsa_scsi_ioaccel_raid_map(struct ctlr_info *h,
switch (cmd->cmnd[0]) {
case WRITE_6:
is_write = 1;
+   /* fall through */
case READ_6:
first_block = (((cmd->cmnd[1] & 0x1F) << 16) |
(cmd->cmnd[2] << 8) |
@@ -5103,6 +5105,7 @@ static int hpsa_scsi_ioaccel_raid_map(struct ctlr_info *h,
break;
case WRITE_10:
is_write = 1;
+   /* fall through */
case READ_10:
first_block =
(((u64) cmd->cmnd[2]) << 24) |
@@ -5115,6 +5118,7 @@ static int hpsa_scsi_ioaccel_raid_map(struct ctlr_info *h,
break;
case WRITE_12:
is_write = 1;
+   /* fall through */
case READ_12:
first_block =
(((u64) cmd->cmnd[2]) << 24) |
@@ -5129,6 +5133,7 @@ static int hpsa_scsi_ioaccel_raid_map(struct ctlr_info *h,
break;
case WRITE_16:
is_write = 1;
+   /* fall through */
case READ_16:
first_block =
(((u64) cmd->cmnd[2]) << 56) |
-- 
2.17.1



[PATCH 06/41] scsi: aic7xxx: mark expected switch fall-throughs

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Notice that, in some cases, I replaced "FALLTHROUGH" with a "fall through"
annotation and then placed it at the bottom of the corresponding switch
case, which is what GCC is expecting to find.

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/aic7xxx/aic7xxx_core.c | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c 
b/drivers/scsi/aic7xxx/aic7xxx_core.c
index f3362f4ab16e..d4a7263e4b8f 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -4920,24 +4920,30 @@ ahc_fini_scbdata(struct ahc_softc *ahc)
}
ahc_dma_tag_destroy(ahc, scb_data->sg_dmat);
}
+   /* fall through */
case 6:
ahc_dmamap_unload(ahc, scb_data->sense_dmat,
  scb_data->sense_dmamap);
+   /* fall through */
case 5:
ahc_dmamem_free(ahc, scb_data->sense_dmat, scb_data->sense,
scb_data->sense_dmamap);
ahc_dmamap_destroy(ahc, scb_data->sense_dmat,
   scb_data->sense_dmamap);
+   /* fall through */
case 4:
ahc_dma_tag_destroy(ahc, scb_data->sense_dmat);
+   /* fall through */
case 3:
ahc_dmamap_unload(ahc, scb_data->hscb_dmat,
  scb_data->hscb_dmamap);
+   /* fall through */
case 2:
ahc_dmamem_free(ahc, scb_data->hscb_dmat, scb_data->hscbs,
scb_data->hscb_dmamap);
ahc_dmamap_destroy(ahc, scb_data->hscb_dmat,
   scb_data->hscb_dmamap);
+   /* fall through */
case 1:
ahc_dma_tag_destroy(ahc, scb_data->hscb_dmat);
break;
@@ -6002,8 +6008,8 @@ ahc_search_qinfifo(struct ahc_softc *ahc, int target, 
char channel,
if ((scb->flags & SCB_ACTIVE) == 0)
printk("Inactive SCB in Waiting 
List\n");
ahc_done(ahc, scb);
-   /* FALLTHROUGH */
}
+   /* fall through */
case SEARCH_REMOVE:
next = ahc_rem_wscb(ahc, next, prev);
break;
@@ -7008,8 +7014,8 @@ ahc_download_instr(struct ahc_softc *ahc, u_int instrptr, 
uint8_t *dconsts)
}
address -= address_offset;
fmt3_ins->address = address;
-   /* FALLTHROUGH */
}
+   /* fall through */
case AIC_OP_OR:
case AIC_OP_AND:
case AIC_OP_XOR:
@@ -7035,7 +7041,7 @@ ahc_download_instr(struct ahc_softc *ahc, u_int instrptr, 
uint8_t *dconsts)
fmt1_ins->opcode = AIC_OP_AND;
fmt1_ins->immediate = 0xff;
}
-   /* FALLTHROUGH */
+   /* fall through */
case AIC_OP_ROL:
if ((ahc->features & AHC_ULTRA2) != 0) {
int i, count;
-- 
2.17.1



[PATCH 00/41] scsi: Mark expected switch fall-throughs

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, this patchset aims
to mark switch cases where we are expecting to fall through.

I reviewed case by case and concluded that each of them is an
intentional fall-through. However, it doesn't hurt that the
maintainers and supporters of each driver take a look. :)

Each commit log contains the particular details for the changes in the
corresponding file.

This series fix a total of 110 of the following type of warnings in
drivers/scsi:

drivers/scsi/aic7xxx/aic7xxx_core.c:4921:3: warning: this statement may fall 
through [-Wimplicit-fallthrough=]
   ahc_dma_tag_destroy(ahc, scb_data->sg_dmat);
   ^~~
drivers/scsi/aic7xxx/aic7xxx_core.c:4923:2: note: here
  case 6:
  ^~~~

Thanks!

Gustavo A. R. Silva (41):
  scsi: BusLogic: mark expected switch fall-through
  scsi: NCR5380: Mark expected switch fall-through
  scsi: aacraid: aachba: Mark expected switch fall-throughs
  scsi: aacraid: linit: Mark expected switch fall-through
  scsi: aic7xxx: aic79xx: mark expected switch fall-through
  scsi: aic7xxx: mark expected switch fall-throughs
  scsi: be2iscsi: be_iscsi: Mark expected switch fall-through
  scsi: be2iscsi: be_main: Mark expected switch fall-through
  scsi: bfa: bfa_fcpim: Mark expected switch fall-throughs
  scsi: bfa: bfa_fcs_lport: Mark expected switch fall-throughs
  scsi: bfa: bfa_fcs_rport: Mark expected switch fall-throughs
  scsi: bfa: bfa_ioc: Mark expected switch fall-throughs
  scsi: csiostor: csio_wr: mark expected switch fall-through
  scsi: esas2r: esas2r_init: mark expected switch fall-throughs
  scsi: hpsa: mark expected switch fall-throughs
  scsi: imm: mark expected switch fall-throughs
  scsi: isci: phy: Mark expected switch fall-through
  scsi: isci: remote_device: Mark expected switch fall-throughs
  scsi: isci: remote_node_context: mark expected switch fall-throughs
  scsi: isci: request: mark expected switch fall-through
  scsi: libfc: fc_rport: Mark expected switch fall-through
  scsi: lpfc: lpfc_ct: Mark expected switch fall-throughs
  scsi: lpfc: lpfc_els: Mark expected switch fall-throughs
  scsi: lpfc: lpfc_hbadisc: Mark expected switch fall-throughs
  scsi: lpfc: lpfc_nportdisc: Mark expected switch fall-through
  scsi: lpfc: lpfc_nvme: Mark expected switch fall-through
  scsi: lpfc: lpfc_scsi: Mark expected switch fall-throughs
  scsi: lpfc: lpfc_sli: Mark expected switch fall-throughs
  scsi: megaraid: megaraid_sas_base: Mark expected switch fall-through
  scsi: megaraid_sas_fusion: Mark expected switch fall-through
  scsi: mpt3sas: mpt3sas_scsih: Mark expected switch fall-through
  scsi: myrb: Mark expected switch fall-throughs
  scsi: osd: osd_initiator: mark expected switch fall-throughs
  scsi: osst: mark expected switch fall-throughs
  scsi: ppa: mark expected switch fall-through
  scsi: qla4xxx: ql4_os: mark expected switch fall-through
  scsi: st: mark expected switch fall-throughs
  scsi: sym53c8xx_2: sym_hipd: mark expected switch fall-throughs
  scsi: sym53c8xx_2: sym_nvram: Mark expected switch fall-through
  scsi: ufs: ufshcd: mark expected switch fall-throughs
  scsi: xen-scsifront: mark expected switch fall-through

 drivers/scsi/BusLogic.c |  1 +
 drivers/scsi/NCR5380.c  |  3 +-
 drivers/scsi/aacraid/aachba.c   |  5 +++-
 drivers/scsi/aacraid/linit.c|  1 +
 drivers/scsi/aic7xxx/aic79xx_core.c | 14 +
 drivers/scsi/aic7xxx/aic7xxx_core.c | 12 ++--
 drivers/scsi/be2iscsi/be_iscsi.c|  1 +
 drivers/scsi/be2iscsi/be_main.c |  1 +
 drivers/scsi/bfa/bfa_fcpim.c|  6 ++--
 drivers/scsi/bfa/bfa_fcs_lport.c|  8 ++---
 drivers/scsi/bfa/bfa_fcs_rport.c| 19 +---
 drivers/scsi/bfa/bfa_ioc.c  |  9 ++
 drivers/scsi/csiostor/csio_wr.c |  1 +
 drivers/scsi/esas2r/esas2r_init.c   |  3 +-
 drivers/scsi/hpsa.c |  5 
 drivers/scsi/imm.c  | 33 +++--
 drivers/scsi/isci/phy.c |  1 +
 drivers/scsi/isci/remote_device.c   |  4 +--
 drivers/scsi/isci/remote_node_context.c |  4 +--
 drivers/scsi/isci/request.c |  2 +-
 drivers/scsi/libfc/fc_rport.c   |  1 +
 drivers/scsi/lpfc/lpfc_ct.c |  2 ++
 drivers/scsi/lpfc/lpfc_els.c|  1 +
 drivers/scsi/lpfc/lpfc_hbadisc.c|  4 ++-
 drivers/scsi/lpfc/lpfc_nportdisc.c  |  1 +
 drivers/scsi/lpfc/lpfc_nvme.c   |  1 +
 drivers/scsi/lpfc/lpfc_scsi.c   |  8 ++---
 drivers/scsi/lpfc/lpfc_sli.c| 20 +++--
 drivers/scsi/megaraid/megaraid_sas_base.c   |  1 +
 drivers/scsi/megaraid/megaraid_sas_fusion.c |  2 +-
 drivers/scsi/mpt3sas/mpt3sas_scsih.c|  1 +
 drivers/scsi/myrb.c |  3 ++
 drivers/scsi/osd/osd_ini

[PATCH 09/41] scsi: bfa: bfa_fcpim: Mark expected switch fall-throughs

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Notice that I replaced "Fall through !!!" with a "fall through"
annotation, which is what GCC is expecting to find.

Addresses-Coverity-ID: 114971 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/bfa/bfa_fcpim.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c
index 2c85f5b1f9c1..7e996bcf026c 100644
--- a/drivers/scsi/bfa/bfa_fcpim.c
+++ b/drivers/scsi/bfa/bfa_fcpim.c
@@ -2586,6 +2586,7 @@ bfa_ioim_send_ioreq(struct bfa_ioim_s *ioim)
case FCP_IODIR_RW:
bfa_stats(itnim, input_reqs);
bfa_stats(itnim, output_reqs);
+   /* fall through */
default:
bfi_h2i_set(m->mh, BFI_MC_IOIM_IO, 0, bfa_fn_lpu(ioim->bfa));
}
@@ -2820,6 +2821,7 @@ bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
 
case BFI_IOIM_STS_TIMEDOUT:
bfa_stats(ioim->itnim, iocomp_timedout);
+   /* fall through */
case BFI_IOIM_STS_ABORTED:
rsp->io_status = BFI_IOIM_STS_ABORTED;
bfa_stats(ioim->itnim, iocomp_aborted);
@@ -3215,9 +3217,7 @@ bfa_tskim_sm_cleanup_qfull(struct bfa_tskim_s *tskim,
switch (event) {
case BFA_TSKIM_SM_DONE:
bfa_reqq_wcancel(&tskim->reqq_wait);
-   /*
-* Fall through !!!
-*/
+   /* fall through */
case BFA_TSKIM_SM_QRESUME:
bfa_sm_set_state(tskim, bfa_tskim_sm_cleanup);
bfa_tskim_send_abort(tskim);
-- 
2.17.1



[PATCH 08/41] scsi: be2iscsi: be_main: Mark expected switch fall-through

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 1357387 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/be2iscsi/be_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index effb6fc95af4..b6449da1320c 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -1539,6 +1539,7 @@ beiscsi_hdl_get_handle(struct beiscsi_conn *beiscsi_conn,
break;
case UNSOL_DATA_DIGEST_ERROR_NOTIFY:
error = 1;
+   /* fall through */
case UNSOL_DATA_NOTIFY:
pasync_handle = pasync_ctx->async_entry[ci].data;
break;
-- 
2.17.1



[PATCH 10/41] scsi: bfa: bfa_fcs_lport: Mark expected switch fall-throughs

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Notice that, in this particular case, I replaced "!!! fall through !!!"
with a "fall through" annotation, which is what GCC is expecting to
find.

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/bfa/bfa_fcs_lport.c | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
index b4f2c1d8742e..646f09f66443 100644
--- a/drivers/scsi/bfa/bfa_fcs_lport.c
+++ b/drivers/scsi/bfa/bfa_fcs_lport.c
@@ -6430,9 +6430,7 @@ bfa_fcs_vport_sm_logo_for_stop(struct bfa_fcs_vport_s 
*vport,
switch (event) {
case BFA_FCS_VPORT_SM_OFFLINE:
bfa_sm_send_event(vport->lps, BFA_LPS_SM_OFFLINE);
-   /*
-* !!! fall through !!!
-*/
+   /* fall through */
 
case BFA_FCS_VPORT_SM_RSP_OK:
case BFA_FCS_VPORT_SM_RSP_ERROR:
@@ -6458,9 +6456,7 @@ bfa_fcs_vport_sm_logo(struct bfa_fcs_vport_s *vport,
switch (event) {
case BFA_FCS_VPORT_SM_OFFLINE:
bfa_sm_send_event(vport->lps, BFA_LPS_SM_OFFLINE);
-   /*
-* !!! fall through !!!
-*/
+   /* fall through */
 
case BFA_FCS_VPORT_SM_RSP_OK:
case BFA_FCS_VPORT_SM_RSP_ERROR:
-- 
2.17.1



[PATCH 02/41] scsi: NCR5380: Mark expected switch fall-through

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Notice that in this particular case, I replaced "Fall through to reject message"
with a "fall through" annotation at the bottom of the case, which is what GCC
is expecting to find.

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/NCR5380.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 01c23d27f290..12073e52a0eb 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -1933,12 +1933,11 @@ static void NCR5380_information_transfer(struct 
Scsi_Host *instance)
if (!hostdata->connected)
return;
 
-   /* Fall through to reject message */
-
/*
 * If we get something weird that we 
aren't expecting,
 * reject it.
 */
+   /* fall through */
default:
if (tmp == EXTENDED_MESSAGE)
scmd_printk(KERN_INFO, cmd,
-- 
2.17.1



[PATCH 03/41] scsi: aacraid: aachba: Mark expected switch fall-throughs

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Also, a break statement is properly aligned.

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/aacraid/aachba.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index bd7f352c28f3..75ab5ff6b78c 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -2892,6 +2892,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
!(dev->raw_io_64) ||
((scsicmd->cmnd[1] & 0x1f) != 
SAI_READ_CAPACITY_16))
break;
+   /* fall through */
case INQUIRY:
case READ_CAPACITY:
case TEST_UNIT_READY:
@@ -2966,6 +2967,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
/* Issue FIB to tell Firmware to flush it's cache */
if ((aac_cache & 6) != 2)
return aac_synchronize(scsicmd);
+   /* fall through */
case INQUIRY:
{
struct inquiry_data inq_data;
@@ -3319,8 +3321,9 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
   min_t(size_t,
 sizeof(dev->fsa_dev[cid].sense_data),
 SCSI_SENSE_BUFFERSIZE));
-   break;
+   break;
}
+   /* fall through */
case RESERVE:
case RELEASE:
case REZERO_UNIT:
-- 
2.17.1



[PATCH 01/41] scsi: BusLogic: mark expected switch fall-through

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 1056537 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/BusLogic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
index 9cee941f97d6..717eef3ee893 100644
--- a/drivers/scsi/BusLogic.c
+++ b/drivers/scsi/BusLogic.c
@@ -2641,6 +2641,7 @@ static int blogic_resultcode(struct blogic_adapter 
*adapter,
case BLOGIC_BAD_CMD_PARAM:
blogic_warn("BusLogic Driver Protocol Error 0x%02X\n",
adapter, adapter_status);
+   /* fall through */
case BLOGIC_DATA_UNDERRUN:
case BLOGIC_DATA_OVERRUN:
case BLOGIC_NOEXPECT_BUSFREE:
-- 
2.17.1



[PATCH 41/41] scsi: xen-scsifront: mark expected switch fall-through

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Notice that, in this particular case, I replaced
"Missed the backend's Closing state -- fallthrough" with
"fall through - Missed the backend's Closing state", which
contains the "fall through" annotation at the beginnig of
the code comment, which is what GCC is expecting to find.

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/xen-scsifront.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c
index 61389bdc7926..bb76d0d2022b 100644
--- a/drivers/scsi/xen-scsifront.c
+++ b/drivers/scsi/xen-scsifront.c
@@ -1112,7 +1112,7 @@ static void scsifront_backend_changed(struct 
xenbus_device *dev,
case XenbusStateClosed:
if (dev->state == XenbusStateClosed)
break;
-   /* Missed the backend's Closing state -- fallthrough */
+   /* fall through - Missed the backend's Closing state */
case XenbusStateClosing:
scsifront_disconnect(info);
break;
-- 
2.17.1



[PATCH 40/41] scsi: ufs: ufshcd: mark expected switch fall-throughs

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 1087954 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/ufs/ufshcd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 003d489f1b4b..be207197b63f 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1551,6 +1551,7 @@ int ufshcd_hold(struct ufs_hba *hba, bool async)
 * currently running. Hence, fall through to cancel gating
 * work and to enable clocks.
 */
+   /* fall through */
case CLKS_OFF:
ufshcd_scsi_block_requests(hba);
hba->clk_gating.state = REQ_CLKS_ON;
@@ -1562,6 +1563,7 @@ int ufshcd_hold(struct ufs_hba *hba, bool async)
 * fall through to check if we should wait for this
 * work to be done or not.
 */
+   /* fall through */
case REQ_CLKS_ON:
if (async) {
rc = -EAGAIN;
@@ -4620,6 +4622,7 @@ ufshcd_scsi_cmd_status(struct ufshcd_lrb *lrbp, int 
scsi_status)
switch (scsi_status) {
case SAM_STAT_CHECK_CONDITION:
ufshcd_copy_sense_data(lrbp);
+   /* fall through */
case SAM_STAT_GOOD:
result |= DID_OK << 16 |
  COMMAND_COMPLETE << 8 |
-- 
2.17.1



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

2018-11-27 Thread Gustavo A. R. Silva
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 
---
 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 */
-- 
2.17.1



[PATCH 39/41] scsi: sym53c8xx_2: sym_nvram: Mark expected switch fall-through

2018-11-27 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva 
---
 drivers/scsi/sym53c8xx_2/sym_nvram.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/sym53c8xx_2/sym_nvram.c 
b/drivers/scsi/sym53c8xx_2/sym_nvram.c
index 5662fbb3ff60..0d37b4f07b5e 100644
--- a/drivers/scsi/sym53c8xx_2/sym_nvram.c
+++ b/drivers/scsi/sym53c8xx_2/sym_nvram.c
@@ -708,6 +708,7 @@ static int sym_read_Tekram_nvram (struct sym_device *np, 
Tekram_nvram *nvram)
  data, len);
if (!x)
break;
+   /* fall through */
default:
x = sym_read_T93C46_nvram(np, nvram);
break;
-- 
2.17.1



  1   2   >