[PATCH -next] scsi: megaraid_sas: Remove unnecessary ternary operators

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

 



Ther are a little ternary operators, the true or false judgement
of which is unnecessary in C language semantics.

Signed-off-by: Ruan Jinjie <ruanjinjie@xxxxxxxxxx>
---
 drivers/scsi/megaraid/megaraid_sas_base.c   | 4 ++--
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 050eed8e2684..deadf8b237f1 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -2095,7 +2095,7 @@ static int megasas_slave_configure(struct scsi_device *sdev)
 	if ((instance->tgt_prop) && (instance->nvme_page_size))
 		ret_target_prop = megasas_get_target_prop(instance, sdev);
 
-	is_target_prop = (ret_target_prop == DCMD_SUCCESS) ? true : false;
+	is_target_prop = ret_target_prop == DCMD_SUCCESS;
 	megasas_set_static_target_properties(sdev, is_target_prop);
 
 	/* This sdev property may change post OCR */
@@ -3446,7 +3446,7 @@ enable_sdev_max_qd_store(struct device *cdev,
 
 	shost_for_each_device(sdev, shost) {
 		ret_target_prop = megasas_get_target_prop(instance, sdev);
-		is_target_prop = (ret_target_prop == DCMD_SUCCESS) ? true : false;
+		is_target_prop = ret_target_prop == DCMD_SUCCESS;
 		megasas_set_fw_assisted_qd(sdev, is_target_prop);
 	}
 	mutex_unlock(&instance->reset_mutex);
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index 8a83f3fc2b86..aec9dd818cc1 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -2832,7 +2832,7 @@ megasas_build_ldio_fusion(struct megasas_instance *instance,
 	} else {
 		if (MR_BuildRaidContext(instance, &io_info, rctx,
 					local_map_ptr, &raidLUN))
-			fp_possible = (io_info.fpOkForIo > 0) ? true : false;
+			fp_possible = io_info.fpOkForIo > 0;
 	}
 
 	megasas_get_msix_index(instance, scp, cmd, io_info.data_arms);
@@ -5115,7 +5115,7 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int reason)
 				    (instance->nvme_page_size))
 					ret_target_prop = megasas_get_target_prop(instance, sdev);
 
-				is_target_prop = (ret_target_prop == DCMD_SUCCESS) ? true : false;
+				is_target_prop = ret_target_prop == DCMD_SUCCESS;
 				megasas_set_dynamic_target_properties(sdev, is_target_prop);
 			}
 
-- 
2.34.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