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();