scst_debug: Avoid that compiler warnings depend on the build mode

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
This commit is contained in:
Bart Van Assche
2015-05-06 14:57:13 +02:00
parent eac3a61c3c
commit ae7819e8f0
5 changed files with 31 additions and 18 deletions
-2
View File
@@ -279,9 +279,7 @@ struct iscsi_conn {
struct list_head rd_list_entry;
#ifdef CONFIG_SCST_EXTRACHECKS
struct task_struct *rd_task;
#endif
unsigned long last_rcv_time;
+1 -1
View File
@@ -52,7 +52,7 @@ extern unsigned long iscsi_get_flow_ctrl_or_mgmt_dbg_log_flag(
struct iscsi_cmnd *cmnd);
#else
#define iscsi_dump_pdu(x) do {} while (0)
#define iscsi_get_flow_ctrl_or_mgmt_dbg_log_flag(x) do {} while (0)
#define iscsi_get_flow_ctrl_or_mgmt_dbg_log_flag(x) 0
#endif
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
+10
View File
@@ -258,6 +258,16 @@ static inline unsigned int queue_max_hw_sectors(struct request_queue *q)
#endif
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36) && \
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 6)
/*
* See also patch "Add a dummy printk function for the maintenance of unused
* printks" (commit 12fdff3fc2483f906ae6404a6e8dcf2550310b6f).
*/
static inline __attribute__ ((format (printf, 1, 2)))
int no_printk(const char *s, ...) { return 0; }
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
/*
* See also patch "sched: Fix softirq time accounting" (commit ID
+19 -13
View File
@@ -224,9 +224,12 @@ do { \
#define TRACING_MINOR() (false)
#define TRACE(trace, format, args...) do {} while (0)
#define PRINT_BUFFER(message, buff, len) do {} while (0)
#define PRINT_BUFF_FLAG(flag, message, buff, len) do {} while (0)
#define TRACE(trace, format, args...) \
((void)(trace), no_printk(format, ##args))
#define PRINT_BUFFER(message, buff, len) \
((void)(message), (void)(buff), (void)(len))
#define PRINT_BUFF_FLAG(flag, message, buff, len) \
((void)(flag), (void)(message), (void)(buff), (void)(len))
#endif /* CONFIG_SCST_DEBUG || CONFIG_SCST_TRACING */
@@ -353,17 +356,20 @@ do { \
#else /* CONFIG_SCST_DEBUG */
#define TRACE_MEM(format, args...) do {} while (0)
#define TRACE_SG(format, args...) do {} while (0)
#define TRACE_DBG(format, args...) do {} while (0)
#define TRACE_DBG_FLAG(format, args...) do {} while (0)
#define TRACE_DBG_SPECIAL(format, args...) do {} while (0)
#define TRACE_MGMT_DBG(format, args...) do {} while (0)
#define TRACE_MGMT_DBG_SPECIAL(format, args...) do {} while (0)
#define TRACE_MEM(format, args...) no_printk(format, ##args)
#define TRACE_SG(format, args...) no_printk(format, ##args)
#define TRACE_DBG(format, args...) no_printk(format, ##args)
#define TRACE_DBG_FLAG(flag, format, args...) \
((void)(flag), no_printk(format, ##args))
#define TRACE_DBG_SPECIAL(format, args...) no_printk(format, ##args)
#define TRACE_MGMT_DBG(format, args...) no_printk(format, ##args)
#define TRACE_MGMT_DBG_SPECIAL(format, args...) no_printk(format, ##args)
#define TRACE_PR(format, args...) do {} while (0)
#define TRACE_BLOCK(format, args...) do {} while (0)
#define TRACE_BUFFER(message, buff, len) do {} while (0)
#define TRACE_BUFF_FLAG(flag, message, buff, len) do {} while (0)
#define TRACE_BLOCK(format, args...) no_printk(format, ##args)
#define TRACE_BUFFER(message, buff, len) \
((void)(message), (void)(buff), (void)(len))
#define TRACE_BUFF_FLAG(flag, message, buff, len) \
((void)(flag), (void)(message), (void)(buff), (void)(len))
#ifndef GENERATING_UPSTREAM_PATCH
#define TRACE_ENTRY() do {} while (0)
+1 -2
View File
@@ -60,10 +60,9 @@
#include "scst.h"
#endif
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
#define TRACE_ORDER 0x80000000
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
static struct scst_trace_log vdisk_local_trace_tbl[] = {
{ TRACE_ORDER, "order" },
{ 0, NULL }