public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: Mark virtio_blk with __refdata in virtio_blk.c
@ 2009-07-12 11:13 Rakib Mullick
  2009-07-17  6:02 ` Tejun Heo
  0 siblings, 1 reply; 4+ messages in thread
From: Rakib Mullick @ 2009-07-12 11:13 UTC (permalink / raw)
  To: axboe; +Cc: LKML

 Impact: Fix false positive warning.

The variable virtio_blk references the function virtblk_probe() (which
is in .devinit section) and also references the function
virtblk_remove() ( which is in .devexit section). So, virtio_blk
simultaneously refers .devinit and .devexit section. To avoid this
messup, we mark virtio_blk as __refdata.

We were warned by the following warning:

  LD      drivers/block/built-in.o
WARNING: drivers/block/built-in.o(.data+0xc8dc): Section mismatch in
reference from the variable virtio_blk to the function
.devinit.text:virtblk_probe()
The variable virtio_blk references
the function __devinit virtblk_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

WARNING: drivers/block/built-in.o(.data+0xc8e0): Section mismatch in
reference from the variable virtio_blk to the function
.devexit.text:virtblk_remove()
The variable virtio_blk references
the function __devexit virtblk_remove()
If the reference is valid then annotate the
variable with __exit* (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,

---
Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>

--- linus/drivers/block/virtio_blk.c	2009-07-10 12:30:16.000000000 +0600
+++ rakib/drivers/block/virtio_blk.c	2009-07-12 11:44:43.000000000 +0600
@@ -424,7 +424,8 @@ static unsigned int features[] = {
 	VIRTIO_BLK_F_SCSI, VIRTIO_BLK_F_IDENTIFY
 };

-static struct virtio_driver virtio_blk = {
+/* We were warned by false positive warning, so __refdata comes into rescue. */
+static struct virtio_driver __refdata virtio_blk = {
 	.feature_table = features,
 	.feature_table_size = ARRAY_SIZE(features),
 	.driver.name =	KBUILD_MODNAME,

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-07-19  1:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-12 11:13 [PATCH] block: Mark virtio_blk with __refdata in virtio_blk.c Rakib Mullick
2009-07-17  6:02 ` Tejun Heo
2009-07-17 14:13   ` Rakib Mullick
2009-07-19  1:48     ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox