diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2014-01-06 22:53:28 -0500 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2014-01-07 13:22:32 -0500 |
commit | 1ddd641ddcfa46d719189468b6856e9b17381a61 (patch) | |
tree | 29598896c6cd61e807a337075de578c53fed2349 /drivers | |
parent | c1a6416021b311fdb5b98e40ed8b29508845ed16 (diff) |
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')
-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) | |||
2905 | return &md->kobj; | 2905 | return &md->kobj; |
2906 | } | 2906 | } |
2907 | 2907 | ||
2908 | /* | ||
2909 | * struct mapped_device should not be exported outside of dm.c | ||
2910 | * so use this check to verify that kobj is part of md structure | ||
2911 | */ | ||
2912 | struct mapped_device *dm_get_from_kobject(struct kobject *kobj) | 2908 | struct mapped_device *dm_get_from_kobject(struct kobject *kobj) |
2913 | { | 2909 | { |
2914 | struct mapped_device *md; | 2910 | struct mapped_device *md; |
2915 | 2911 | ||
2916 | md = container_of(kobj, struct mapped_device, kobj); | 2912 | md = container_of(kobj, struct mapped_device, kobj); |
2917 | if (&md->kobj != kobj) | ||
2918 | return NULL; | ||
2919 | 2913 | ||
2920 | if (test_bit(DMF_FREEING, &md->flags) || | 2914 | if (test_bit(DMF_FREEING, &md->flags) || |
2921 | dm_deleting_md(md)) | 2915 | dm_deleting_md(md)) |