diff mbox series

scsi: scsi_debug:Use min_t to replace min

Message ID tencent_E821B8DA466472675139402A7A799C7CCC0A@qq.com
State New
Headers show
Series scsi: scsi_debug:Use min_t to replace min | expand

Commit Message

xiaopeitux@foxmail.com July 26, 2024, 8:55 a.m. UTC
From: Pei Xiao <xiaopei01@kylinos.cn>

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@kylinos.cn>
---
 drivers/scsi/scsi_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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,