[dm-devel] [PATCH] dm: remove pointless comparison

Mikulas Patocka mpatocka at redhat.com
Tue Jan 7 03:53:28 UTC 2014


Remove pointless comparison in dm_get_from_kobject. The comparison is
always true and the compiler optimizes it out anyway.

Signed-off-by: Mikulas Patocka <mpatocka at redhat.com>

---
 drivers/md/dm.c |    2 --
 1 file changed, 2 deletions(-)

Index: linux-3.13-rc7/drivers/md/dm.c
===================================================================
--- linux-3.13-rc7.orig/drivers/md/dm.c	2014-01-07 01:28:27.000000000 +0100
+++ linux-3.13-rc7/drivers/md/dm.c	2014-01-07 01:28:39.000000000 +0100
@@ -2922,8 +2922,6 @@ struct mapped_device *dm_get_from_kobjec
 	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))




More information about the dm-devel mailing list