[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170613092341.GD5677@kroah.com>
Date: Tue, 13 Jun 2017 11:23:41 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: sunil.m@...hveda.org
Cc: devel@...verdev.osuosl.org, geo.emmnl@...il.com,
karniksayli1995@...il.com, linux-kernel@...r.kernel.org,
sergio.paracuellos@...il.com, sfaragnaus@...il.com,
fransklaver@...il.com
Subject: Re: [PATCH] staging: wlan-ng: Amend type mismatch warnings
On Mon, Jun 12, 2017 at 10:45:38PM +0530, sunil.m@...hveda.org wrote:
> From: Suniel Mahesh <sunil.m@...hveda.org>
>
> The following type mismatch warnings reported by sparse
> have been amended:
> warning: cast to restricted __le16
> warning: incorrect type in assignment (different base types)
>
> Signed-off-by: Suniel Mahesh <sunil.m@...hveda.org>
> ---
> drivers/staging/wlan-ng/prism2mgmt.c | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c
> index f4d6e48..358b556 100644
> --- a/drivers/staging/wlan-ng/prism2mgmt.c
> +++ b/drivers/staging/wlan-ng/prism2mgmt.c
> @@ -185,7 +185,7 @@ int prism2mgmt_scan(struct wlandevice *wlandev, void *msgp)
>
> /* set up the txrate to be 2MBPS. Should be fastest basicrate... */
> word = HFA384x_RATEBIT_2;
> - scanreq.tx_rate = cpu_to_le16(word);
> + scanreq.tx_rate = (__force u16)cpu_to_le16(word);
If you ever find yourself using __force, it is almost always the wrong
solution. Please step back and understand what is going on here before
making a change like this.
good luck!
greg k-h
Powered by blists - more mailing lists