OSDN Git Service

staging: ks7010: refactor ks_wlan_set_encode function
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Thu, 19 Apr 2018 05:07:58 +0000 (07:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Apr 2018 12:32:04 +0000 (14:32 +0200)
commit6cf070d231d82d31248dfd204260ba8817f72d43
treef73eed2ed0c6e38e1597d1c42e46f0c8c191f7f6
parentfffe8becb7cf67c78f954721689e6906cc936c68
staging: ks7010: refactor ks_wlan_set_encode function

This commit refactors ks_wlan_set_encode function to improve
readability. It just removes level indentation in some paths
as well as removes not needed conditions paths which was
checked before. Changes are as follows:

 - (dwrq->length > MAX_KEY_SIZE) check has been moved to the top.
 - extra check about (dwrq->length > 0) inside an if block where
   that was the condition to enter inside it has been removed.
 - (dwrq->flags & IW_ENCODE_NOKEY) check has been turned to avoid
   one level indentation.
 - extra check (index >= 0) && (index < 4) has been removed. In
   the top of the file invalid index values are being checked
   so it has no sense to check that again.
 - remove commented line.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks_wlan_net.c