Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: rtl8712: r8712_set_auth(): Change return values

Change return values of r8712_set_auth from _SUCCESS/_FAIL to 0/-ENOMEM
respectively. Modify call site accordingly. Also change return type of
the function from sint to int.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190722092341.21030-2-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Nishka Dasgupta and committed by
Greg Kroah-Hartman
33972d48 3e67274a

+10 -10
+3 -3
drivers/staging/rtl8712/rtl871x_ioctl_set.c
··· 320 320 psecuritypriv->ndisauthtype = authmode; 321 321 if (psecuritypriv->ndisauthtype > 3) 322 322 psecuritypriv->AuthAlgrthm = 2; /* 802.1x */ 323 - if (r8712_set_auth(padapter, psecuritypriv) == _SUCCESS) 324 - ret = true; 325 - else 323 + if (r8712_set_auth(padapter, psecuritypriv)) 326 324 ret = false; 325 + else 326 + ret = true; 327 327 return ret; 328 328 } 329 329
+5 -5
drivers/staging/rtl8712/rtl871x_mlme.c
··· 1144 1144 return r8712_joinbss_cmd(adapter, pnetwork); 1145 1145 } 1146 1146 1147 - sint r8712_set_auth(struct _adapter *adapter, 1148 - struct security_priv *psecuritypriv) 1147 + int r8712_set_auth(struct _adapter *adapter, 1148 + struct security_priv *psecuritypriv) 1149 1149 { 1150 1150 struct cmd_priv *pcmdpriv = &adapter->cmdpriv; 1151 1151 struct cmd_obj *pcmd; ··· 1153 1153 1154 1154 pcmd = kmalloc(sizeof(*pcmd), GFP_ATOMIC); 1155 1155 if (!pcmd) 1156 - return _FAIL; 1156 + return -ENOMEM; 1157 1157 1158 1158 psetauthparm = kzalloc(sizeof(*psetauthparm), GFP_ATOMIC); 1159 1159 if (!psetauthparm) { 1160 1160 kfree(pcmd); 1161 - return _FAIL; 1161 + return -ENOMEM; 1162 1162 } 1163 1163 psetauthparm->mode = (u8)psecuritypriv->AuthAlgrthm; 1164 1164 pcmd->cmdcode = _SetAuth_CMD_; ··· 1168 1168 pcmd->rspsz = 0; 1169 1169 INIT_LIST_HEAD(&pcmd->list); 1170 1170 r8712_enqueue_cmd(pcmdpriv, pcmd); 1171 - return _SUCCESS; 1171 + return 0; 1172 1172 } 1173 1173 1174 1174 sint r8712_set_key(struct _adapter *adapter,
+2 -2
drivers/staging/rtl8712/rtl871x_mlme.h
··· 175 175 int r8712_select_and_join_from_scan(struct mlme_priv *pmlmepriv); 176 176 sint r8712_set_key(struct _adapter *adapter, 177 177 struct security_priv *psecuritypriv, sint keyid); 178 - sint r8712_set_auth(struct _adapter *adapter, 179 - struct security_priv *psecuritypriv); 178 + int r8712_set_auth(struct _adapter *adapter, 179 + struct security_priv *psecuritypriv); 180 180 uint r8712_get_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss); 181 181 void r8712_generate_random_ibss(u8 *pibss); 182 182 u8 *r8712_get_capability_from_ie(u8 *ie);