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

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

 



Signed-off-by: Prabhakar Pujeri <prabhakar.pujeri@xxxxxxxxx>
---
 drivers/scsi/scsi_debug.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

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);
-- 
2.45.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