Skip to contentSkip to conversation

genhd: fixup kobj_to_dev() macro

PATCH In review Alexey Dobriyan 2 participants 2 messages Jan 8, 2008 – Jan 12, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 genhd: fixup kobj_to_dev() macro

Please, fold into gregkh-driver-block-device.patch
-------------------------------------------------------
[PATCH -mm 1/4] genhd: fixup kobj_to_dev() macro

Quoted 1 line

From Pavel Emelyanov <[email protected]>

Using "kobj" twice is not OK, because substitution will be done twice resulting in compile breakage if variable name is different from structure member name.

---

 include/linux/genhd.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/genhd.h +1 -1
@@ -13,7 +13,7 @@
 
 #ifdef CONFIG_BLOCK
 
-#define kobj_to_dev(kobj) container_of(kobj, struct device, kobj)
+#define kobj_to_dev(k) container_of(k, struct device, kobj)
 #define dev_to_disk(device) container_of(device, struct gendisk, dev)
 #define dev_to_part(device) container_of(device, struct hd_struct, dev)
 
#1 lore raw
Quoted 3 lines · Alexey Dobriyan

Please, fold into gregkh-driver-block-device.patch
-------------------------------------------------------
[PATCH -mm 1/4] genhd: fixup kobj_to_dev() macro

Thanks, I've now merged it in.

greg k-h