[PATCH 00/14] [PATCH] SCSI: Replace ternary operations with min()/max() macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

This patch series, generated using Coccinelle, aims to improve code readability and maintainability by replacing ternary operations with the min() and max() macros where applicable in the SCSI subsystem.

I acknowledge that some of these drivers are old and may not require modifications unless addressing critical issues. However, I intend to include these patches for those older drivers alongside any future critical fixes.

The patches have been compiled and tested on an x86_64 system. Physical device testing was conducted for the megaraid_sas and mpi3mr drivers.


Prabhakar Pujeri (14):
  scsi: advansys: Simplified memcpy length calculation in adv_build_req
  scsi: bfa: Used min() in fc_rftid_build_sol for bitmap size
  scsi: bfa:Simplified logic in bfa_fcs_rport_update and bfa_sgpg_mfree
  scsi: cxlflash: Replaced ternary operation in write_same16 with min()
  scsi: hpsa: Used min() for sense data size and buffer size in
    complete_scsi_command and hpsa_vpd_page_supported
  scsi: megaraid_sas: Simplified transfer length calculation using max()
    in mega_m_to_n
  scsi: megaraid_sas: Replaced ternary operation with max() in
    megasas_alloc_irq_vectors
  scsi: mpi3mr: Used min() in mpi3mr_map_data_buffer_dma for buffer size
  scsi: ncr53c8xx: Simplified tag number calculation with max() in
    ncr_sir_to_redo
  scsi: qla2xxx: Used max() for queue count in qla25xx_copy_mq
  scsi: qla2xxx: Simplified outstanding commands calculation in
    qla2x00_alloc_outstanding_cmds and qla24xx_read_fcp_prio_cfg
  scsi: scsi_debug: Replaced ternary operation with min() in
    resp_get_lba_status
  scsi: scsi_transport_spi: Simplified period calculation with max() in
    spi_dv_retrain
  scsi: st: Used max() for buffer size in setup_buffering and Simplified
    transfer calculations in st_read, append_to_buffer, and from_buffer

 drivers/scsi/advansys.c                   |  2 +-
 drivers/scsi/bfa/bfa_fcbuild.c            |  2 +-
 drivers/scsi/bfa/bfa_fcs_rport.c          |  6 ++----
 drivers/scsi/bfa/bfa_svc.c                |  5 +----
 drivers/scsi/cxlflash/vlun.c              |  2 +-
 drivers/scsi/hpsa.c                       | 11 +++--------
 drivers/scsi/megaraid.c                   |  3 +--
 drivers/scsi/megaraid/megaraid_sas_base.c |  5 +----
 drivers/scsi/mpi3mr/mpi3mr_app.c          |  7 ++-----
 drivers/scsi/ncr53c8xx.c                  |  2 +-
 drivers/scsi/qla2xxx/qla_dbg.c            |  3 +--
 drivers/scsi/qla2xxx/qla_init.c           |  6 ++----
 drivers/scsi/qla2xxx/qla_sup.c            |  2 +-
 drivers/scsi/scsi_debug.c                 |  5 +----
 drivers/scsi/scsi_transport_spi.c         |  2 +-
 drivers/scsi/st.c                         | 10 ++++------
 16 files changed, 24 insertions(+), 49 deletions(-)

--
2.45.1





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux