From a007aede73d0b3314149373ce0ed3e138fccc68e Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 1 Nov 2018 04:26:35 +0000 Subject: [PATCH] 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/branches/3.3.x@7563 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)