From 49c56244a122385108d408fd827743465504ee91 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 27 Mar 2012 01:46:51 +0000 Subject: [PATCH] Fix 3.3 checkpatch warnings about min()and max() Fix three occurrences of the following warnings reported by the checkpatch script included with Linux kernel version 3.3: WARNING: min() should probably be min_t() WARNING: max() should probably be max_t() Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4172 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/iscsi.c | 2 +- qla2x00t/qla2x00-target/qla2x00t.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index c1ab52928..c78449f45 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -3920,7 +3920,7 @@ int iscsi_threads_pool_get(const cpumask_t *cpu_mask, INIT_LIST_HEAD(&p->threads_list); if (cpu_mask == NULL) - count = max((int)num_online_cpus(), 2); + count = max_t(int, num_online_cpus(), 2); else { count = 0; for_each_cpu(i, cpu_mask) diff --git a/qla2x00t/qla2x00-target/qla2x00t.c b/qla2x00t/qla2x00-target/qla2x00t.c index 1a6c44280..210624616 100644 --- a/qla2x00t/qla2x00-target/qla2x00t.c +++ b/qla2x00t/qla2x00-target/qla2x00t.c @@ -2584,8 +2584,8 @@ static void q2x_init_ctio_ret_entry(ctio_ret_entry_t *ctio_m1, { TRACE_ENTRY(); - prm->sense_buffer_len = min((uint32_t)prm->sense_buffer_len, - (uint32_t)sizeof(ctio_m1->sense_data)); + prm->sense_buffer_len = min_t(uint32_t, prm->sense_buffer_len, + sizeof(ctio_m1->sense_data)); ctio_m1->flags = cpu_to_le16(OF_SSTS | OF_FAST_POST | OF_NO_DATA | OF_SS_MODE_1); @@ -2791,8 +2791,8 @@ static void q24_init_ctio_ret_entry(ctio7_status0_entry_t *ctio, TRACE_ENTRY(); - prm->sense_buffer_len = min((uint32_t)prm->sense_buffer_len, - (uint32_t)sizeof(ctio1->sense_data)); + prm->sense_buffer_len = min_t(uint32_t, prm->sense_buffer_len, + sizeof(ctio1->sense_data)); ctio->flags |= cpu_to_le16(CTIO7_FLAGS_SEND_STATUS); if (q2t_need_explicit_conf(prm->tgt->ha, prm->cmd, 0)) { ctio->flags |= cpu_to_le16(