[PATCH] scsi: scsi_debug:Use min_t to replace min

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

 



From: Pei Xiao <xiaopei01@xxxxxxxxxx>

Use min_t to replace min, min_t is a bit fast because min use
twice typeof.
And using min_t is cleaner here since the min/max macros
do a typecheck while min_t()/max_t() to an explicit type cast.

Fixes the below checkpatch warning:
WARNING: min() should probably be min_t()

Fixes: ad620becda43 ("scsi: scsi_debug: Implement GET STREAM STATUS")
Signed-off-by: Pei Xiao <xiaopei01@xxxxxxxxxx>
---
 drivers/scsi/scsi_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index a9d8a9c62663..bd24ffa68e85 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -4886,7 +4886,7 @@ static int resp_get_stream_status(struct scsi_cmnd *scp,
 	}
 	put_unaligned_be32(offset - 8, &h->len); /* PARAMETER DATA LENGTH */
 
-	return fill_from_dev_buffer(scp, arr, min(offset, alloc_len));
+	return fill_from_dev_buffer(scp, arr, min_t(u32, offset, alloc_len));
 }
 
 static int resp_sync_cache(struct scsi_cmnd *scp,
-- 
2.34.1


No virus found
		Checked by Hillstone Network AntiVirus





[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