]> err.no Git - linux-2.6/commitdiff
i2c: Fix sparse warning in i2c.h
authorMark M. Hoffman <mhoffman@lightlink.com>
Thu, 12 Jul 2007 12:12:28 +0000 (14:12 +0200)
committerJean Delvare <khali@hyperion.delvare>
Thu, 12 Jul 2007 12:12:28 +0000 (14:12 +0200)
Kill a sparse warning by un-nesting two container_of() calls.

Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
include/linux/i2c.h

index a24e267fd189b7aebc06f001cf5d5c66f9e66e98..44f2ecf47d9f659b4ec1dbcfea75b26252f6d6bc 100644 (file)
@@ -185,7 +185,8 @@ struct i2c_client {
 
 static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj)
 {
-       return to_i2c_client(container_of(kobj, struct device, kobj));
+       struct device * const dev = container_of(kobj, struct device, kobj);
+       return to_i2c_client(dev);
 }
 
 static inline void *i2c_get_clientdata (struct i2c_client *dev)