* [PATCH 1/8] staging: wilc1000: fix return type of wilc_hif_set_cfg
@ 2016-02-05 1:35 Chaehyun Lim
2016-02-05 1:35 ` [PATCH 2/8] staging: wilc1000: rename pstrCfgParamVal in wilc_hif_set_cfg Chaehyun Lim
` (6 more replies)
0 siblings, 7 replies; 9+ messages in thread
From: Chaehyun Lim @ 2016-02-05 1:35 UTC (permalink / raw)
To: gregkh
Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
linux-wireless, devel, Chaehyun Lim
This patch changes return type of wilc_hif_set_cfg from s32 to int.
The result variable gets return value from wilc_mq_send that has data
type of int. It should be changed return type of this function as well
as data type of result variable.
Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
drivers/staging/wilc1000/host_interface.c | 4 ++--
drivers/staging/wilc1000/host_interface.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index d77e2b2..a5b7dd1 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3729,10 +3729,10 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
return result;
}
-s32 wilc_hif_set_cfg(struct wilc_vif *vif,
+int wilc_hif_set_cfg(struct wilc_vif *vif,
struct cfg_param_val *pstrCfgParamVal)
{
- s32 result = 0;
+ int result = 0;
struct host_if_msg msg;
struct host_if_drv *hif_drv = vif->hif_drv;
diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h
index 4c02e6b..fe32a9a 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -339,7 +339,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
u8 *ch_freq_list, u8 ch_list_len, const u8 *ies,
size_t ies_len, wilc_scan_result scan_result, void *user_arg,
struct hidden_network *hidden_network);
-s32 wilc_hif_set_cfg(struct wilc_vif *vif,
+int wilc_hif_set_cfg(struct wilc_vif *vif,
struct cfg_param_val *pstrCfgParamVal);
int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler);
s32 wilc_deinit(struct wilc_vif *vif);
--
2.7.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/8] staging: wilc1000: rename pstrCfgParamVal in wilc_hif_set_cfg
2016-02-05 1:35 [PATCH 1/8] staging: wilc1000: fix return type of wilc_hif_set_cfg Chaehyun Lim
@ 2016-02-05 1:35 ` Chaehyun Lim
2016-02-05 1:35 ` [PATCH 3/8] staging: wilc1000: fix return type of wilc_deinit Chaehyun Lim
` (5 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Chaehyun Lim @ 2016-02-05 1:35 UTC (permalink / raw)
To: gregkh
Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
linux-wireless, devel, Chaehyun Lim
This patch renames pstrCfgParamVal to cfg_param to avoid camelcase.
Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
drivers/staging/wilc1000/host_interface.c | 4 ++--
drivers/staging/wilc1000/host_interface.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index a5b7dd1..0f8175f 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3730,7 +3730,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
}
int wilc_hif_set_cfg(struct wilc_vif *vif,
- struct cfg_param_val *pstrCfgParamVal)
+ struct cfg_param_val *cfg_param)
{
int result = 0;
struct host_if_msg msg;
@@ -3743,7 +3743,7 @@ int wilc_hif_set_cfg(struct wilc_vif *vif,
memset(&msg, 0, sizeof(struct host_if_msg));
msg.id = HOST_IF_MSG_CFG_PARAMS;
- msg.body.cfg_info.cfg_attr_info = *pstrCfgParamVal;
+ msg.body.cfg_info.cfg_attr_info = *cfg_param;
msg.vif = vif;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h
index fe32a9a..4b19bf1 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -340,7 +340,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
size_t ies_len, wilc_scan_result scan_result, void *user_arg,
struct hidden_network *hidden_network);
int wilc_hif_set_cfg(struct wilc_vif *vif,
- struct cfg_param_val *pstrCfgParamVal);
+ struct cfg_param_val *cfg_param);
int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler);
s32 wilc_deinit(struct wilc_vif *vif);
int wilc_add_beacon(struct wilc_vif *vif, u32 interval, u32 dtim_period,
--
2.7.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/8] staging: wilc1000: fix return type of wilc_deinit
2016-02-05 1:35 [PATCH 1/8] staging: wilc1000: fix return type of wilc_hif_set_cfg Chaehyun Lim
2016-02-05 1:35 ` [PATCH 2/8] staging: wilc1000: rename pstrCfgParamVal in wilc_hif_set_cfg Chaehyun Lim
@ 2016-02-05 1:35 ` Chaehyun Lim
2016-02-05 1:35 ` [PATCH 4/8] staging: wilc1000: fix return error code " Chaehyun Lim
` (4 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Chaehyun Lim @ 2016-02-05 1:35 UTC (permalink / raw)
To: gregkh
Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
linux-wireless, devel, Chaehyun Lim
This patch changes return type of wilc_deinit from s32 to int.
The result variable gets return value from wilc_mq_send that has return
type of int. It should be changed return type of this function as well
as data type of result variable.
Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
drivers/staging/wilc1000/host_interface.c | 4 ++--
drivers/staging/wilc1000/host_interface.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 0f8175f..36eeeb4 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3882,9 +3882,9 @@ _fail_:
return result;
}
-s32 wilc_deinit(struct wilc_vif *vif)
+int wilc_deinit(struct wilc_vif *vif)
{
- s32 result = 0;
+ int result = 0;
struct host_if_msg msg;
struct host_if_drv *hif_drv = vif->hif_drv;
diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h
index 4b19bf1..f4e6839 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -342,7 +342,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
int wilc_hif_set_cfg(struct wilc_vif *vif,
struct cfg_param_val *cfg_param);
int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler);
-s32 wilc_deinit(struct wilc_vif *vif);
+int wilc_deinit(struct wilc_vif *vif);
int wilc_add_beacon(struct wilc_vif *vif, u32 interval, u32 dtim_period,
u32 head_len, u8 *head, u32 tail_len, u8 *tail);
int wilc_del_beacon(struct wilc_vif *vif);
--
2.7.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 4/8] staging: wilc1000: fix return error code of wilc_deinit
2016-02-05 1:35 [PATCH 1/8] staging: wilc1000: fix return type of wilc_hif_set_cfg Chaehyun Lim
2016-02-05 1:35 ` [PATCH 2/8] staging: wilc1000: rename pstrCfgParamVal in wilc_hif_set_cfg Chaehyun Lim
2016-02-05 1:35 ` [PATCH 3/8] staging: wilc1000: fix return type of wilc_deinit Chaehyun Lim
@ 2016-02-05 1:35 ` Chaehyun Lim
2016-02-05 1:35 ` [PATCH 5/8] staging: wilc1000: fix return type of wilc_send_config_pkt Chaehyun Lim
` (3 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Chaehyun Lim @ 2016-02-05 1:35 UTC (permalink / raw)
To: gregkh
Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
linux-wireless, devel, Chaehyun Lim
It should be returned error code as -EFAULT instead of 0 when hif_drv is
NULL.
Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
drivers/staging/wilc1000/host_interface.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 36eeeb4..6c91071 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3890,7 +3890,7 @@ int wilc_deinit(struct wilc_vif *vif)
if (!hif_drv) {
PRINT_ER("hif_drv = NULL\n");
- return 0;
+ return -EFAULT;
}
down(&hif_sema_deinit);
--
2.7.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 5/8] staging: wilc1000: fix return type of wilc_send_config_pkt
2016-02-05 1:35 [PATCH 1/8] staging: wilc1000: fix return type of wilc_hif_set_cfg Chaehyun Lim
` (2 preceding siblings ...)
2016-02-05 1:35 ` [PATCH 4/8] staging: wilc1000: fix return error code " Chaehyun Lim
@ 2016-02-05 1:35 ` Chaehyun Lim
2016-02-07 21:51 ` Greg KH
2016-02-05 1:35 ` [PATCH 6/8] staging: wilc1000: use int type for counter variable Chaehyun Lim
` (2 subsequent siblings)
6 siblings, 1 reply; 9+ messages in thread
From: Chaehyun Lim @ 2016-02-05 1:35 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 0 or -ETIMEDOUT according to return
value of wilc_wlan_cfg_get or wilc_wlan_cfg_set.
It is better to use int type 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 49ae9b1..323a0cd 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -449,10 +449,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.7.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 6/8] staging: wilc1000: use int type for counter variable
2016-02-05 1:35 [PATCH 1/8] staging: wilc1000: fix return type of wilc_hif_set_cfg Chaehyun Lim
` (3 preceding siblings ...)
2016-02-05 1:35 ` [PATCH 5/8] staging: wilc1000: fix return type of wilc_send_config_pkt Chaehyun Lim
@ 2016-02-05 1:35 ` Chaehyun Lim
2016-02-05 1:35 ` [PATCH 7/8] staging: wilc1000: remove initialization code of " Chaehyun Lim
2016-02-05 1:35 ` [PATCH 8/8] staging: wilc1000: rename counter in wilc_send_config_pkt Chaehyun Lim
6 siblings, 0 replies; 9+ messages in thread
From: Chaehyun Lim @ 2016-02-05 1:35 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. It 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 323a0cd..4008872 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -452,7 +452,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.7.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 7/8] staging: wilc1000: remove initialization code of counter variable
2016-02-05 1:35 [PATCH 1/8] staging: wilc1000: fix return type of wilc_hif_set_cfg Chaehyun Lim
` (4 preceding siblings ...)
2016-02-05 1:35 ` [PATCH 6/8] staging: wilc1000: use int type for counter variable Chaehyun Lim
@ 2016-02-05 1:35 ` Chaehyun Lim
2016-02-05 1:35 ` [PATCH 8/8] staging: wilc1000: rename counter in wilc_send_config_pkt Chaehyun Lim
6 siblings, 0 replies; 9+ messages in thread
From: Chaehyun Lim @ 2016-02-05 1:35 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 to 0 for counter variable before entering next
for-loop statement because counter is initialized again in for-loop
statement, so just remove 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 4008872..dda81ee 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -468,7 +468,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.7.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 8/8] staging: wilc1000: rename counter in wilc_send_config_pkt
2016-02-05 1:35 [PATCH 1/8] staging: wilc1000: fix return type of wilc_hif_set_cfg Chaehyun Lim
` (5 preceding siblings ...)
2016-02-05 1:35 ` [PATCH 7/8] staging: wilc1000: remove initialization code of " Chaehyun Lim
@ 2016-02-05 1:35 ` Chaehyun Lim
6 siblings, 0 replies; 9+ messages in thread
From: Chaehyun Lim @ 2016-02-05 1:35 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. It is to improve readability by changing counter
variable name as i because wilc_send_config_pkt has a similar argument
name as count.
Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
drivers/staging/wilc1000/coreconfigurator.c | 38 ++++++++++++++---------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index dda81ee..00081bc 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -452,36 +452,36 @@ 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)
{
- int counter;
+ int i;
int ret = 0;
if (mode == GET_CFG) {
- for (counter = 0; counter < count; counter++) {
- PRINT_INFO(CORECONFIG_DBG, "Sending CFG packet [%d][%d]\n", !counter,
- (counter == count - 1));
- if (!wilc_wlan_cfg_get(wilc, !counter,
- wids[counter].id,
- (counter == count - 1),
+ for (i = 0; i < count; i++) {
+ PRINT_INFO(CORECONFIG_DBG, "Sending CFG packet [%d][%d]\n", !i,
+ (i == count - 1));
+ if (!wilc_wlan_cfg_get(wilc, !i,
+ wids[i].id,
+ (i == count - 1),
drv)) {
ret = -ETIMEDOUT;
printk("[Sendconfigpkt]Get Timed out\n");
break;
}
}
- for (counter = 0; counter < count; counter++) {
- wids[counter].size = wilc_wlan_cfg_get_val(
- wids[counter].id,
- wids[counter].val,
- wids[counter].size);
+ for (i = 0; i < count; i++) {
+ wids[i].size = wilc_wlan_cfg_get_val(
+ wids[i].id,
+ wids[i].val,
+ wids[i].size);
}
} else if (mode == SET_CFG) {
- for (counter = 0; counter < count; counter++) {
- PRINT_D(CORECONFIG_DBG, "Sending config SET PACKET WID:%x\n", wids[counter].id);
- if (!wilc_wlan_cfg_set(wilc, !counter,
- wids[counter].id,
- wids[counter].val,
- wids[counter].size,
- (counter == count - 1),
+ for (i = 0; i < count; i++) {
+ PRINT_D(CORECONFIG_DBG, "Sending config SET PACKET WID:%x\n", wids[i].id);
+ if (!wilc_wlan_cfg_set(wilc, !i,
+ wids[i].id,
+ wids[i].val,
+ wids[i].size,
+ (i == count - 1),
drv)) {
ret = -ETIMEDOUT;
printk("[Sendconfigpkt]Set Timed out\n");
--
2.7.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 5/8] staging: wilc1000: fix return type of wilc_send_config_pkt
2016-02-05 1:35 ` [PATCH 5/8] staging: wilc1000: fix return type of wilc_send_config_pkt Chaehyun Lim
@ 2016-02-07 21:51 ` Greg KH
0 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2016-02-07 21:51 UTC (permalink / raw)
To: Chaehyun Lim
Cc: devel, chris.park, austin.shin, linux-wireless, johnny.kim,
tony.cho, leo.kim
On Fri, Feb 05, 2016 at 10:35:15AM +0900, Chaehyun Lim wrote:
> wilc_send_config_pkt is returned 0 or -ETIMEDOUT according to return
> value of wilc_wlan_cfg_get or wilc_wlan_cfg_set.
> It is better to use int type 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(-)
This, and the remaining patches in the series, don't apply anymore due
to patches I took right before your series. Can you refresh these and
resend?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-02-07 21:51 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-05 1:35 [PATCH 1/8] staging: wilc1000: fix return type of wilc_hif_set_cfg Chaehyun Lim
2016-02-05 1:35 ` [PATCH 2/8] staging: wilc1000: rename pstrCfgParamVal in wilc_hif_set_cfg Chaehyun Lim
2016-02-05 1:35 ` [PATCH 3/8] staging: wilc1000: fix return type of wilc_deinit Chaehyun Lim
2016-02-05 1:35 ` [PATCH 4/8] staging: wilc1000: fix return error code " Chaehyun Lim
2016-02-05 1:35 ` [PATCH 5/8] staging: wilc1000: fix return type of wilc_send_config_pkt Chaehyun Lim
2016-02-07 21:51 ` Greg KH
2016-02-05 1:35 ` [PATCH 6/8] staging: wilc1000: use int type for counter variable Chaehyun Lim
2016-02-05 1:35 ` [PATCH 7/8] staging: wilc1000: remove initialization code of " Chaehyun Lim
2016-02-05 1:35 ` [PATCH 8/8] staging: wilc1000: rename counter in wilc_send_config_pkt Chaehyun Lim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).