staging: wilc1000: fix return type of wilc_send_config_pkt
PATCH 1/3 staging: wilc1000: fix return type of wilc_send_config_pkt
wilc_send_config_pkt is returned to 0 or -ETIMEDOUT according to return value of wilc_wlan_cfg_get and wilc_wlan_cfg_set functions. It is better to use int type in order to represent linux standard error code.
--- drivers/staging/wilc1000/coreconfigurator.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/staging/wilc1000/coreconfigurator.c +3 -2
@@ -588,10 +588,11 @@ s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *pstrConnectRespInfo)* @date 1 Mar 2012 * @version 1.0 */ -s32 wilc_send_config_pkt (struct wilc *wilc,u8 mode,struct wid *wids, +int wilc_send_config_pkt (struct wilc *wilc,u8 mode,struct wid *wids,u32 count,u32 drv) { -s32 counter =0 , ret =0 ; +s32 counter =0 ; +int ret =0 ;if (mode ==GET_CFG ) {for (counter =0 ; counter < count; counter++) {
Signature · 1 line
2.6.4
PATCH 2/3 staging: wilc1000: remove redundant initialization for counter variable
There is no need to set counter variable to 0 because it is initialized in next for-loop statement. So, just delete it.
--- drivers/staging/wilc1000/coreconfigurator.c | 1 - 1 file changed, 1 deletion(-)
drivers/staging/wilc1000/coreconfigurator.c +0 -1
@@ -607,7 +607,6 @@ int wilc_send_config_pkt(struct wilc *wilc, u8 mode, struct wid *wids,break ; } } - counter =0 ;for (counter =0 ; counter < count; counter++) { wids[counter].size = wilc_wlan_cfg_get_val( wids[counter].id,
Signature · 1 line
2.6.4
PATCH 3/3 staging: wilc1000: use int type for counter variable
In reply to Chaehyun Limcounter is used as for-loop control variable and indicating index of struct wid array so that it is better to use int type. There is no need to set to 0 when it is declared at the top of this function. counter is initialized as 0 in for-loop statement.
--- drivers/staging/wilc1000/coreconfigurator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/coreconfigurator.c +1 -1
@@ -591,7 +591,7 @@ s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *pstrConnectRespInfo)int wilc_send_config_pkt (struct wilc *wilc,u8 mode,struct wid *wids,u32 count,u32 drv) { -s32 counter =0 ; +int counter;int ret =0 ;if (mode ==GET_CFG ) {
Signature · 1 line
2.6.4
Re: [PATCH 3/3] staging: wilc1000: use int type for counter variable
Quoted 15 lines · Chaehyun Lim
counter is used as for-loop control variable and indicating index of struct wid array so that it is better to use int type. There is no need to set to 0 when it is declared at the top of this function. counter is initialized as 0 in for-loop statement.
Signed-off-by Chaehyun Lim <[email protected]>--- drivers/staging/wilc1000/coreconfigurator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/wilc1000/coreconfigurator.c +0
-0
drivers/staging/wilc1000/coreconfigurator.c s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *pstrConnectRespInfo) · line 594
Quoted 5 lines
drivers/staging/wilc1000/coreconfigurator.c +1
-1@@ -591,7 +591,7 @@ s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *pstrConnectRespInfo)int wilc_send_config_pkt (struct wilc *wilc,u8 mode,struct wid *wids,u32 count,u32 drv) { -s32 counter =0 ; +int counter;
rename it to "i" as well. "int i;"
regards,
dan carpenter