All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: "Tobenna Peter, Igwe" <ptigwe@gmail.com>
Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
	Jes.Sorensen@redhat.com, linux-wireless@vger.kernel.org,
	Larry.Finger@lwfinger.net
Subject: Re: [PATCH] staging:rtl8723au: Fix sparse warning cast to restricted __le16
Date: Mon, 17 Nov 2014 20:06:51 -0800	[thread overview]
Message-ID: <20141118040651.GA5130@kroah.com> (raw)
In-Reply-To: <20141118025144.GA1041@Tobenna-Peter-Igwes-MacBook-Pro.local>

On Tue, Nov 18, 2014 at 02:51:45AM +0000, Tobenna Peter, Igwe wrote:
> On Mon, Nov 17, 2014 at 05:59:47PM -0800, Greg KH wrote:
> > On Tue, Nov 18, 2014 at 01:45:41AM +0000, Tobenna P. Igwe wrote:
> > > This patch fixes the following sparse warning:
> > > 
> > > drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c:343:36: warning:
> > > cast to restricted __le16
> > > 
> > > by using the le16_to_cpus function.
> > > 
> > > Signed-off-by: Tobenna P. Igwe <ptigwe@gmail.com>
> > > ---
> > >  drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c |    2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
> > > index d80ea4e..78665ee 100644
> > > --- a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
> > > +++ b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
> > > @@ -340,7 +340,7 @@ static u8 bthci_GetAssocInfo(struct rtw_adapter *padapter, u8 EntryNum)
> > >  			tempBuf, TotalLen-BaseMemoryShift);
> > >  
> > >  		pAmpAsoc = (struct amp_assoc_structure *)tempBuf;
> > > -		pAmpAsoc->Length = le16_to_cpu(pAmpAsoc->Length);
> > > +		le16_to_cpus(&pAmpAsoc->Length);
> > 
> > This doesn't change the logic, and you should still have the same
> > warning.  How about fixing up Length to be the proper endian type?
> > 
> > thanks,
> > 
> > greg k-h
> 
> I've checked and sparse doesn't return the warning anymore. Also, I
> backtracked through the file and Length seems to be set to its
> correct endian type. The reason for the conversion is tempBuf being
> an array of 'u8'.

Ah, that makes sense, ok, I'll queue this up in a few days when I get a
chance.

thanks,

greg k-h

  reply	other threads:[~2014-11-18  4:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-18  1:45 [PATCH] staging:rtl8723au: Fix sparse warning cast to restricted __le16 Tobenna P. Igwe
2014-11-18  1:59 ` Greg KH
2014-11-18  2:51   ` Tobenna Peter, Igwe
2014-11-18  4:06     ` Greg KH [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-03-11 17:21 [PATCH] staging: rtl8723au: " Marcus Folkesson
2015-03-11 18:23 ` Jes Sorensen
2015-08-06 11:21 [PATCH] staging: rtl8723au: Fix sparse warning: " Johannes Postma
2015-08-06 12:21 ` Jes Sorensen
2015-08-07  8:37   ` Johannes Postma
2015-08-07 12:26     ` Jes Sorensen
2015-08-07 13:08       ` Johannes Postma

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=20141118040651.GA5130@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Jes.Sorensen@redhat.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=ptigwe@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.