• Arnd Bergmann's avatar
    scsi: qedi: fix building with LTO · 779936fa
    Arnd Bergmann authored
    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>
    779936fa
qedi_gbl.h 3.13 KB