[PATCH 0/6] scsi: Remove redundant ternary operators

Liao Yuanhong posted 6 patches 1 month ago
drivers/scsi/arcmsr/arcmsr_hba.c            | 11 +++++------
drivers/scsi/csiostor/csio_scsi.c           |  2 +-
drivers/scsi/isci/request.c                 |  2 +-
drivers/scsi/megaraid/megaraid_sas_base.c   |  4 ++--
drivers/scsi/megaraid/megaraid_sas_fusion.c |  4 ++--
drivers/scsi/scsi_transport_fc.c            |  2 +-
drivers/scsi/storvsc_drv.c                  |  4 ++--
7 files changed, 14 insertions(+), 15 deletions(-)
[PATCH 0/6] scsi: Remove redundant ternary operators
Posted by Liao Yuanhong 1 month ago
For ternary operators in the form of "a ? true : false" or
"a ? false : true", if 'a' itself returns a boolean result, the ternary
operator can be omitted. Remove redundant ternary operators to clean up the
code.

Liao Yuanhong (6):
  scsi: arcmsr: Remove redundant ternary operators
  scsi: csiostor: Remove redundant ternary operators
  scsi: isci: Remove redundant ternary operators
  scsi: megaraid_sas: Remove redundant ternary operators
  scsi: scsi_transport_fc: Remove redundant ternary operators
  scsi: storvsc: Remove redundant ternary operators

 drivers/scsi/arcmsr/arcmsr_hba.c            | 11 +++++------
 drivers/scsi/csiostor/csio_scsi.c           |  2 +-
 drivers/scsi/isci/request.c                 |  2 +-
 drivers/scsi/megaraid/megaraid_sas_base.c   |  4 ++--
 drivers/scsi/megaraid/megaraid_sas_fusion.c |  4 ++--
 drivers/scsi/scsi_transport_fc.c            |  2 +-
 drivers/scsi/storvsc_drv.c                  |  4 ++--
 7 files changed, 14 insertions(+), 15 deletions(-)

-- 
2.34.1
Re: [PATCH 0/6] scsi: Remove redundant ternary operators
Posted by Martin K. Petersen 3 days, 6 hours ago
On Tue, 02 Sep 2025 21:23:40 +0800, Liao Yuanhong wrote:

> For ternary operators in the form of "a ? true : false" or
> "a ? false : true", if 'a' itself returns a boolean result, the ternary
> operator can be omitted. Remove redundant ternary operators to clean up the
> code.
> 
> Liao Yuanhong (6):
>   scsi: arcmsr: Remove redundant ternary operators
>   scsi: csiostor: Remove redundant ternary operators
>   scsi: isci: Remove redundant ternary operators
>   scsi: megaraid_sas: Remove redundant ternary operators
>   scsi: scsi_transport_fc: Remove redundant ternary operators
>   scsi: storvsc: Remove redundant ternary operators
> 
> [...]

Applied to 6.18/scsi-queue, thanks!

[6/6] scsi: storvsc: Remove redundant ternary operators
      https://git.kernel.org/mkp/scsi/c/15968590f07c

-- 
Martin K. Petersen