Re: [PATCH] staging: rtl8192e: fix wrong assignment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux