summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2018-02-02 14:12:17 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2018-02-13 21:37:05 -0500
commit230816d48ed0213f25a1835f5e0e1bbef96bb896 (patch)
treeb1e0dd1913eaf3188d7092c8446a08e6f82d3f66
parent80e6e9c1dabb940dc7900f37c05f07280af90ac8 (diff)
downloadlinux-stable-230816d48ed0213f25a1835f5e0e1bbef96bb896.tar.gz
linux-stable-230816d48ed0213f25a1835f5e0e1bbef96bb896.tar.bz2
linux-stable-230816d48ed0213f25a1835f5e0e1bbef96bb896.zip
scsi: sym53c416: avoid section mismatch with LTO
Building with link time optimizations produces a false-positive section mismatch warning: WARNING: vmlinux.o(.data+0xf8c8): Section mismatch in reference from the variable driver_template.lto_priv.6915 to the function .init.text:sym53c416_detect() The variable driver_template.lto_priv.6915 references the function __init sym53c416_detect() If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console The ->detect callback is always entered from the init_this_scsi_driver() init function, but apparently LTO turns the optimized direct function call into an indirect call through a non-__initdata pointer. All drivers using init_this_scsi_driver() are for ancient hardware, and most don't mark the detect() callback as __init(), so I'm just removing the annotation here to kill off the warning instead of doing a larger rework. [mkp: typo] Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/sym53c416.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/sym53c416.c b/drivers/scsi/sym53c416.c
index 5bdcbe8fa958..e68bcdc75bc3 100644
--- a/drivers/scsi/sym53c416.c
+++ b/drivers/scsi/sym53c416.c
@@ -608,7 +608,7 @@ static void sym53c416_probe(void)
}
}
-int __init sym53c416_detect(struct scsi_host_template *tpnt)
+int sym53c416_detect(struct scsi_host_template *tpnt)
{
unsigned long flags;
struct Scsi_Host * shpnt = NULL;