diff mbox series

[13/14] scsi: scsi_transport_spi: Simplified period calculation with max() in spi_dv_retrain

Message ID 20240626101342.1440049-14-prabhakar.pujeri@gmail.com
State New
Headers show
Series SCSI: Replace ternary operations with min()/max() macros | expand

Commit Message

Prabhakar Pujeri June 26, 2024, 10:13 a.m. UTC
Signed-off-by: Prabhakar Pujeri <prabhakar.pujeri@gmail.com>
---
 drivers/scsi/scsi_transport_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index 64852e6df3e3..c50e923bfa0f 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -783,7 +783,7 @@  spi_dv_retrain(struct scsi_device *sdev, u8 *buffer, u8 *ptr,
 			DV_SET(qas, 0);
 		} else {
 			newperiod = spi_period(starget);
-			period = newperiod > period ? newperiod : period;
+			period = max(newperiod, period);
 			if (period < 0x0d)
 				period++;
 			else