[PATCH] Staging: wlan-ng: fix a wrong type of a assignment

Greg Kroah-Hartman gregkh at linuxfoundation.org
Thu Sep 17 04:52:06 UTC 2015


On Wed, Sep 16, 2015 at 09:06:13PM +0800, Navy Cheng wrote:
> The type of value is u16 however the return type of cpu_to_le16() is
> __le16. The incorrect type of assignment is complained by sparse.
> 
> Signed-off-by: Navy Cheng <navych at 126.com>
> ---
>  drivers/staging/wlan-ng/hfa384x.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/wlan-ng/hfa384x.h b/drivers/staging/wlan-ng/hfa384x.h
> index 8dfe438..fe7df37 100644
> --- a/drivers/staging/wlan-ng/hfa384x.h
> +++ b/drivers/staging/wlan-ng/hfa384x.h
> @@ -1385,7 +1385,7 @@ static inline int hfa384x_drvr_getconfig16(hfa384x_t *hw, u16 rid, void *val)
>  
>  static inline int hfa384x_drvr_setconfig16(hfa384x_t *hw, u16 rid, u16 val)
>  {
> -	u16 value = cpu_to_le16(val);
> +	__le16 value = cpu_to_le16(val);
>  
>  	return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value));

but value is a pointer to a u16, doesn't this change now cause another
sparse warning?


More information about the devel mailing list