From e834050d359818e8459824ec60b046248ed8ebad Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 5 Nov 2012 08:37:20 +0000 Subject: [PATCH] scst.h, scst_debug.h, scst_pres.h: RHEL 5.3 build fix git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4601 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/scst.h | 4 ++++ scst/include/scst_debug.h | 4 +++- scst/src/scst_pres.h | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/scst/include/scst.h b/scst/include/scst.h index d01a6dec6..fadc8bbe3 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -3039,7 +3039,11 @@ static inline bool scst_cmd_atomic(struct scst_cmd *cmd) */ if (unlikely((in_atomic() || in_interrupt() || irqs_disabled()) && !res)) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28) + printk(KERN_ERR "ERROR: atomic context and non-atomic cmd!\n"); +#else pr_err("ERROR: atomic context and non-atomic cmd!\n"); +#endif dump_stack(); cmd->atomic = 1; res = 1; diff --git a/scst/include/scst_debug.h b/scst/include/scst_debug.h index 9f3d02ccb..cc452694c 100644 --- a/scst/include/scst_debug.h +++ b/scst/include/scst_debug.h @@ -39,7 +39,7 @@ * 311d0761 - Introduction of pr_cont() in . * 968ab183 - Moved pr_info() etc. from to */ -#ifndef pr_info +#ifndef pr_emerg #ifndef pr_fmt #define pr_fmt(fmt) fmt #endif @@ -57,6 +57,8 @@ #define pr_warn pr_warning #define pr_notice(fmt, ...) \ printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) +#endif +#ifndef pr_info #define pr_info(fmt, ...) \ printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) #endif diff --git a/scst/src/scst_pres.h b/scst/src/scst_pres.h index d7df016b8..36d4a0303 100644 --- a/scst/src/scst_pres.h +++ b/scst/src/scst_pres.h @@ -20,6 +20,11 @@ #define SCST_PRES_H_ #include +#ifdef INSIDE_KERNEL_TREE +#include +#else +#include "scst_debug.h" +#endif #define PR_REGISTER 0x00 #define PR_RESERVE 0x01