diff options
author | Mateusz Kulikowski <mateusz.kulikowski@gmail.com> | 2015-05-31 20:19:46 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-06-01 06:33:22 +0900 |
commit | a5c06ad83bf444dc3219460820bdcd4707dc4c9a (patch) | |
tree | a105bc1a72077126c54d9b924c741b6dcfe29466 | |
parent | a94aa9adb6fe79ddb9181bddd34ade3e8718c582 (diff) | |
download | linux-a5c06ad83bf444dc3219460820bdcd4707dc4c9a.tar.bz2 |
staging: rtl8192e: Replace ?: with min_t
Replace :? with min_t for readability. Remove check that is always false.
Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_softmac_wx.c | 8 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_wx.c | 3 |
2 files changed, 2 insertions, 9 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index d5e13a57ab7a..86f52ac7d33e 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -454,13 +454,7 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee, proto_started = ieee->proto_started; - len = (wrqu->essid.length < IW_ESSID_MAX_SIZE) ? wrqu->essid.length : - IW_ESSID_MAX_SIZE; - - if (len > IW_ESSID_MAX_SIZE) { - ret = -E2BIG; - goto out; - } + len = min_t(__u16, wrqu->essid.length, IW_ESSID_MAX_SIZE); if (ieee->iw_mode == IW_MODE_MONITOR) { ret = -1; diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c index 2812a777d0f1..2ac161786796 100644 --- a/drivers/staging/rtl8192e/rtllib_wx.c +++ b/drivers/staging/rtl8192e/rtllib_wx.c @@ -851,8 +851,7 @@ int rtllib_wx_set_gen_ie(struct rtllib_device *ieee, u8 *ie, size_t len) if ((eid == MFIE_TYPE_GENERIC) && (!memcmp(&ie[2], wps_oui, 4))) { - ieee->wps_ie_len = (len < MAX_WZC_IE_LEN) ? (len) : - (MAX_WZC_IE_LEN); + ieee->wps_ie_len = min_t(size_t, len, MAX_WZC_IE_LEN); buf = kmemdup(ie, ieee->wps_ie_len, GFP_KERNEL); if (buf == NULL) return -ENOMEM; |