• Arnd Bergmann's avatar
    scsi: qedf: fix LTO-enabled build · d9ea463a
    Arnd Bergmann authored
    The prototype for qedf_dbg_fops/qedf_debugfs_ops doesn't match the definition,
    which causes the final link to fail with link-time optimizations:
    
    drivers/scsi/qedf/qedf_main.c:34: error: type of 'qedf_dbg_fops' does not match original declaration [-Werror=lto-type-mismatch]
     extern struct file_operations qedf_dbg_fops;
    
    drivers/scsi/qedf/qedf_debugfs.c:443: note: 'qedf_dbg_fops' was previously declared here
     const struct file_operations qedf_dbg_fops[] = {
    
    drivers/scsi/qedf/qedf_main.c:33: error: type of 'qedf_debugfs_ops' does not match original declaration [-Werror=lto-type-mismatch]
     extern struct qedf_debugfs_ops qedf_debugfs_ops;
    
    drivers/scsi/qedf/qedf_debugfs.c:102: note: 'qedf_debugfs_ops' was previously declared here
     struct qedf_debugfs_ops qedf_debugfs_ops[] = {
    
    This corrects the prototype and moves it into a shared header file where it
    belongs. The file operations can also be marked 'const' like the
    qedf_debugfs_ops.
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Acked-by: default avatarChad Dupuis <chad.dupuis@cavium.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    d9ea463a
qedf_debugfs.c 11.6 KB