diff options
author | Arnd Bergmann <arnd@arndb.de> | 2017-03-02 09:58:03 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-03-06 22:22:16 -0500 |
commit | bd571195c9535c0b074fc7cd1b541b93817ed647 (patch) | |
tree | 795ace38f0e864479b74689921e0ff07c1deeb70 | |
parent | 8893cf6cb1cf56334c05120e23092dbfc9423ebb (diff) |
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: ace7f46ba5fd ("scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework.")
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Manish Rangankar <Manish.Rangankar@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/qedi/qedi_debugfs.c | 16 | ||||
-rw-r--r-- | drivers/scsi/qedi/qedi_fw.c | 4 | ||||
-rw-r--r-- | drivers/scsi/qedi/qedi_gbl.h | 8 | ||||
-rw-r--r-- | drivers/scsi/qedi/qedi_iscsi.c | 8 |
4 files changed, 21 insertions, 15 deletions
diff --git a/drivers/scsi/qedi/qedi_debugfs.c b/drivers/scsi/qedi/qedi_debugfs.c index 955936274241..59417199bf36 100644 --- a/drivers/scsi/qedi/qedi_debugfs.c +++ b/drivers/scsi/qedi/qedi_debugfs.c | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <linux/debugfs.h> | 14 | #include <linux/debugfs.h> |
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | 16 | ||
17 | int do_not_recover; | 17 | int qedi_do_not_recover; |
18 | static struct dentry *qedi_dbg_root; | 18 | static struct dentry *qedi_dbg_root; |
19 | 19 | ||
20 | void | 20 | void |
@@ -74,22 +74,22 @@ qedi_dbg_exit(void) | |||
74 | static ssize_t | 74 | static ssize_t |
75 | qedi_dbg_do_not_recover_enable(struct qedi_dbg_ctx *qedi_dbg) | 75 | qedi_dbg_do_not_recover_enable(struct qedi_dbg_ctx *qedi_dbg) |
76 | { | 76 | { |
77 | if (!do_not_recover) | 77 | if (!qedi_do_not_recover) |
78 | do_not_recover = 1; | 78 | qedi_do_not_recover = 1; |
79 | 79 | ||
80 | QEDI_INFO(qedi_dbg, QEDI_LOG_DEBUGFS, "do_not_recover=%d\n", | 80 | QEDI_INFO(qedi_dbg, QEDI_LOG_DEBUGFS, "do_not_recover=%d\n", |
81 | do_not_recover); | 81 | qedi_do_not_recover); |
82 | return 0; | 82 | return 0; |
83 | } | 83 | } |
84 | 84 | ||
85 | static ssize_t | 85 | static ssize_t |
86 | qedi_dbg_do_not_recover_disable(struct qedi_dbg_ctx *qedi_dbg) | 86 | qedi_dbg_do_not_recover_disable(struct qedi_dbg_ctx *qedi_dbg) |
87 | { | 87 | { |
88 | if (do_not_recover) | 88 | if (qedi_do_not_recover) |
89 | do_not_recover = 0; | 89 | qedi_do_not_recover = 0; |
90 | 90 | ||
91 | QEDI_INFO(qedi_dbg, QEDI_LOG_DEBUGFS, "do_not_recover=%d\n", | 91 | QEDI_INFO(qedi_dbg, QEDI_LOG_DEBUGFS, "do_not_recover=%d\n", |
92 | do_not_recover); | 92 | qedi_do_not_recover); |
93 | return 0; | 93 | return 0; |
94 | } | 94 | } |
95 | 95 | ||
@@ -141,7 +141,7 @@ qedi_dbg_do_not_recover_cmd_read(struct file *filp, char __user *buffer, | |||
141 | if (*ppos) | 141 | if (*ppos) |
142 | return 0; | 142 | return 0; |
143 | 143 | ||
144 | cnt = sprintf(buffer, "do_not_recover=%d\n", do_not_recover); | 144 | cnt = sprintf(buffer, "do_not_recover=%d\n", qedi_do_not_recover); |
145 | cnt = min_t(int, count, cnt - *ppos); | 145 | cnt = min_t(int, count, cnt - *ppos); |
146 | *ppos += cnt; | 146 | *ppos += cnt; |
147 | return cnt; | 147 | return cnt; |
diff --git a/drivers/scsi/qedi/qedi_fw.c b/drivers/scsi/qedi/qedi_fw.c index c9f0ef4e11b3..2bce3efc66a4 100644 --- a/drivers/scsi/qedi/qedi_fw.c +++ b/drivers/scsi/qedi/qedi_fw.c | |||
@@ -1461,9 +1461,9 @@ static void qedi_tmf_work(struct work_struct *work) | |||
1461 | get_itt(tmf_hdr->rtt), get_itt(ctask->itt), cmd->task_id, | 1461 | get_itt(tmf_hdr->rtt), get_itt(ctask->itt), cmd->task_id, |
1462 | qedi_conn->iscsi_conn_id); | 1462 | qedi_conn->iscsi_conn_id); |
1463 | 1463 | ||
1464 | if (do_not_recover) { | 1464 | if (qedi_do_not_recover) { |
1465 | QEDI_ERR(&qedi->dbg_ctx, "DONT SEND CLEANUP/ABORT %d\n", | 1465 | QEDI_ERR(&qedi->dbg_ctx, "DONT SEND CLEANUP/ABORT %d\n", |
1466 | do_not_recover); | 1466 | qedi_do_not_recover); |
1467 | goto abort_ret; | 1467 | goto abort_ret; |
1468 | } | 1468 | } |
1469 | 1469 | ||
diff --git a/drivers/scsi/qedi/qedi_gbl.h b/drivers/scsi/qedi/qedi_gbl.h index 8e488de88ece..63d793f46064 100644 --- a/drivers/scsi/qedi/qedi_gbl.h +++ b/drivers/scsi/qedi/qedi_gbl.h | |||
@@ -12,8 +12,14 @@ | |||
12 | 12 | ||
13 | #include "qedi_iscsi.h" | 13 | #include "qedi_iscsi.h" |
14 | 14 | ||
15 | #ifdef CONFIG_DEBUG_FS | ||
16 | extern int qedi_do_not_recover; | ||
17 | #else | ||
18 | #define qedi_do_not_recover (0) | ||
19 | #endif | ||
20 | |||
15 | extern uint qedi_io_tracing; | 21 | extern uint qedi_io_tracing; |
16 | extern int do_not_recover; | 22 | |
17 | extern struct scsi_host_template qedi_host_template; | 23 | extern struct scsi_host_template qedi_host_template; |
18 | extern struct iscsi_transport qedi_iscsi_transport; | 24 | extern struct iscsi_transport qedi_iscsi_transport; |
19 | extern const struct qed_iscsi_ops *qedi_ops; | 25 | extern const struct qed_iscsi_ops *qedi_ops; |
diff --git a/drivers/scsi/qedi/qedi_iscsi.c b/drivers/scsi/qedi/qedi_iscsi.c index b9f79d36142d..4cc474364c50 100644 --- a/drivers/scsi/qedi/qedi_iscsi.c +++ b/drivers/scsi/qedi/qedi_iscsi.c | |||
@@ -833,7 +833,7 @@ qedi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr, | |||
833 | return ERR_PTR(ret); | 833 | return ERR_PTR(ret); |
834 | } | 834 | } |
835 | 835 | ||
836 | if (do_not_recover) { | 836 | if (qedi_do_not_recover) { |
837 | ret = -ENOMEM; | 837 | ret = -ENOMEM; |
838 | return ERR_PTR(ret); | 838 | return ERR_PTR(ret); |
839 | } | 839 | } |
@@ -957,7 +957,7 @@ static int qedi_ep_poll(struct iscsi_endpoint *ep, int timeout_ms) | |||
957 | struct qedi_endpoint *qedi_ep; | 957 | struct qedi_endpoint *qedi_ep; |
958 | int ret = 0; | 958 | int ret = 0; |
959 | 959 | ||
960 | if (do_not_recover) | 960 | if (qedi_do_not_recover) |
961 | return 1; | 961 | return 1; |
962 | 962 | ||
963 | qedi_ep = ep->dd_data; | 963 | qedi_ep = ep->dd_data; |
@@ -1025,7 +1025,7 @@ static void qedi_ep_disconnect(struct iscsi_endpoint *ep) | |||
1025 | } | 1025 | } |
1026 | 1026 | ||
1027 | if (test_bit(QEDI_IN_RECOVERY, &qedi->flags)) { | 1027 | if (test_bit(QEDI_IN_RECOVERY, &qedi->flags)) { |
1028 | if (do_not_recover) { | 1028 | if (qedi_do_not_recover) { |
1029 | QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_INFO, | 1029 | QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_INFO, |
1030 | "Do not recover cid=0x%x\n", | 1030 | "Do not recover cid=0x%x\n", |
1031 | qedi_ep->iscsi_cid); | 1031 | qedi_ep->iscsi_cid); |
@@ -1039,7 +1039,7 @@ static void qedi_ep_disconnect(struct iscsi_endpoint *ep) | |||
1039 | } | 1039 | } |
1040 | } | 1040 | } |
1041 | 1041 | ||
1042 | if (do_not_recover) | 1042 | if (qedi_do_not_recover) |
1043 | goto ep_exit_recover; | 1043 | goto ep_exit_recover; |
1044 | 1044 | ||
1045 | switch (qedi_ep->state) { | 1045 | switch (qedi_ep->state) { |