When handle_get_ip_address is called in hostIFthread that is a kernel
thread, it is not checked return type of this function. This patch
changes return type to void and removes braces if statement due to have
a single statement.
Signed-off-by: Chaehyun Lim <redacted>
---
drivers/staging/wilc1000/host_interface.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
@@ -374,7 +374,7 @@ static void handle_set_ip_address(struct wilc_vif *vif, u8 *ip_addr, u8 idx)netdev_err(vif->ndev,"Failed to set IP address\n");}-statics32handle_get_ip_address(structwilc_vif*vif,u8idx)+staticvoidhandle_get_ip_address(structwilc_vif*vif,u8idx){s32result=0;structwidwid;
@@ -394,12 +394,8 @@ static s32 handle_get_ip_address(struct wilc_vif *vif, u8 idx)if(memcmp(get_ip[idx],set_ip[idx],IP_ALEN)!=0)wilc_setup_ipaddress(vif,set_ip[idx],idx);-if(result!=0){+if(result!=0)netdev_err(vif->ndev,"Failed to get IP address\n");-return-EINVAL;-}--returnresult;}statics32handle_get_mac_address(structwilc_vif*vif,
This patch changes data type of result variable from s32 to int. result
is used to get return value from wilc_send_config_pkt that has return
type of int.
Signed-off-by: Chaehyun Lim <redacted>
---
drivers/staging/wilc1000/host_interface.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
This patch renames result to ret that is used to get return value from
wilc_send_config_pkt. Some handle_*() functions are used as result,
others are used as ret. It will be changed as ret in all handle_*()
functions to match variable name.
Signed-off-by: Chaehyun Lim <redacted>
---
drivers/staging/wilc1000/host_interface.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
@@ -394,7 +394,7 @@ static void handle_get_ip_address(struct wilc_vif *vif, u8 idx)if(memcmp(get_ip[idx],set_ip[idx],IP_ALEN)!=0)wilc_setup_ipaddress(vif,set_ip[idx],idx);-if(result!=0)+if(ret!=0)netdev_err(vif->ndev,"Failed to get IP address\n");}
This patch changes conditional comparison of if statement as if (ret)
instead of using if (ret != 0)
Signed-off-by: Chaehyun Lim <redacted>
---
drivers/staging/wilc1000/host_interface.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -394,7 +394,7 @@ static void handle_get_ip_address(struct wilc_vif *vif, u8 idx)if(memcmp(get_ip[idx],set_ip[idx],IP_ALEN)!=0)wilc_setup_ipaddress(vif,set_ip[idx],idx);-if(ret!=0)+if(ret)netdev_err(vif->ndev,"Failed to get IP address\n");}
When handle_get_mac_address is called in hostIFthread that is a kernel
thread, it is not checked return type of this function. This patch
changes return type to void and removes braces if statement due to have
a single statement.
Signed-off-by: Chaehyun Lim <redacted>
---
drivers/staging/wilc1000/host_interface.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
@@ -398,8 +398,8 @@ static void handle_get_ip_address(struct wilc_vif *vif, u8 idx)netdev_err(vif->ndev,"Failed to get IP address\n");}-statics32handle_get_mac_address(structwilc_vif*vif,-structget_mac_addr*get_mac_addr)+staticvoidhandle_get_mac_address(structwilc_vif*vif,+structget_mac_addr*get_mac_addr){s32result=0;structwidwid;
@@ -412,13 +412,9 @@ static s32 handle_get_mac_address(struct wilc_vif *vif,result=wilc_send_config_pkt(vif,GET_CFG,&wid,1,wilc_get_vif_idx(vif));-if(result){+if(result)netdev_err(vif->ndev,"Failed to get mac address\n");-result=-EFAULT;-}complete(&hif_wait_response);--returnresult;}statics32handle_cfg_param(structwilc_vif*vif,
This patch changes data type of result variable from s32 to int. result
is used to get return value from wilc_send_config_pkt that has return
type of int.
Signed-off-by: Chaehyun Lim <redacted>
---
drivers/staging/wilc1000/host_interface.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
This patch renames result to ret that is used to get return value from
wilc_send_config_pkt. Some handle_*() functions are used as result,
others are used as ret. It will be changed as ret in all handle_*()
functions to match variable name.
Signed-off-by: Chaehyun Lim <redacted>
---
drivers/staging/wilc1000/host_interface.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
@@ -409,10 +409,10 @@ static void handle_get_mac_address(struct wilc_vif *vif,wid.val=get_mac_addr->mac_addr;wid.size=ETH_ALEN;-result=wilc_send_config_pkt(vif,GET_CFG,&wid,1,-wilc_get_vif_idx(vif));+ret=wilc_send_config_pkt(vif,GET_CFG,&wid,1,+wilc_get_vif_idx(vif));-if(result)+if(ret)netdev_err(vif->ndev,"Failed to get mac address\n");complete(&hif_wait_response);}