linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Jacob Kiefer <jtk54@cornell.edu>
Cc: "open list:STAGING SUBSYSTEM" <devel@driverdev.osuosl.org>,
	Jes Sorensen <Jes.Sorensen@redhat.com>,
	Roberta Dobrescu <roberta.dobrescu@gmail.com>,
	"open list:STAGING - REALTEK RTL8723U WIRELESS DRIVER"
	<linux-wireless@vger.kernel.org>,
	"Gujulan Elango, Hari Prasath (H.)" <hgujulan@visteon.com>,
	open list <linux-kernel@vger.kernel.org>,
	Larry Finger <Larry.Finger@lwfinger.net>
Subject: Re: [PATCH] staging: rtl8723au: Fix Sparse errors in rtl8723a_cmd.c
Date: Sun, 4 Oct 2015 09:48:08 +0100	[thread overview]
Message-ID: <20151004084808.GA30827@kroah.com> (raw)
In-Reply-To: <1443832594-29663-1-git-send-email-jtk54@cornell.edu>

On Fri, Oct 02, 2015 at 08:36:28PM -0400, Jacob Kiefer wrote:
> From: Jacob Kiefer <jtk54@cornell.edu>
> 
> This patch fixes the following sparse errors:
> 
> 
>   CHECK   drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
> ...
> drivers/staging/rtl8723au/hal/rtl8723a_cmd.c:118:25: warning: incorrect type in assignment (different base types)
> drivers/staging/rtl8723au/hal/rtl8723a_cmd.c:118:25:    expected unsigned int [unsigned] [usertype] <noident>
> drivers/staging/rtl8723au/hal/rtl8723a_cmd.c:118:25:    got restricted __le32 [usertype] <noident>
> drivers/staging/rtl8723au/hal/rtl8723a_cmd.c:130:14: warning: incorrect type in assignment (different base types)
> drivers/staging/rtl8723au/hal/rtl8723a_cmd.c:130:14:    expected unsigned int [unsigned] [usertype] mask
> drivers/staging/rtl8723au/hal/rtl8723a_cmd.c:130:14:    got restricted __le32 [usertype] <noident>
>   CC [M]  drivers/staging/rtl8723au/hal/rtl8723a_cmd.o
> 
> Signed-off-by: Jacob Kiefer <jtk54@cornell.edu>
> ---
>  drivers/staging/rtl8723au/hal/rtl8723a_cmd.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
> index 9733aa6..111a24d 100644
> --- a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
> +++ b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
> @@ -115,9 +115,11 @@ exit:
>  
>  int rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, u8 *param)
>  {
> -	*((u32 *)param) = cpu_to_le32(*((u32 *)param));
> +	__le32 leparam;

Why __le32?  Does this variable go across the user/kernel boundry
somehow?  If not, just use le32.

>  
> -	FillH2CCmd(padapter, RSSI_SETTING_EID, 3, param);
> +	leparam = cpu_to_le32(*((u32 *)param));
> +
> +	FillH2CCmd(padapter, RSSI_SETTING_EID, 3, (u8 *)&leparam);

At first glance, you aren't doing ths same logic in this function as the
original did, please look at this very closely again and verify that you
are doing this correctly.

Don't just blindly quiet tools like sparse, it is warning for a reason,
but be careful about your fix.

thanks,

greg k-h

  reply	other threads:[~2015-10-04  8:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-03  0:36 [PATCH] staging: rtl8723au: Fix Sparse errors in rtl8723a_cmd.c Jacob Kiefer
2015-10-04  8:48 ` Greg Kroah-Hartman [this message]
2015-10-04 19:26 ` Jacob Kiefer

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=20151004084808.GA30827@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Jes.Sorensen@redhat.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=hgujulan@visteon.com \
    --cc=jtk54@cornell.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=roberta.dobrescu@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).