Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1590953

Re: [Outreachy kernel] [PATCH 1/6] staging: wlan-ng: Fix sparse warning of restricted __le16

Path csiph.com!goblin3!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!bofh.it!news.nic.it!robomod
From Julia Lawall <julia.lawall@lip6.fr>
Newsgroups linux.kernel
Subject Re: [Outreachy kernel] [PATCH 1/6] staging: wlan-ng: Fix sparse warning of restricted __le16
Date Thu, 02 Mar 2017 11:00:02 +0100
Message-ID <tgvGG-sV-7@gated-at.bofh.it> (permalink)
References <tgvGG-sV-9@gated-at.bofh.it> <tgvGG-sV-11@gated-at.bofh.it>
X-Original-To simran singhal <singhalsimran0@gmail.com>
X-Ironport-Av E=Sophos;i="5.35,230,1484002800"; d="scan'208";a="262784668"
X-X-Sender jll@hadrien
User-Agent Alpine 2.20 (DEB 67 2015-01-07)
MIME-Version 1.0
Content-Type text/plain; charset=US-ASCII
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 142
Organization linux.* mail to news gateway
X-Original-Cc gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, sergio.paracuellos@gmail.com, juliana.orod@gmail.com, thomas.petazzoni@free-electrons.com, noralf@tronnes.org, outreachy-kernel@googlegroups.com
X-Original-Date Thu, 2 Mar 2017 10:50:26 +0100 (CET)
X-Original-Message-ID <alpine.DEB.2.20.1703021050020.3414@hadrien>
X-Original-References <1488448146-29452-1-git-send-email-singhalsimran0@gmail.com> <alpine.DEB.2.20.1703021047350.3414@hadrien>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1590953

Show key headers only | View raw



On Thu, 2 Mar 2017, Julia Lawall wrote:

>
>
> On Thu, 2 Mar 2017, simran singhal wrote:
>
> > This patch fixes the following sparse warning:
> > warning: cast to restricted __le16
>
> You commit message should not say just fix X.  What have you done to carry
> out the fix and why is this the correct approach?

This comment applies to all of the patches in the series.

julia

>
> julia
>
> >
> > Signed-off-by: simran singhal <singhalsimran0@gmail.com>
> > ---
> >  drivers/staging/wlan-ng/prism2sta.c | 51 ++++++++++++++++++-------------------
> >  1 file changed, 25 insertions(+), 26 deletions(-)
> >
> > diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c
> > index 984804b..82d3a70 100644
> > --- a/drivers/staging/wlan-ng/prism2sta.c
> > +++ b/drivers/staging/wlan-ng/prism2sta.c
> > @@ -372,10 +372,9 @@ static int prism2sta_mlmerequest(struct wlandevice *wlandev,
> >  			qualmsg->noise.status =
> >  			    P80211ENUM_msgitem_status_data_ok;
> >
> > -			qualmsg->link.data = le16_to_cpu(hw->qual.cq_curr_bss);
> > -			qualmsg->level.data =
> > -				le16_to_cpu(hw->qual.asl_curr_bss);
> > -			qualmsg->noise.data = le16_to_cpu(hw->qual.anl_curr_fc);
> > +			qualmsg->link.data = hw->qual.cq_curr_bss;
> > +			qualmsg->level.data = hw->qual.asl_curr_bss;
> > +			qualmsg->noise.data = hw->qual.anl_curr_fc;
> >  			qualmsg->txrate.data = hw->txrate;
> >
> >  			break;
> > @@ -603,10 +602,10 @@ static int prism2sta_getcardinfo(struct wlandevice *wlandev)
> >  	}
> >
> >  	/* get all the nic id fields in host byte order */
> > -	hw->ident_nic.id = le16_to_cpu(hw->ident_nic.id);
> > -	hw->ident_nic.variant = le16_to_cpu(hw->ident_nic.variant);
> > -	hw->ident_nic.major = le16_to_cpu(hw->ident_nic.major);
> > -	hw->ident_nic.minor = le16_to_cpu(hw->ident_nic.minor);
> > +	hw->ident_nic.id = hw->ident_nic.id;
> > +	hw->ident_nic.variant = hw->ident_nic.variant;
> > +	hw->ident_nic.major = hw->ident_nic.major;
> > +	hw->ident_nic.minor = hw->ident_nic.minor;
> >
> >  	netdev_info(wlandev->netdev, "ident: nic h/w: id=0x%02x %d.%d.%d\n",
> >  		    hw->ident_nic.id, hw->ident_nic.major,
> > @@ -622,10 +621,10 @@ static int prism2sta_getcardinfo(struct wlandevice *wlandev)
> >  	}
> >
> >  	/* get all the private fw id fields in host byte order */
> > -	hw->ident_pri_fw.id = le16_to_cpu(hw->ident_pri_fw.id);
> > -	hw->ident_pri_fw.variant = le16_to_cpu(hw->ident_pri_fw.variant);
> > -	hw->ident_pri_fw.major = le16_to_cpu(hw->ident_pri_fw.major);
> > -	hw->ident_pri_fw.minor = le16_to_cpu(hw->ident_pri_fw.minor);
> > +	hw->ident_pri_fw.id = hw->ident_pri_fw.id;
> > +	hw->ident_pri_fw.variant = hw->ident_pri_fw.variant;
> > +	hw->ident_pri_fw.major = hw->ident_pri_fw.major;
> > +	hw->ident_pri_fw.minor = hw->ident_pri_fw.minor;
> >
> >  	netdev_info(wlandev->netdev, "ident: pri f/w: id=0x%02x %d.%d.%d\n",
> >  		    hw->ident_pri_fw.id, hw->ident_pri_fw.major,
> > @@ -648,10 +647,10 @@ static int prism2sta_getcardinfo(struct wlandevice *wlandev)
> >  	}
> >
> >  	/* get all the station fw id fields in host byte order */
> > -	hw->ident_sta_fw.id = le16_to_cpu(hw->ident_sta_fw.id);
> > -	hw->ident_sta_fw.variant = le16_to_cpu(hw->ident_sta_fw.variant);
> > -	hw->ident_sta_fw.major = le16_to_cpu(hw->ident_sta_fw.major);
> > -	hw->ident_sta_fw.minor = le16_to_cpu(hw->ident_sta_fw.minor);
> > +	hw->ident_sta_fw.id = hw->ident_sta_fw.id;
> > +	hw->ident_sta_fw.variant = hw->ident_sta_fw.variant;
> > +	hw->ident_sta_fw.major = hw->ident_sta_fw.major;
> > +	hw->ident_sta_fw.minor = hw->ident_sta_fw.minor;
> >
> >  	/* strip out the 'special' variant bits */
> >  	hw->mm_mods = hw->ident_sta_fw.variant & GENMASK(15, 14);
> > @@ -683,11 +682,11 @@ static int prism2sta_getcardinfo(struct wlandevice *wlandev)
> >  	/* get all the Compatibility range, modem interface supplier
> >  	 * fields in byte order
> >  	 */
> > -	hw->cap_sup_mfi.role = le16_to_cpu(hw->cap_sup_mfi.role);
> > -	hw->cap_sup_mfi.id = le16_to_cpu(hw->cap_sup_mfi.id);
> > -	hw->cap_sup_mfi.variant = le16_to_cpu(hw->cap_sup_mfi.variant);
> > -	hw->cap_sup_mfi.bottom = le16_to_cpu(hw->cap_sup_mfi.bottom);
> > -	hw->cap_sup_mfi.top = le16_to_cpu(hw->cap_sup_mfi.top);
> > +	hw->cap_sup_mfi.role = hw->cap_sup_mfi.role;
> > +	hw->cap_sup_mfi.id = hw->cap_sup_mfi.id;
> > +	hw->cap_sup_mfi.variant = hw->cap_sup_mfi.variant;
> > +	hw->cap_sup_mfi.bottom = hw->cap_sup_mfi.bottom;
> > +	hw->cap_sup_mfi.top = hw->cap_sup_mfi.top;
> >
> >  	netdev_info(wlandev->netdev,
> >  		    "MFI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
> > @@ -707,11 +706,11 @@ static int prism2sta_getcardinfo(struct wlandevice *wlandev)
> >  	/* get all the Compatibility range, controller interface supplier
> >  	 * fields in byte order
> >  	 */
> > -	hw->cap_sup_cfi.role = le16_to_cpu(hw->cap_sup_cfi.role);
> > -	hw->cap_sup_cfi.id = le16_to_cpu(hw->cap_sup_cfi.id);
> > -	hw->cap_sup_cfi.variant = le16_to_cpu(hw->cap_sup_cfi.variant);
> > -	hw->cap_sup_cfi.bottom = le16_to_cpu(hw->cap_sup_cfi.bottom);
> > -	hw->cap_sup_cfi.top = le16_to_cpu(hw->cap_sup_cfi.top);
> > +	hw->cap_sup_cfi.role = hw->cap_sup_cfi.role;
> > +	hw->cap_sup_cfi.id = hw->cap_sup_cfi.id;
> > +	hw->cap_sup_cfi.variant = hw->cap_sup_cfi.variant;
> > +	hw->cap_sup_cfi.bottom = hw->cap_sup_cfi.bottom;
> > +	hw->cap_sup_cfi.top = hw->cap_sup_cfi.top;
> >
> >  	netdev_info(wlandev->netdev,
> >  		    "CFI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n",
> > --
> > 2.7.4
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1488448146-29452-1-git-send-email-singhalsimran0%40gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/alpine.DEB.2.20.1703021047350.3414%40hadrien.
> For more options, visit https://groups.google.com/d/optout.
>

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: [Outreachy kernel] [PATCH 1/6] staging: wlan-ng: Fix sparse  warning of restricted __le16 Julia Lawall <julia.lawall@lip6.fr> - 2017-03-02 11:00 +0100
  Re: [Outreachy kernel] [PATCH 1/6] staging: wlan-ng: Fix sparse  warning of restricted __le16 Julia Lawall <julia.lawall@lip6.fr> - 2017-03-02 12:20 +0100
    Re: [Outreachy kernel] [PATCH 1/6] staging: wlan-ng: Fix sparse  warning of restricted __le16 Alison Schofield <amsfield22@gmail.com> - 2017-03-02 18:40 +0100
  Re: [Outreachy kernel] [PATCH 1/6] staging: wlan-ng: Fix sparse  warning of restricted __le16 SIMRAN SINGHAL <singhalsimran0@gmail.com> - 2017-03-02 13:10 +0100

csiph-web