[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bf5884a7bd7c1c92497664eb793c99051b81d67a.1674900575.git.drv@mailo.com>
Date: Sat, 28 Jan 2023 16:09:51 +0530
From: Deepak R Varma <drv@...lo.com>
To: Kashyap Desai <kashyap.desai@...adcom.com>,
Sumit Saxena <sumit.saxena@...adcom.com>,
Shivasharan S <shivasharan.srikanteshwara@...adcom.com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
megaraidlinux.pdl@...adcom.com, linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Saurabh Singh Sengar <ssengar@...rosoft.com>,
Praveen Kumar <kumarpraveen@...ux.microsoft.com>,
Deepak R Varma <drv@...lo.com>
Subject: [PATCH 2/2] scsi: megaraid_sas: Use max helper for comparison and
assignment
Simplify code using max() helper macro for logical evaluation and value
assignment.
Proposed change is identified using minmax.cocci semantic patch script.
Signed-off-by: Deepak R Varma <drv@...lo.com>
---
drivers/scsi/megaraid/megaraid_sas_base.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 7fa472ab0b94..4ca9b04e1962 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -5993,10 +5993,7 @@ megasas_alloc_irq_vectors(struct megasas_instance *instance)
instance->msix_vectors - instance->iopoll_q_count,
i, instance->iopoll_q_count);
- if (i > 0)
- instance->msix_vectors = i;
- else
- instance->msix_vectors = 0;
+ instance->msix_vectors = max(i, 0);
if (instance->smp_affinity_enable)
megasas_set_high_iops_queue_affinity_and_hint(instance);
--
2.34.1
Powered by blists - more mailing lists