Skip to content

Commit

Permalink
i2c: Fix sparse warning in i2c.h
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark M. Hoffman authored and Jean Delvare committed Jul 12, 2007
1 parent d64f73b commit d75d53c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/linux/i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d75d53c

Please sign in to comment.