diff mbox series

[12/14] scsi: scsi_debug: Replaced ternary operation with min() in resp_get_lba_status

Message ID 20240626101342.1440049-13-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_debug.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index acf0592d63da..ae64c0df95f7 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -4579,10 +4579,7 @@  static int resp_get_lba_status(struct scsi_cmnd *scp,
 		mapped = 1;
 		/* following just in case virtual_gb changed */
 		sdebug_capacity = get_sdebug_capacity();
-		if (sdebug_capacity - lba <= 0xffffffff)
-			num = sdebug_capacity - lba;
-		else
-			num = 0xffffffff;
+		num = min(sdebug_capacity - lba, 0xffffffff);
 	}
 
 	memset(arr, 0, SDEBUG_GET_LBA_STATUS_LEN);