Commit 49ce1b1f authored by Rebecca Mckeever's avatar Rebecca Mckeever Committed by Greg Kroah-Hartman

staging: rtl8192u: replace ternary statement with if and assignment

Replace ternary statement with an if statement followed by an assignment
to increase readability and make error handling more obvious.
Found with minmax coccinelle script.
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarRebecca Mckeever <remckee0@gmail.com>
Link: https://lore.kernel.org/r/36059ec66a2f3d58a8e339aa4f262772eabd3ef0.1649378587.git.remckee0@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bc4f661a
...@@ -470,7 +470,9 @@ int ieee80211_wx_get_encode(struct ieee80211_device *ieee, ...@@ -470,7 +470,9 @@ int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
return 0; return 0;
} }
len = crypt->ops->get_key(keybuf, SCM_KEY_LEN, NULL, crypt->priv); len = crypt->ops->get_key(keybuf, SCM_KEY_LEN, NULL, crypt->priv);
erq->length = (len >= 0 ? len : 0); if (len < 0)
len = 0;
erq->length = len;
erq->flags |= IW_ENCODE_ENABLED; erq->flags |= IW_ENCODE_ENABLED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment