mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-scsi@vger.kernel.org,
	"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Nicolas Pitre <nico@linaro.org>, Andi Kleen <ak@linux.intel.com>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/6] scsi: sym53c416: avoid section mismatch with LTO
Date: Fri,  2 Feb 2018 14:12:17 +0100	[thread overview]
Message-ID: <20180202131225.1658853-4-arnd@arndb.de> (raw)
In-Reply-To: <20180202131225.1658853-1-arnd@arndb.de>

Building with link time optimizations produces a false-postive 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.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/scsi/sym53c416.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.9.0

  parent reply	other threads:[~2018-02-02 13:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180202131225.1658853-1-arnd@arndb.de>
2018-02-02 13:12 ` [PATCH 1/6] scsi: fc_encode: work around strncpy size warnings Arnd Bergmann
2018-02-02 13:12 ` [PATCH 2/6] scsi: NCR53c406a: avoid section mismatch with LTO Arnd Bergmann
2018-02-09 23:47   ` Martin K. Petersen
2018-02-02 13:12 ` Arnd Bergmann [this message]
2018-02-09 23:47   ` [PATCH 3/6] scsi: sym53c416: " Martin K. Petersen
2018-02-02 13:12 ` [PATCH 4/6] scsi: qedf: fix LTO-enabled build Arnd Bergmann
2018-02-07 15:38   ` Chad Dupuis
2018-02-09 23:24   ` Martin K. Petersen
2018-02-02 13:12 ` [PATCH 5/6] scsi: qedi: fix building with LTO Arnd Bergmann
2018-02-05  6:08   ` Rangankar, Manish
2018-02-07  1:24   ` Martin K. Petersen
2018-02-02 13:12 ` [PATCH 6/6] scsi: qedf: use correct strncpy() size Arnd Bergmann
2018-02-05  2:56   ` kbuild test robot
2018-02-07 16:26   ` Chad Dupuis
2018-02-09 23:36   ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180202131225.1658853-4-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=ak@linux.intel.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=nico@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®