diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2014-01-07 04:53:28 +0100 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2014-01-07 19:22:32 +0100 |
commit | 1ddd641ddcfa46d719189468b6856e9b17381a61 (patch) | |
tree | 29598896c6cd61e807a337075de578c53fed2349 /drivers/md/dm.c | |
parent | dm snapshot: call destroy_work_on_stack() to pair with INIT_WORK_ONSTACK() (diff) | |
download | linux-1ddd641ddcfa46d719189468b6856e9b17381a61.tar.xz linux-1ddd641ddcfa46d719189468b6856e9b17381a61.zip |
dm: remove pointless kobject comparison in dm_get_from_kobject
The comparison is always true and the compiler optimizes it out anyway.
Milan offered additional context relative to the original commit
784aae735d ("dm: add name and uuid to sysfs") which introduced the code:
"I think it is just relict of some experiments before I committed this
simple embedded sysfs kobj handling".
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Acked-by: Milan Broz <gmazyland@gmail.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r-- | drivers/md/dm.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 0704c523a76b..b3d937211a48 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -2905,17 +2905,11 @@ struct kobject *dm_kobject(struct mapped_device *md) return &md->kobj; } -/* - * struct mapped_device should not be exported outside of dm.c - * so use this check to verify that kobj is part of md structure - */ struct mapped_device *dm_get_from_kobject(struct kobject *kobj) { struct mapped_device *md; md = container_of(kobj, struct mapped_device, kobj); - if (&md->kobj != kobj) - return NULL; if (test_bit(DMF_FREEING, &md->flags) || dm_deleting_md(md)) |