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

scsi: qedi: fix building with LTO

When link-time optimizations are enabled, qedi fails to build because
of mismatched prototypes:

drivers/scsi/qedi/qedi_gbl.h:27:37: error: type of 'qedi_dbg_fops' does not match original declaration [-Werror=lto-type-mismatch]
 extern const struct file_operations qedi_dbg_fops;
                                     ^
drivers/scsi/qedi/qedi_debugfs.c:239:30: note: 'qedi_dbg_fops' was previously declared here
 const struct file_operations qedi_dbg_fops[] = {
                              ^
drivers/scsi/qedi/qedi_gbl.h:26:32: error: type of 'qedi_debugfs_ops' does not match original declaration [-Werror=lto-type-mismatch]
 extern struct qedi_debugfs_ops qedi_debugfs_ops;
                                ^
drivers/scsi/qedi/qedi_debugfs.c:102:25: note: 'qedi_debugfs_ops' was previously declared here
 struct qedi_debugfs_ops qedi_debugfs_ops[] = {

This changes the declaration to match the definition, and adapts the
users as necessary. Since both array can be constant here, I'm adding
the 'const' everywhere for consistency.
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 d9da891a
...@@ -134,7 +134,7 @@ struct qedi_debugfs_ops { ...@@ -134,7 +134,7 @@ struct qedi_debugfs_ops {
} }
void qedi_dbg_host_init(struct qedi_dbg_ctx *qedi, void qedi_dbg_host_init(struct qedi_dbg_ctx *qedi,
struct qedi_debugfs_ops *dops, const struct qedi_debugfs_ops *dops,
const struct file_operations *fops); const struct file_operations *fops);
void qedi_dbg_host_exit(struct qedi_dbg_ctx *qedi); void qedi_dbg_host_exit(struct qedi_dbg_ctx *qedi);
void qedi_dbg_init(char *drv_name); void qedi_dbg_init(char *drv_name);
......
...@@ -19,7 +19,7 @@ static struct dentry *qedi_dbg_root; ...@@ -19,7 +19,7 @@ static struct dentry *qedi_dbg_root;
void void
qedi_dbg_host_init(struct qedi_dbg_ctx *qedi, qedi_dbg_host_init(struct qedi_dbg_ctx *qedi,
struct qedi_debugfs_ops *dops, const struct qedi_debugfs_ops *dops,
const struct file_operations *fops) const struct file_operations *fops)
{ {
char host_dirname[32]; char host_dirname[32];
...@@ -99,7 +99,7 @@ static struct qedi_list_of_funcs qedi_dbg_do_not_recover_ops[] = { ...@@ -99,7 +99,7 @@ static struct qedi_list_of_funcs qedi_dbg_do_not_recover_ops[] = {
{ NULL, NULL } { NULL, NULL }
}; };
struct qedi_debugfs_ops qedi_debugfs_ops[] = { const struct qedi_debugfs_ops qedi_debugfs_ops[] = {
{ "gbl_ctx", NULL }, { "gbl_ctx", NULL },
{ "do_not_recover", qedi_dbg_do_not_recover_ops}, { "do_not_recover", qedi_dbg_do_not_recover_ops},
{ "io_trace", NULL }, { "io_trace", NULL },
......
...@@ -23,8 +23,8 @@ extern uint qedi_io_tracing; ...@@ -23,8 +23,8 @@ extern uint qedi_io_tracing;
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;
extern struct qedi_debugfs_ops qedi_debugfs_ops; extern const struct qedi_debugfs_ops qedi_debugfs_ops[];
extern const struct file_operations qedi_dbg_fops; extern const struct file_operations qedi_dbg_fops[];
extern struct device_attribute *qedi_shost_attrs[]; extern struct device_attribute *qedi_shost_attrs[];
int qedi_alloc_sq(struct qedi_ctx *qedi, struct qedi_endpoint *ep); int qedi_alloc_sq(struct qedi_ctx *qedi, struct qedi_endpoint *ep);
......
...@@ -2303,8 +2303,8 @@ static int __qedi_probe(struct pci_dev *pdev, int mode) ...@@ -2303,8 +2303,8 @@ static int __qedi_probe(struct pci_dev *pdev, int mode)
} }
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
qedi_dbg_host_init(&qedi->dbg_ctx, &qedi_debugfs_ops, qedi_dbg_host_init(&qedi->dbg_ctx, qedi_debugfs_ops,
&qedi_dbg_fops); qedi_dbg_fops);
#endif #endif
QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_INFO, QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_INFO,
"QLogic FastLinQ iSCSI Module qedi %s, FW %d.%d.%d.%d\n", "QLogic FastLinQ iSCSI Module qedi %s, FW %d.%d.%d.%d\n",
......
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