staging: rtl8192e: Replace ?: with max
authorMateusz Kulikowski <mateusz.kulikowski@gmail.com>
Sun, 31 May 2015 18:19:47 +0000 (20:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 31 May 2015 21:33:22 +0000 (06:33 +0900)
All get_key implementations return either -1 or small buffers, so
cast int->u16 is not a problem.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtllib_wx.c

index 2ac1617..f31d864 100644 (file)
@@ -510,7 +510,8 @@ int rtllib_wx_get_encode(struct rtllib_device *ieee,
                return 0;
        }
        len = crypt->ops->get_key(keybuf, SCM_KEY_LEN, NULL, crypt->priv);
-       erq->length = (len >= 0 ? len : 0);
+
+       erq->length = max(len, 0);
 
        erq->flags |= IW_ENCODE_ENABLED;