Skip to content

Commit

Permalink
staging: rtl8192e: Replace ?: with min_t
Browse files Browse the repository at this point in the history
Replace :? with min_t for readability. Remove check that is always false.

Signed-off-by: Mateusz Kulikowski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
hallor authored and gregkh committed May 31, 2015
1 parent a94aa9a commit a5c06ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
8 changes: 1 addition & 7 deletions drivers/staging/rtl8192e/rtllib_softmac_wx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions drivers/staging/rtl8192e/rtllib_wx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a5c06ad

Please sign in to comment.