* [PATCH 1/3] staging: wilc1000: fix return type of wilc_send_config_pkt
@ 2016-01-19 10:26 Chaehyun Lim
2016-01-19 10:26 ` [PATCH 2/3] staging: wilc1000: remove redundant initialization for counter variable Chaehyun Lim
2016-01-19 10:26 ` [PATCH 3/3] staging: wilc1000: use int type " Chaehyun Lim
0 siblings, 2 replies; 4+ messages in thread
From: Chaehyun Lim @ 2016-01-19 10:26 UTC (permalink / raw)
To: gregkh
Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
linux-wireless, devel, Chaehyun Lim
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.
Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
drivers/staging/wilc1000/coreconfigurator.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 2d4d3f1..ee9f91f 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -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++) {
--
2.6.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] staging: wilc1000: remove redundant initialization for counter variable
2016-01-19 10:26 [PATCH 1/3] staging: wilc1000: fix return type of wilc_send_config_pkt Chaehyun Lim
@ 2016-01-19 10:26 ` Chaehyun Lim
2016-01-19 10:26 ` [PATCH 3/3] staging: wilc1000: use int type " Chaehyun Lim
1 sibling, 0 replies; 4+ messages in thread
From: Chaehyun Lim @ 2016-01-19 10:26 UTC (permalink / raw)
To: gregkh
Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
linux-wireless, devel, Chaehyun Lim
There is no need to set counter variable to 0 because it is initialized
in next for-loop statement. So, just delete it.
Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
drivers/staging/wilc1000/coreconfigurator.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index ee9f91f..86dfe77 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -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,
--
2.6.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] staging: wilc1000: use int type for counter variable
2016-01-19 10:26 [PATCH 1/3] staging: wilc1000: fix return type of wilc_send_config_pkt Chaehyun Lim
2016-01-19 10:26 ` [PATCH 2/3] staging: wilc1000: remove redundant initialization for counter variable Chaehyun Lim
@ 2016-01-19 10:26 ` Chaehyun Lim
2016-01-19 11:30 ` Dan Carpenter
1 sibling, 1 reply; 4+ messages in thread
From: Chaehyun Lim @ 2016-01-19 10:26 UTC (permalink / raw)
To: gregkh
Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
linux-wireless, devel, 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 <chaehyun.lim@gmail.com>
---
drivers/staging/wilc1000/coreconfigurator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 86dfe77..7e8e423 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -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) {
--
2.6.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 3/3] staging: wilc1000: use int type for counter variable
2016-01-19 10:26 ` [PATCH 3/3] staging: wilc1000: use int type " Chaehyun Lim
@ 2016-01-19 11:30 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2016-01-19 11:30 UTC (permalink / raw)
To: Chaehyun Lim
Cc: gregkh, devel, chris.park, austin.shin, linux-wireless,
johnny.kim, tony.cho, leo.kim
On Tue, Jan 19, 2016 at 07:26:17PM +0900, Chaehyun Lim wrote:
> 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 <chaehyun.lim@gmail.com>
> ---
> drivers/staging/wilc1000/coreconfigurator.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
> index 86dfe77..7e8e423 100644
> --- a/drivers/staging/wilc1000/coreconfigurator.c
> +++ b/drivers/staging/wilc1000/coreconfigurator.c
> @@ -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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-01-19 12:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-19 10:26 [PATCH 1/3] staging: wilc1000: fix return type of wilc_send_config_pkt Chaehyun Lim
2016-01-19 10:26 ` [PATCH 2/3] staging: wilc1000: remove redundant initialization for counter variable Chaehyun Lim
2016-01-19 10:26 ` [PATCH 3/3] staging: wilc1000: use int type " Chaehyun Lim
2016-01-19 11:30 ` Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.