Skip to contentSkip to conversation

staging: wilc1000: change return type of ret variable in handle_get_tx_pwr

PATCH New Chaehyun Lim 1 participant 7 messages Apr 6, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/7 staging: wilc1000: change return type of ret variable in handle_get_tx_pwr

This patch changes return type of ret variable from s32 to int. ret has return value from wilc_send_config_pkt that has return type of int.

---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/host_interface.c +1 -1
index eb86fd4..09e4ca3 100644
@@ -2468,7 +2468,7 @@ static void handle_set_tx_pwr(struct wilc_vif *vif, u8 tx_pwr)
 
 static void handle_get_tx_pwr(struct wilc_vif *vif, u8 *tx_pwr)
 {
-	s32 ret = 0;
+	int ret = 0;
 	struct wid wid;
 
 	wid.id = (u16)WID_TX_POWER;
Signature · 1 line
2.8.0
#1 lore raw

PATCH 2/7 staging: wilc1000: change handle_set_wfi_drv_handler's return type to void

When handle_set_wfi_drv_handler 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.

---
 drivers/staging/wilc1000/host_interface.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/staging/wilc1000/host_interface.c +3 -7
index 09e4ca3..ba472d5 100644
@@ -307,8 +307,8 @@ static void handle_set_channel(struct wilc_vif *vif,
 		netdev_err(vif->ndev, "Failed to set channel\n");
 }
 
-static s32 handle_set_wfi_drv_handler(struct wilc_vif *vif,
-				      struct drv_handler *hif_drv_handler)
+static void handle_set_wfi_drv_handler(struct wilc_vif *vif,
+				       struct drv_handler *hif_drv_handler)
 {
 	s32 result = 0;
 	struct wid wid;
@@ -324,12 +324,8 @@ static s32 handle_set_wfi_drv_handler(struct wilc_vif *vif,
 	if (!hif_drv_handler->handler)
 		complete(&hif_driver_comp);
 
-	if (result) {
+	if (result)
 		netdev_err(vif->ndev, "Failed to set driver handler\n");
-		return -EINVAL;
-	}
-
-	return result;
 }
 
 static s32 handle_set_operation_mode(struct wilc_vif *vif,
Signature · 1 line
2.8.0
#2 lore raw

PATCH 3/7 staging: wilc1000: change data type of result in handle_set_wfi_drv_handler

In reply to 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.

---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/host_interface.c +1 -1
index ba472d5..33735fd 100644
@@ -310,7 +310,7 @@ static void handle_set_channel(struct wilc_vif *vif,
 static void handle_set_wfi_drv_handler(struct wilc_vif *vif,
 				       struct drv_handler *hif_drv_handler)
 {
-	s32 result = 0;
+	int result = 0;
 	struct wid wid;
 
 	wid.id = (u16)WID_SET_DRV_HANDLER;
Signature · 1 line
2.8.0
#3 lore raw

PATCH 4/7 staging: wilc1000: rename result in handle_set_wfi_drv_handler

In reply to Chaehyun Lim

This patch renames result to ret that is used to get return value from wilc_send_config_pkt. Some handle_*() function are used as result, others are used as ret. It will be changed as ret in all handle_*() function to match variable name.

---
 drivers/staging/wilc1000/host_interface.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/wilc1000/host_interface.c +4 -4
index 33735fd..4fd429e 100644
@@ -310,7 +310,7 @@ static void handle_set_channel(struct wilc_vif *vif,
 static void handle_set_wfi_drv_handler(struct wilc_vif *vif,
 				       struct drv_handler *hif_drv_handler)
 {
-	int result = 0;
+	int ret = 0;
 	struct wid wid;
 
 	wid.id = (u16)WID_SET_DRV_HANDLER;
@@ -318,13 +318,13 @@ static void handle_set_wfi_drv_handler(struct wilc_vif *vif,
 	wid.val = (s8 *)hif_drv_handler;
 	wid.size = sizeof(*hif_drv_handler);
 
-	result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
-				      hif_drv_handler->handler);
+	ret = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
+				   hif_drv_handler->handler);
 
 	if (!hif_drv_handler->handler)
 		complete(&hif_driver_comp);
 
-	if (result)
+	if (ret)
 		netdev_err(vif->ndev, "Failed to set driver handler\n");
 }
 
Signature · 1 line
2.8.0
#4 lore raw

PATCH 5/7 staging: wilc1000: change handle_set_operation_mode's return type to void

In reply to Chaehyun Lim

When handle_set_operation_mode 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.

---
 drivers/staging/wilc1000/host_interface.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/staging/wilc1000/host_interface.c +3 -7
index 4fd429e..ecf4ddc 100644
@@ -328,8 +328,8 @@ static void handle_set_wfi_drv_handler(struct wilc_vif *vif,
 		netdev_err(vif->ndev, "Failed to set driver handler\n");
 }
 
-static s32 handle_set_operation_mode(struct wilc_vif *vif,
-				     struct op_mode *hif_op_mode)
+static void handle_set_operation_mode(struct wilc_vif *vif,
+				      struct op_mode *hif_op_mode)
 {
 	s32 result = 0;
 	struct wid wid;
@@ -345,12 +345,8 @@ static s32 handle_set_operation_mode(struct wilc_vif *vif,
 	if ((hif_op_mode->mode) == IDLE_MODE)
 		complete(&hif_driver_comp);
 
-	if (result) {
+	if (result)
 		netdev_err(vif->ndev, "Failed to set driver handler\n");
-		return -EINVAL;
-	}
-
-	return result;
 }
 
 static s32 handle_set_ip_address(struct wilc_vif *vif, u8 *ip_addr, u8 idx)
Signature · 1 line
2.8.0
#5 lore raw

PATCH 6/7 staging: wilc1000: change data type of result in handle_set_operation_mode

In reply to 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.

---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/host_interface.c +1 -1
index ecf4ddc..52eddc4 100644
@@ -331,7 +331,7 @@ static void handle_set_wfi_drv_handler(struct wilc_vif *vif,
 static void handle_set_operation_mode(struct wilc_vif *vif,
 				      struct op_mode *hif_op_mode)
 {
-	s32 result = 0;
+	int result = 0;
 	struct wid wid;
 
 	wid.id = (u16)WID_SET_OPERATION_MODE;
Signature · 1 line
2.8.0
#6 lore raw

PATCH 7/7 staging: wilc1000: rename result in handle_set_operation_mode

In reply to 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.

---
 drivers/staging/wilc1000/host_interface.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/wilc1000/host_interface.c +4 -4
index 52eddc4..ac620fb 100644
@@ -331,7 +331,7 @@ static void handle_set_wfi_drv_handler(struct wilc_vif *vif,
 static void handle_set_operation_mode(struct wilc_vif *vif,
 				      struct op_mode *hif_op_mode)
 {
-	int result = 0;
+	int ret = 0;
 	struct wid wid;
 
 	wid.id = (u16)WID_SET_OPERATION_MODE;
@@ -339,13 +339,13 @@ static void handle_set_operation_mode(struct wilc_vif *vif,
 	wid.val = (s8 *)&hif_op_mode->mode;
 	wid.size = sizeof(u32);
 
-	result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
-				      wilc_get_vif_idx(vif));
+	ret = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
+				   wilc_get_vif_idx(vif));
 
 	if ((hif_op_mode->mode) == IDLE_MODE)
 		complete(&hif_driver_comp);
 
-	if (result)
+	if (ret)
 		netdev_err(vif->ndev, "Failed to set driver handler\n");
 }
 
Signature · 1 line
2.8.0