staging: r8188eu: Fix while-loop that iterates only once
authorColin Ian King <colin.king@canonical.com>
Wed, 30 Jun 2021 06:56:47 +0000 (07:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Jul 2021 08:20:05 +0000 (10:20 +0200)
commitf0deefa679af621c51453b114b6977151b62cd39
tree528a0def0c9b307bca3853fcc9073e0368d0a5eb
parente7ca5907d1e00dfa639cae8864db56eca906738d
staging: r8188eu: Fix while-loop that iterates only once

The while-loop only iterates once becase the post increment test of count
being non-zero is false on the first iteration because count is zero. Fix
this by using a for-loop instead. Static analysis found the issue on the
count > POLLING_LLT_THRESHOLD check always being false since the loop
currently just iterates once.

Thanks to David Laight for suggesting using for-loop instead to improve
the readability of the fix.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210630065647.5641-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c