diff --git a/iscsi-scst/kernel/config.c b/iscsi-scst/kernel/config.c index a51305186..14f4c2aa8 100644 --- a/iscsi-scst/kernel/config.c +++ b/iscsi-scst/kernel/config.c @@ -1213,26 +1213,26 @@ static void iscsi_dump_char(int ch, unsigned char *text, int *pos) if (ch < 0) { while ((i % 16) != 0) { - printk(KERN_CONT " "); + pr_cont(" "); text[i] = ' '; i++; if ((i % 16) == 0) - printk(KERN_CONT " | %.16s |\n", text); + pr_cont(" | %.16s |\n", text); else if ((i % 4) == 0) - printk(KERN_CONT " |"); + pr_cont(" |"); } i = 0; goto out; } text[i] = (ch < 0x20 || (ch >= 0x80 && ch <= 0xa0)) ? ' ' : ch; - printk(KERN_CONT " %02x", ch); + pr_cont(" %02x", ch); i++; if ((i % 16) == 0) { - printk(KERN_CONT " | %.16s |\n", text); + pr_cont(" | %.16s |\n", text); i = 0; } else if ((i % 4) == 0) - printk(KERN_CONT " |"); + pr_cont(" |"); out: *pos = i; diff --git a/iscsi-scst/kernel/conn.c b/iscsi-scst/kernel/conn.c index e2f384bd8..e563838fc 100644 --- a/iscsi-scst/kernel/conn.c +++ b/iscsi-scst/kernel/conn.c @@ -1007,13 +1007,13 @@ int __del_conn(struct iscsi_session *session, struct iscsi_kern_conn_info *info) void iscsi_extracheck_is_rd_thread(struct iscsi_conn *conn) { if (unlikely(current != conn->rd_task)) { - printk(KERN_EMERG "conn %p rd_task != current %p (pid %d)\n", - conn, current, current->pid); + pr_emerg("conn %p rd_task != current %p (pid %d)\n", + conn, current, current->pid); while (in_softirq()) local_bh_enable(); - printk(KERN_EMERG "rd_state %x\n", conn->rd_state); - printk(KERN_EMERG "rd_task %p\n", conn->rd_task); - printk(KERN_EMERG "rd_task->pid %d\n", conn->rd_task->pid); + pr_emerg("rd_state %x\n", conn->rd_state); + pr_emerg("rd_task %p\n", conn->rd_task); + pr_emerg("rd_task->pid %d\n", conn->rd_task->pid); BUG(); } } @@ -1021,13 +1021,13 @@ void iscsi_extracheck_is_rd_thread(struct iscsi_conn *conn) void iscsi_extracheck_is_wr_thread(struct iscsi_conn *conn) { if (unlikely(current != conn->wr_task)) { - printk(KERN_EMERG "conn %p wr_task != current %p (pid %d)\n", - conn, current, current->pid); + pr_emerg("conn %p wr_task != current %p (pid %d)\n", + conn, current, current->pid); while (in_softirq()) local_bh_enable(); - printk(KERN_EMERG "wr_state %x\n", conn->wr_state); - printk(KERN_EMERG "wr_task %p\n", conn->wr_task); - printk(KERN_EMERG "wr_task->pid %d\n", conn->wr_task->pid); + pr_emerg("wr_state %x\n", conn->wr_state); + pr_emerg("wr_task %p\n", conn->wr_task); + pr_emerg("wr_task->pid %d\n", conn->wr_task->pid); BUG(); } } diff --git a/qla2x00t/qla2x_tgt.h b/qla2x00t/qla2x_tgt.h index 0d644c2af..dbc8fa4eb 100644 --- a/qla2x00t/qla2x_tgt.h +++ b/qla2x00t/qla2x_tgt.h @@ -103,7 +103,7 @@ __qla2x00_send_enable_lun(scsi_qla_host_t *ha, int enable) qla_clear_tgt_mode(ha); #if defined(QL_DEBUG_LEVEL_2) || defined(QL_DEBUG_LEVEL_3) if (!pkt) - printk(KERN_ERR "%s: **** FAILED ****\n", __func__); + pr_err("%s: **** FAILED ****\n", __func__); #endif return; diff --git a/scst/include/scst.h b/scst/include/scst.h index ae3b86538..c842d2699 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -2990,7 +2990,7 @@ static inline bool scst_cmd_atomic(struct scst_cmd *cmd) */ if (unlikely((in_atomic() || in_interrupt() || irqs_disabled()) && !res)) { - printk(KERN_ERR "ERROR: atomic context and non-atomic cmd!\n"); + pr_err("ERROR: atomic context and non-atomic cmd!\n"); dump_stack(); cmd->atomic = 1; res = 1; diff --git a/scst/include/scst_debug.h b/scst/include/scst_debug.h index cf2c83daa..027e92dd4 100644 --- a/scst/include/scst_debug.h +++ b/scst/include/scst_debug.h @@ -32,12 +32,47 @@ #include /* for WARN_ON_ONCE */ #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28) +/* + * See also the following commits: + * d091c2f5 - Introduction of pr_info() etc. in . + * 311d0761 - Introduction of pr_cont() in . + * 968ab183 - Moved pr_info() etc. from to + */ +#ifndef pr_info +#ifndef pr_fmt +#define pr_fmt(fmt) fmt +#endif + +#define pr_emerg(fmt, ...) \ + printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) +#define pr_alert(fmt, ...) \ + printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) +#define pr_crit(fmt, ...) \ + printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) +#define pr_err(fmt, ...) \ + printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) +#define pr_warning(fmt, ...) \ + printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) +#define pr_warn pr_warning +#define pr_notice(fmt, ...) \ + printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) +#define pr_info(fmt, ...) \ + printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) +#endif +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30) +#ifndef pr_cont +#define pr_cont(fmt, ...) \ + printk(KERN_CONT fmt, ##__VA_ARGS__) +#endif +#endif + #if !defined(INSIDE_KERNEL_TREE) #ifdef CONFIG_SCST_DEBUG #define sBUG() do { \ - printk(KERN_CRIT "BUG at %s:%d\n", \ - __FILE__, __LINE__); \ + pr_crit("BUG at %s:%d\n", __FILE__, __LINE__); \ local_irq_enable(); \ while (in_softirq()) \ local_bh_enable(); \ @@ -46,8 +81,8 @@ #define sBUG_ON(p) do { \ if (unlikely(p)) { \ - printk(KERN_CRIT "BUG at %s:%d (%s)\n", \ - __FILE__, __LINE__, #p); \ + pr_crit("BUG at %s:%d (%s)\n", \ + __FILE__, __LINE__, #p); \ local_irq_enable(); \ while (in_softirq()) \ local_bh_enable(); \