From 44ca94a8228e638427f3bbaf0cd842491e202b21 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 19 Dec 2011 15:59:54 +0000 Subject: [PATCH] Avoid that the checkpatch.pl script as included in Linux kernel 3.1 complains about min((int)(a), (int)(b)) that should be changed into min_t(int, (a), (b)) (merge r3944 from trunk). git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.0.x@4008 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_user.c | 2 +- scst/src/scst_lib.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scst/src/dev_handlers/scst_user.c b/scst/src/dev_handlers/scst_user.c index a4da22276..f48da5d4b 100644 --- a/scst/src/dev_handlers/scst_user.c +++ b/scst/src/dev_handlers/scst_user.c @@ -1464,7 +1464,7 @@ static int dev_user_process_reply_exec(struct scst_user_cmd *ucmd, if (res != 0) goto out_compl; - sense_len = min((int)cmd->sense_buflen, (int)ereply->sense_len); + sense_len = min_t(int, cmd->sense_buflen, ereply->sense_len); rc = copy_from_user(cmd->sense, (void __user *)(unsigned long)ereply->psense_buffer, diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 37043611f..e082e53dc 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -6316,7 +6316,7 @@ static void __scst_check_set_UA(struct scst_tgt_dev *tgt_dev, { int skip_UA = 0; struct scst_tgt_dev_UA *UA_entry_tmp; - int len = min((int)sizeof(UA_entry_tmp->UA_sense_buffer), sense_len); + int len = min_t(int, sizeof(UA_entry_tmp->UA_sense_buffer), sense_len); TRACE_ENTRY();