mbox series

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

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

Message

Gustavo A. R. Silva Nov. 28, 2018, 4:18 a.m. UTC
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_initiator.c            |  3 +-
 drivers/scsi/osst.c                         |  6 ++++
 drivers/scsi/ppa.c                          |  1 +
 drivers/scsi/qla4xxx/ql4_os.c               |  2 +-
 drivers/scsi/st.c                           |  4 +++
 drivers/scsi/sym53c8xx_2/sym_hipd.c         |  2 ++
 drivers/scsi/sym53c8xx_2/sym_nvram.c        |  1 +
 drivers/scsi/ufs/ufshcd.c                   |  3 ++
 drivers/scsi/xen-scsifront.c                |  2 +-
 41 files changed, 124 insertions(+), 78 deletions(-)

Comments

Gustavo A. R. Silva Dec. 18, 2018, 3:23 p.m. UTC | #1
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 +
>   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_initiator.c            |  3 +-
>   drivers/scsi/osst.c                         |  6 ++++
>   drivers/scsi/ppa.c                          |  1 +
>   drivers/scsi/qla4xxx/ql4_os.c               |  2 +-
>   drivers/scsi/st.c                           |  4 +++
>   drivers/scsi/sym53c8xx_2/sym_hipd.c         |  2 ++
>   drivers/scsi/sym53c8xx_2/sym_nvram.c        |  1 +
>   drivers/scsi/ufs/ufshcd.c                   |  3 ++
>   drivers/scsi/xen-scsifront.c                |  2 +-
>   41 files changed, 124 insertions(+), 78 deletions(-)
>
Gustavo A. R. Silva Dec. 19, 2018, 3:53 a.m. UTC | #2
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
Artur Paszkiewicz Dec. 20, 2018, 8:51 a.m. UTC | #3
On 11/28/18 5:29 AM, 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 <gustavo@embeddedor.com>

Acked-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Artur Paszkiewicz Dec. 20, 2018, 8:51 a.m. UTC | #4
On 11/28/18 5:30 AM, 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 <gustavo@embeddedor.com>

Acked-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Artur Paszkiewicz Dec. 20, 2018, 8:51 a.m. UTC | #5
On 11/28/18 5:30 AM, 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 <gustavo@embeddedor.com>

Acked-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Artur Paszkiewicz Dec. 20, 2018, 8:51 a.m. UTC | #6
On 11/28/18 5:30 AM, 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 <gustavo@embeddedor.com>

Acked-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Martin K. Petersen Dec. 21, 2018, 12:56 a.m. UTC | #7
Artur,

> On 11/28/18 5:29 AM, 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 <gustavo@embeddedor.com>
>
> Acked-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>

Applied the 4 isci patches to 4.21/scsi-queue. Thanks!