mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: sunil.m@techveda.org
Cc: devel@driverdev.osuosl.org, geo.emmnl@gmail.com,
	karniksayli1995@gmail.com, linux-kernel@vger.kernel.org,
	sergio.paracuellos@gmail.com, sfaragnaus@gmail.com,
	fransklaver@gmail.com
Subject: Re: [PATCH] staging: wlan-ng: Amend type mismatch warnings
Date: Tue, 13 Jun 2017 11:23:41 +0200	[thread overview]
Message-ID: <20170613092341.GD5677@kroah.com> (raw)
In-Reply-To: <1497287738-28567-1-git-send-email-sunil.m@techveda.org>

On Mon, Jun 12, 2017 at 10:45:38PM +0530, sunil.m@techveda.org wrote:
> From: Suniel Mahesh <sunil.m@techveda.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@techveda.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

  parent reply	other threads:[~2017-06-13  9:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-12 17:15 sunil.m
2017-06-12 18:48 ` Frans Klaver
2017-06-12 20:10 ` Dan Carpenter
2017-06-13  9:23 ` Greg KH [this message]
2017-06-15  6:41   ` [PATCH v2] " sunil.m
2017-06-15 10:03     ` Frans Klaver
2017-06-16  5:31       ` [PATCH v3] staging: wlan-ng: Fix struct definition's and variable type sunil.m

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170613092341.GD5677@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=fransklaver@gmail.com \
    --cc=geo.emmnl@gmail.com \
    --cc=karniksayli1995@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sergio.paracuellos@gmail.com \
    --cc=sfaragnaus@gmail.com \
    --cc=sunil.m@techveda.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome