From: Mark M. Hoffman Date: Thu, 12 Jul 2007 12:12:28 +0000 (+0200) Subject: i2c: Fix sparse warning in i2c.h X-Git-Tag: v2.6.23-rc1~1112^2~24 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d75d53cd571c02990d56e72f615ab11e943772f9;p=linux-2.6 i2c: Fix sparse warning in i2c.h Kill a sparse warning by un-nesting two container_of() calls. Signed-off-by: Mark M. Hoffman Signed-off-by: Jean Delvare --- diff --git a/include/linux/i2c.h b/include/linux/i2c.h index a24e267fd1..44f2ecf47d 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -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)