[2/2] scsi: megaraid_sas: Use max helper for comparison and assignment
Commit Message
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@mailo.com>
---
drivers/scsi/megaraid/megaraid_sas_base.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
@@ -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);