lkml.org 
[lkml]   [2009]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] block: Mark virtio_blk with __refdata in virtio_blk.c
Hello,

Rakib Mullick wrote:
> 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>

Generally looks good to me.

> +/* We were warned by false positive warning, so __refdata comes into rescue. */
> +static struct virtio_driver __refdata virtio_blk = {

But it would be nicer if the comment contains a bit more of detail.
Can you please beef it up a bit? After that I'll queue it in my temp
tree and send to Linus' way.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2009-07-17 08:03    [W:0.060 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site