staging: rtl8188eu: simplify rtw_cmd_thread's main loop
authorMartin Kaiser <martin@kaiser.cx>
Thu, 8 Apr 2021 19:56:01 +0000 (21:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Apr 2021 14:17:24 +0000 (16:17 +0200)
commite28a09fc0b9d25cd3dbf662f5aed9e59892899da
tree7b144a87c343cff58c59787b8d98a10314210042
parent92d056d6cb023184312837116f65887407defbfe
staging: rtl8188eu: simplify rtw_cmd_thread's main loop

In rtw_cmd_thread's main loop, we wait until there's a command in the
queue. To skip this wait statement in subsequent iterations, the driver
uses a label and goto instead of the actual loop. We only get back to the
initial wait if the queue is empty when we read it.

Basically, all we want to do is check if there's a command in the queue.
If yes, we process it. If not, we wait until someone enqueues a command.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210408195601.4762-12-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_cmd.c