[i2c] [PATCH] i2c: fix sparse warning in i2c.h

Jean Delvare khali at linux-fr.org
Thu May 3 18:44:19 CEST 2007


Hi Mark,

On Sun, 29 Apr 2007 12:34:27 -0400, Mark M. Hoffman wrote:
> i2c: fix sparse warning in i2c.h
>     
> Kill a sparse warning by un-nesting two container_of() calls.
>     
> Signed-off-by: Mark M. Hoffman <mhoffman at lightlink.com>
> 
> diff --git a/include/linux/i2c.h b/include/linux/i2c.h
> index 9428092..acd88fa 100644
> --- a/include/linux/i2c.h
> +++ b/include/linux/i2c.h
> @@ -166,7 +166,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)

Applied, thanks.

-- 
Jean Delvare



More information about the i2c mailing list