staging: rtl8188eu: remove dead code/vestigial do..while loop
authorConnor Kuehl <connor.kuehl@canonical.com>
Tue, 24 Sep 2019 14:28:19 +0000 (07:28 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 Sep 2019 19:58:01 +0000 (21:58 +0200)
commit43821e36e5fcbc5ded28ce80290aff20445bd166
tree17d89e124e8f169f6937ee206c80722fd2d5e0a0
parent01b16aed578a0302672e7a4c2a778fef2472b29e
staging: rtl8188eu: remove dead code/vestigial do..while loop

The local variable 'bcmd_down' is always set to true almost immediately
before the do-while's condition is checked. As a result, !bcmd_down
evaluates to false which short circuits the logical AND operator meaning
that the second operand is never reached and is therefore dead code.

Furthermore, the do..while loop may be removed since it will always only
execute once because 'bcmd_down' is always set to true, so the
!bcmd_down evaluates to false and the loop exits immediately after the
first pass.

Fix this by removing the loop and its condition variables 'bcmd_down'
and 'retry_cnts'

While we're in there, also fix some checkpatch.pl suggestions regarding
spaces around arithmetic operators like '+'

Addresses-Coverity: ("Logically dead code")

Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Link: https://lore.kernel.org/r/20190924142819.5243-1-connor.kuehl@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c