linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] staging: wilc1000: change handle_get_ip_address's return type to void
@ 2016-05-02 10:47 Chaehyun Lim
  2016-05-02 10:47 ` [PATCH 2/7] staging: wilc1000: change data type of result in handle_get_ip_address Chaehyun Lim
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Chaehyun Lim @ 2016-05-02 10:47 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

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 <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 605cf8f..ce1cd68 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -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");
 }
 
-static s32 handle_get_ip_address(struct wilc_vif *vif, u8 idx)
+static void handle_get_ip_address(struct wilc_vif *vif, u8 idx)
 {
 	s32 result = 0;
 	struct wid wid;
@@ -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;
-	}
-
-	return result;
 }
 
 static s32 handle_get_mac_address(struct wilc_vif *vif,
-- 
2.8.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/7] staging: wilc1000: change data type of result in handle_get_ip_address
  2016-05-02 10:47 [PATCH 1/7] staging: wilc1000: change handle_get_ip_address's return type to void Chaehyun Lim
@ 2016-05-02 10:47 ` Chaehyun Lim
  2016-05-02 10:47 ` [PATCH 3/7] staging: wilc1000: rename " Chaehyun Lim
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Chaehyun Lim @ 2016-05-02 10:47 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 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 <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 ce1cd68..acefd3b 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -376,7 +376,7 @@ static void handle_set_ip_address(struct wilc_vif *vif, u8 *ip_addr, u8 idx)
 
 static void handle_get_ip_address(struct wilc_vif *vif, u8 idx)
 {
-	s32 result = 0;
+	int result = 0;
 	struct wid wid;
 
 	wid.id = (u16)WID_IP_ADDRESS;
-- 
2.8.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/7] staging: wilc1000: rename result in handle_get_ip_address
  2016-05-02 10:47 [PATCH 1/7] staging: wilc1000: change handle_get_ip_address's return type to void Chaehyun Lim
  2016-05-02 10:47 ` [PATCH 2/7] staging: wilc1000: change data type of result in handle_get_ip_address Chaehyun Lim
@ 2016-05-02 10:47 ` Chaehyun Lim
  2016-05-02 10:47 ` [PATCH 4/7] staging: wilc1000: fix comparison style of if statement " Chaehyun Lim
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Chaehyun Lim @ 2016-05-02 10:47 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 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 <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index acefd3b..1d48214 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -376,7 +376,7 @@ static void handle_set_ip_address(struct wilc_vif *vif, u8 *ip_addr, u8 idx)
 
 static void handle_get_ip_address(struct wilc_vif *vif, u8 idx)
 {
-	int result = 0;
+	int ret = 0;
 	struct wid wid;
 
 	wid.id = (u16)WID_IP_ADDRESS;
@@ -384,8 +384,8 @@ static void handle_get_ip_address(struct wilc_vif *vif, u8 idx)
 	wid.val = kmalloc(IP_ALEN, GFP_KERNEL);
 	wid.size = IP_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));
 
 	memcpy(get_ip[idx], wid.val, IP_ALEN);
 
@@ -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");
 }
 
-- 
2.8.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/7] staging: wilc1000: fix comparison style of if statement in handle_get_ip_address
  2016-05-02 10:47 [PATCH 1/7] staging: wilc1000: change handle_get_ip_address's return type to void Chaehyun Lim
  2016-05-02 10:47 ` [PATCH 2/7] staging: wilc1000: change data type of result in handle_get_ip_address Chaehyun Lim
  2016-05-02 10:47 ` [PATCH 3/7] staging: wilc1000: rename " Chaehyun Lim
@ 2016-05-02 10:47 ` Chaehyun Lim
  2016-05-02 10:47 ` [PATCH 5/7] staging: wilc1000: change handle_get_mac_address's return type to void Chaehyun Lim
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Chaehyun Lim @ 2016-05-02 10:47 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 conditional comparison of if statement as if (ret)
instead of using if (ret != 0)

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 1d48214..8a269fd 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -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");
 }
 
-- 
2.8.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/7] staging: wilc1000: change handle_get_mac_address's return type to void
  2016-05-02 10:47 [PATCH 1/7] staging: wilc1000: change handle_get_ip_address's return type to void Chaehyun Lim
                   ` (2 preceding siblings ...)
  2016-05-02 10:47 ` [PATCH 4/7] staging: wilc1000: fix comparison style of if statement " Chaehyun Lim
@ 2016-05-02 10:47 ` Chaehyun Lim
  2016-05-02 10:47 ` [PATCH 6/7] staging: wilc1000: change data type of result in handle_get_mac_address Chaehyun Lim
  2016-05-02 10:47 ` [PATCH 7/7] staging: wilc1000: rename " Chaehyun Lim
  5 siblings, 0 replies; 7+ messages in thread
From: Chaehyun Lim @ 2016-05-02 10:47 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

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 <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 8a269fd..23bbaa8 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -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");
 }
 
-static s32 handle_get_mac_address(struct wilc_vif *vif,
-				  struct get_mac_addr *get_mac_addr)
+static void handle_get_mac_address(struct wilc_vif *vif,
+				   struct get_mac_addr *get_mac_addr)
 {
 	s32 result = 0;
 	struct wid wid;
@@ -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);
-
-	return result;
 }
 
 static s32 handle_cfg_param(struct wilc_vif *vif,
-- 
2.8.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 6/7] staging: wilc1000: change data type of result in handle_get_mac_address
  2016-05-02 10:47 [PATCH 1/7] staging: wilc1000: change handle_get_ip_address's return type to void Chaehyun Lim
                   ` (3 preceding siblings ...)
  2016-05-02 10:47 ` [PATCH 5/7] staging: wilc1000: change handle_get_mac_address's return type to void Chaehyun Lim
@ 2016-05-02 10:47 ` Chaehyun Lim
  2016-05-02 10:47 ` [PATCH 7/7] staging: wilc1000: rename " Chaehyun Lim
  5 siblings, 0 replies; 7+ messages in thread
From: Chaehyun Lim @ 2016-05-02 10:47 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 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 <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 23bbaa8..71d6b66 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -401,7 +401,7 @@ static void handle_get_ip_address(struct wilc_vif *vif, u8 idx)
 static void handle_get_mac_address(struct wilc_vif *vif,
 				   struct get_mac_addr *get_mac_addr)
 {
-	s32 result = 0;
+	int result = 0;
 	struct wid wid;
 
 	wid.id = (u16)WID_MAC_ADDR;
-- 
2.8.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 7/7] staging: wilc1000: rename result in handle_get_mac_address
  2016-05-02 10:47 [PATCH 1/7] staging: wilc1000: change handle_get_ip_address's return type to void Chaehyun Lim
                   ` (4 preceding siblings ...)
  2016-05-02 10:47 ` [PATCH 6/7] staging: wilc1000: change data type of result in handle_get_mac_address Chaehyun Lim
@ 2016-05-02 10:47 ` Chaehyun Lim
  5 siblings, 0 replies; 7+ messages in thread
From: Chaehyun Lim @ 2016-05-02 10:47 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 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 <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 71d6b66..9535842 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -401,7 +401,7 @@ static void handle_get_ip_address(struct wilc_vif *vif, u8 idx)
 static void handle_get_mac_address(struct wilc_vif *vif,
 				   struct get_mac_addr *get_mac_addr)
 {
-	int result = 0;
+	int ret = 0;
 	struct wid wid;
 
 	wid.id = (u16)WID_MAC_ADDR;
@@ -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);
 }
-- 
2.8.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-05-02 10:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-02 10:47 [PATCH 1/7] staging: wilc1000: change handle_get_ip_address's return type to void Chaehyun Lim
2016-05-02 10:47 ` [PATCH 2/7] staging: wilc1000: change data type of result in handle_get_ip_address Chaehyun Lim
2016-05-02 10:47 ` [PATCH 3/7] staging: wilc1000: rename " Chaehyun Lim
2016-05-02 10:47 ` [PATCH 4/7] staging: wilc1000: fix comparison style of if statement " Chaehyun Lim
2016-05-02 10:47 ` [PATCH 5/7] staging: wilc1000: change handle_get_mac_address's return type to void Chaehyun Lim
2016-05-02 10:47 ` [PATCH 6/7] staging: wilc1000: change data type of result in handle_get_mac_address Chaehyun Lim
2016-05-02 10:47 ` [PATCH 7/7] staging: wilc1000: rename " 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).