From 45128613ab0f93ff5159e5ab9e0511c156f3b37e Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 30 Dec 2017 00:53:47 +0000 Subject: [PATCH 1/5] scst: Backport timer_setup() to kernel versions before v4.10 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7305 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index d06230ee4..ef697ee1a 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -682,11 +682,19 @@ struct t10_pi_tuple { /* */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) /* * See also commit 686fef928bba ("timer: Prepare to change timer callback - * argument type"). + * argument type"). See also commit 0eeda71bc30d ("timer: Replace timer base + * by a cpu index"). */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) +#define timer_setup(_timer, _fn, _flags) do { \ + init_timer(_timer); \ + (_timer)->function = (void (*)(unsigned long))(_fn); \ + (_timer)->data = (unsigned long)(_timer); \ + WARN_ON_ONCE((_flags) != 0); \ +} while (0) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) #define timer_setup(_timer, _fn, _flags) do { \ init_timer(_timer); \ (_timer)->function = (void (*)(unsigned long))(_fn); \ From 1d27948af3d3ecc279386e9ec5ccc5bd5f4fd905 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 30 Dec 2017 02:23:23 +0000 Subject: [PATCH 2/5] iscsi-scst: Fix a format specifier Detected by checkpatch. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7306 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/conn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iscsi-scst/kernel/conn.c b/iscsi-scst/kernel/conn.c index 0b5462856..ea19d3c7e 100644 --- a/iscsi-scst/kernel/conn.c +++ b/iscsi-scst/kernel/conn.c @@ -209,9 +209,9 @@ static ssize_t iscsi_get_target_ip(struct iscsi_conn *conn, NIP6(inet6_sk(sk)->saddr)); #else #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) - pos = scnprintf(buf, size, "[%p6]", &inet6_sk(sk)->saddr); + pos = scnprintf(buf, size, "[%pI6]", &inet6_sk(sk)->saddr); #else - pos = scnprintf(buf, size, "[%p6]", &sk->sk_v6_rcv_saddr); + pos = scnprintf(buf, size, "[%pI6]", &sk->sk_v6_rcv_saddr); #endif #endif break; From 3ef4c364abf5b6d18e6baac36cf91f02d8c4570e Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 30 Dec 2017 02:25:54 +0000 Subject: [PATCH 3/5] iscsi-scst/kernel/conn.c: Fix source code indentation git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7307 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/conn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iscsi-scst/kernel/conn.c b/iscsi-scst/kernel/conn.c index ea19d3c7e..81fd98d5d 100644 --- a/iscsi-scst/kernel/conn.c +++ b/iscsi-scst/kernel/conn.c @@ -1127,7 +1127,7 @@ void iscsi_extracheck_is_rd_thread(struct iscsi_conn *conn) pr_emerg("rd_state %x\n", conn->rd_state); pr_emerg("rd_task %p\n", conn->rd_task); if (conn->rd_task) - pr_emerg("rd_task->pid %d\n", conn->rd_task->pid); + pr_emerg("rd_task->pid %d\n", conn->rd_task->pid); BUG(); } } From feb3bd8b5fbe24527b9e5c9df45eb5c384db443a Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 30 Dec 2017 03:36:39 +0000 Subject: [PATCH 4/5] scst: Fix source code indentation git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7308 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_targ.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index 6934134e1..50b5ea6de 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -1346,7 +1346,7 @@ set_res: if (cmd->data_direction & SCST_DATA_READ) cmd->resp_data_len = cmd->bufflen; else - cmd->resp_data_len = 0; + cmd->resp_data_len = 0; } #ifndef CONFIG_SCST_TEST_IO_IN_SIRQ From 4d81f8e1749905b9ad8edf32420ff52bd1ba6e5b Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 30 Dec 2017 03:37:31 +0000 Subject: [PATCH 5/5] scst_debug.h: Avoid that smatch complains about passing a pointer to format specifier %lx git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7309 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/scst_debug.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scst/include/scst_debug.h b/scst/include/scst_debug.h index 0caae1872..de8f50d7e 100644 --- a/scst/include/scst_debug.h +++ b/scst/include/scst_debug.h @@ -339,28 +339,30 @@ do { \ #define TRACE_EXIT_RES(res) \ do { \ + unsigned long lres = res; \ + \ if (trace_flag & TRACE_ENTRYEXIT) { \ if (trace_flag & TRACE_PID) { \ PRINT(KERN_INFO, "[%d]: EXIT %s: %ld", current->pid, \ - __func__, (long)(res)); \ - } \ - else { \ + __func__, lres); \ + } else { \ PRINT(KERN_INFO, "EXIT %s: %ld", \ - __func__, (long)(res)); \ + __func__, lres); \ } \ } \ } while (0) #define TRACE_EXIT_HRES(res) \ do { \ + unsigned long lres = (unsigned long)res; \ + \ if (trace_flag & TRACE_ENTRYEXIT) { \ if (trace_flag & TRACE_PID) { \ PRINT(KERN_INFO, "[%d]: EXIT %s: 0x%lx", current->pid, \ - __func__, (long)(res)); \ - } \ - else { \ + __func__, lres); \ + } else { \ PRINT(KERN_INFO, "EXIT %s: %lx", \ - __func__, (long)(res)); \ + __func__, lres); \ } \ } \ } while (0)