Commit bd571195 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Martin K. Petersen

scsi: qedi: fix build error without DEBUG_FS

Without CONFIG_DEBUG_FS, we run into a link error:

drivers/scsi/qedi/qedi_iscsi.o: In function `qedi_ep_poll':
qedi_iscsi.c:(.text.qedi_ep_poll+0x134): undefined reference to `do_not_recover'
drivers/scsi/qedi/qedi_iscsi.o: In function `qedi_ep_disconnect':
qedi_iscsi.c:(.text.qedi_ep_disconnect+0x36c): undefined reference to `do_not_recover'
drivers/scsi/qedi/qedi_iscsi.o: In function `qedi_ep_connect':
qedi_iscsi.c:(.text.qedi_ep_connect+0x350): undefined reference to `do_not_recover'
drivers/scsi/qedi/qedi_fw.o: In function `qedi_tmf_work':
qedi_fw.c:(.text.qedi_tmf_work+0x3b4): undefined reference to `do_not_recover'

This defines the symbol as a constant in this case, as there is no way to
set it to anything other than zero without DEBUG_FS. In addition, I'm renaming
it to qedi_do_not_recover in order to put it into a driver specific namespace,
as "do_not_recover" is a really bad name for a kernel-wide global identifier
when it is used only in one driver.

Fixes: ace7f46b ("scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework.")
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarManish Rangankar <Manish.Rangankar@cavium.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 8893cf6c
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/module.h> #include <linux/module.h>
int do_not_recover; int qedi_do_not_recover;
static struct dentry *qedi_dbg_root; static struct dentry *qedi_dbg_root;
void void
...@@ -74,22 +74,22 @@ qedi_dbg_exit(void) ...@@ -74,22 +74,22 @@ qedi_dbg_exit(void)
static ssize_t static ssize_t
qedi_dbg_do_not_recover_enable(struct qedi_dbg_ctx *qedi_dbg) qedi_dbg_do_not_recover_enable(struct qedi_dbg_ctx *qedi_dbg)
{ {
if (!do_not_recover) if (!qedi_do_not_recover)
do_not_recover = 1; qedi_do_not_recover = 1;
QEDI_INFO(qedi_dbg, QEDI_LOG_DEBUGFS, "do_not_recover=%d\n", QEDI_INFO(qedi_dbg, QEDI_LOG_DEBUGFS, "do_not_recover=%d\n",
do_not_recover); qedi_do_not_recover);
return 0; return 0;
} }
static ssize_t static ssize_t
qedi_dbg_do_not_recover_disable(struct qedi_dbg_ctx *qedi_dbg) qedi_dbg_do_not_recover_disable(struct qedi_dbg_ctx *qedi_dbg)
{ {
if (do_not_recover) if (qedi_do_not_recover)
do_not_recover = 0; qedi_do_not_recover = 0;
QEDI_INFO(qedi_dbg, QEDI_LOG_DEBUGFS, "do_not_recover=%d\n", QEDI_INFO(qedi_dbg, QEDI_LOG_DEBUGFS, "do_not_recover=%d\n",
do_not_recover); qedi_do_not_recover);
return 0; return 0;
} }
...@@ -141,7 +141,7 @@ qedi_dbg_do_not_recover_cmd_read(struct file *filp, char __user *buffer, ...@@ -141,7 +141,7 @@ qedi_dbg_do_not_recover_cmd_read(struct file *filp, char __user *buffer,
if (*ppos) if (*ppos)
return 0; return 0;
cnt = sprintf(buffer, "do_not_recover=%d\n", do_not_recover); cnt = sprintf(buffer, "do_not_recover=%d\n", qedi_do_not_recover);
cnt = min_t(int, count, cnt - *ppos); cnt = min_t(int, count, cnt - *ppos);
*ppos += cnt; *ppos += cnt;
return cnt; return cnt;
......
...@@ -1461,9 +1461,9 @@ static void qedi_tmf_work(struct work_struct *work) ...@@ -1461,9 +1461,9 @@ static void qedi_tmf_work(struct work_struct *work)
get_itt(tmf_hdr->rtt), get_itt(ctask->itt), cmd->task_id, get_itt(tmf_hdr->rtt), get_itt(ctask->itt), cmd->task_id,
qedi_conn->iscsi_conn_id); qedi_conn->iscsi_conn_id);
if (do_not_recover) { if (qedi_do_not_recover) {
QEDI_ERR(&qedi->dbg_ctx, "DONT SEND CLEANUP/ABORT %d\n", QEDI_ERR(&qedi->dbg_ctx, "DONT SEND CLEANUP/ABORT %d\n",
do_not_recover); qedi_do_not_recover);
goto abort_ret; goto abort_ret;
} }
......
...@@ -12,8 +12,14 @@ ...@@ -12,8 +12,14 @@
#include "qedi_iscsi.h" #include "qedi_iscsi.h"
#ifdef CONFIG_DEBUG_FS
extern int qedi_do_not_recover;
#else
#define qedi_do_not_recover (0)
#endif
extern uint qedi_io_tracing; extern uint qedi_io_tracing;
extern int do_not_recover;
extern struct scsi_host_template qedi_host_template; extern struct scsi_host_template qedi_host_template;
extern struct iscsi_transport qedi_iscsi_transport; extern struct iscsi_transport qedi_iscsi_transport;
extern const struct qed_iscsi_ops *qedi_ops; extern const struct qed_iscsi_ops *qedi_ops;
......
...@@ -833,7 +833,7 @@ qedi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr, ...@@ -833,7 +833,7 @@ qedi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr,
return ERR_PTR(ret); return ERR_PTR(ret);
} }
if (do_not_recover) { if (qedi_do_not_recover) {
ret = -ENOMEM; ret = -ENOMEM;
return ERR_PTR(ret); return ERR_PTR(ret);
} }
...@@ -957,7 +957,7 @@ static int qedi_ep_poll(struct iscsi_endpoint *ep, int timeout_ms) ...@@ -957,7 +957,7 @@ static int qedi_ep_poll(struct iscsi_endpoint *ep, int timeout_ms)
struct qedi_endpoint *qedi_ep; struct qedi_endpoint *qedi_ep;
int ret = 0; int ret = 0;
if (do_not_recover) if (qedi_do_not_recover)
return 1; return 1;
qedi_ep = ep->dd_data; qedi_ep = ep->dd_data;
...@@ -1025,7 +1025,7 @@ static void qedi_ep_disconnect(struct iscsi_endpoint *ep) ...@@ -1025,7 +1025,7 @@ static void qedi_ep_disconnect(struct iscsi_endpoint *ep)
} }
if (test_bit(QEDI_IN_RECOVERY, &qedi->flags)) { if (test_bit(QEDI_IN_RECOVERY, &qedi->flags)) {
if (do_not_recover) { if (qedi_do_not_recover) {
QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_INFO, QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_INFO,
"Do not recover cid=0x%x\n", "Do not recover cid=0x%x\n",
qedi_ep->iscsi_cid); qedi_ep->iscsi_cid);
...@@ -1039,7 +1039,7 @@ static void qedi_ep_disconnect(struct iscsi_endpoint *ep) ...@@ -1039,7 +1039,7 @@ static void qedi_ep_disconnect(struct iscsi_endpoint *ep)
} }
} }
if (do_not_recover) if (qedi_do_not_recover)
goto ep_exit_recover; goto ep_exit_recover;
switch (qedi_ep->state) { switch (qedi_ep->state) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment