Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 622fd494 authored by Mateusz Kulikowski's avatar Mateusz Kulikowski Committed by Greg Kroah-Hartman
Browse files

staging: rtl8192e: Replace ?: with max



All get_key implementations return either -1 or small buffers, so
cast int->u16 is not a problem.

Signed-off-by: default avatarMateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a5c06ad8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;