aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRakib Mullick <rakib.mullick@gmail.com>2009-07-17 10:13:22 -0400
committerTejun Heo <tj@kernel.org>2009-07-18 21:46:48 -0400
commit4fbfff76079a5c0e1751b0ddf53160d33f7831e7 (patch)
treebedf35332ecc68515f210331507493924f71d95c
parent9cb308ce8d32a1fb3600acab6034e19a90228743 (diff)
virtio_blk: mark virtio_blk with __refdata to kill spurious section mismatch
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> Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r--drivers/block/virtio_blk.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 43db3ea15b54..024f2d292581 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -424,7 +424,12 @@ static unsigned int features[] = {
424 VIRTIO_BLK_F_SCSI, VIRTIO_BLK_F_IDENTIFY 424 VIRTIO_BLK_F_SCSI, VIRTIO_BLK_F_IDENTIFY
425}; 425};
426 426
427static struct virtio_driver virtio_blk = { 427/*
428 * virtio_blk causes spurious section mismatch warning by
429 * simultaneously referring to a __devinit and a __devexit function.
430 * Use __refdata to avoid this warning.
431 */
432static struct virtio_driver __refdata virtio_blk = {
428 .feature_table = features, 433 .feature_table = features,
429 .feature_table_size = ARRAY_SIZE(features), 434 .feature_table_size = ARRAY_SIZE(features),
430 .driver.name = KBUILD_MODNAME, 435 .driver.name = KBUILD_MODNAME,