[PATCH] staging: rtl8192e: fix wrong assignment
Gujulan Elango, Hari Prasath (H.)
hgujulan at visteon.com
Mon May 4 09:17:55 UTC 2015
On Fri, May 01, 2015 at 10:46:53AM +0300, Dan Carpenter wrote:
> The subject says "fix" but this does not fix a run time bug, it just
> silences a warning. It's still the correct thing according to Larry
> so that's good.
>
> On Thu, Apr 30, 2015 at 12:06:28PM +0000, Gujulan Elango, Hari Prasath (H.) wrote:
> > This patch addresses a spatch warning on assigning a negative
> > value to a unsigned integer.
>
> It's not an unsigned integer, it's an u8.
>
> > Similar patch has been submitted by
> > Larry Finger earlier to silence the same spatch warning in another
> > file.
>
> A similar warning but a totally different patch.
>
> > diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> > index 352d381..41d2f3f 100644
> > --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> > +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
> > @@ -2310,7 +2310,7 @@ static void rtl8192_rx_normal(struct net_device *dev)
> >
> > struct rtllib_rx_stats stats = {
> > .signal = 0,
> > - .noise = -98,
> > + .noise = 158, /*-98 -dBm*/
>
> Let's just do this:
>
> .noise = (u8) -98,
>
> That way it silences the warning and we don't need the comment.
>
> regards,
> dan carpenter
>
I am sending version 2 of this patch with the above said changes for
review.
thanks
hari prasath
More information about the devel
mailing list