Skip to contentSkip to conversation

i2o: Remove the dangerous kobj_to_i2o_device macro

PATCH Applied Ferenc Wagner 2 participants 2 messages Mar 23, 2010 – Mar 24, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2o: Remove the dangerous kobj_to_i2o_device macro

This macro worked only when applied to variables named 'kobj'. While this could have been fixed by simply renaming the macro argument, a more type-safe replacement by an inline function would be preferred. However, nobody uses this macro, so it's simpler to just remove it.

---
 include/linux/i2o.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
include/linux/i2o.h +0 -1
index 87018dc..9e7a12d 100644
@@ -782,7 +782,6 @@ extern int i2o_exec_lct_get(struct i2o_controller *);
 #define to_i2o_driver(drv) container_of(drv,struct i2o_driver, driver)
 #define to_i2o_device(dev) container_of(dev, struct i2o_device, device)
 #define to_i2o_controller(dev) container_of(dev, struct i2o_controller, device)
-#define kobj_to_i2o_device(kobj) to_i2o_device(container_of(kobj, struct device, kobj))
 
 /**
  *	i2o_out_to_virt - Turn an I2O message to a virtual address
Signature · 1 line
1.5.6.5
Applied
#1 lore raw
Quoted 4 lines · Ferenc Wagner

This macro worked only when applied to variables named 'kobj'. While this could have been fixed by simply renaming the macro argument, a more type-safe replacement by an inline function would be preferred. However, nobody uses this macro, so it's simpler to just remove it.

Thanks, applied to the block tree.

Signature · 1 line
Jens Axboe