diff mbox

[3.11.y.z,extended,stable] Patch "dm: remove pointless kobject comparison in dm_get_from_kobject" has been added to staging queue

Message ID 1391606050-31887-1-git-send-email-luis.henriques@canonical.com
State New
Headers show

Commit Message

Luis Henriques Feb. 5, 2014, 1:14 p.m. UTC
This is a note to let you know that I have just added a patch titled

    dm: remove pointless kobject comparison in dm_get_from_kobject

to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.11.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.11.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

From ac219aa0853bcbbed8468b5e3783bb26cccf102e Mon Sep 17 00:00:00 2001
From: Mikulas Patocka <mpatocka@redhat.com>
Date: Mon, 6 Jan 2014 22:53:28 -0500
Subject: dm: remove pointless kobject comparison in dm_get_from_kobject

commit 1ddd641ddcfa46d719189468b6856e9b17381a61 upstream.

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>
[ luis: 3.11.y prereq for:
  - 2995fa7 "dm sysfs: fix a module unload race" ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/md/dm.c | 6 ------
 1 file changed, 6 deletions(-)

--
1.8.3.2
diff mbox

Patch

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 0cc1449..267495c 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -2768,17 +2768,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))