Re: [PATCH 03/11] staging: rtl8188eu: traversal order of the 'remain' variable values inverted

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

 



On Wed, Nov 04, 2015 at 10:12:51AM +0700, Ivan Safonov wrote:
> The number of the loop passes has not changed.
> 
> Signed-off-by: Ivan Safonov <insafonov@xxxxxxxxx>
> ---
>  drivers/staging/rtl8188eu/hal/fw.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8188eu/hal/fw.c b/drivers/staging/rtl8188eu/hal/fw.c
> index 6d6dd15..9cd898c 100644
> --- a/drivers/staging/rtl8188eu/hal/fw.c
> +++ b/drivers/staging/rtl8188eu/hal/fw.c
> @@ -89,7 +89,7 @@ static void _rtl88e_fill_dummy(u8 *pfwbuf, u32 *pfwlen)
>  	remain = (remain == 0) ? 0 : (4 - remain);
>  	n = remain;
>  
> -	for (; remain > 0; fwlen++, remain--) {
> +	for (remain = 0; remain < n; fwlen++, remain++) {

We are using the "remain" variable for a couple different things.  It
should only hold the remaining number of array elements.  It's shouldn't
be the iterator as well.

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