All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] staging: wilc1000: host_interface.c: Modify return statement.
@ 2019-03-29  6:02 Sanjana Sanikommu
  2019-03-29 16:09 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Sanjana Sanikommu @ 2019-03-29  6:02 UTC (permalink / raw)
  To: gregkh; +Cc: outreachy-kernel

Challenge suggested by coccinelle.
Remove return variable and directly return the value
Issue found using ret.cocci

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
---
Changes in v2:
Adjust spaces for last argument in return statement.
 drivers/staging/wilc1000/host_interface.c | 31 +++++++----------------
 1 file changed, 9 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 4dd9a20f6a0b..09c3095c0392 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1358,17 +1358,14 @@ int wilc_add_rx_gtk(struct wilc_vif *vif, const u8 *rx_gtk, u8 gtk_key_len,
 int wilc_set_pmkid_info(struct wilc_vif *vif, struct wilc_pmkid_attr *pmkid)
 {
 	struct wid wid;
-	int result;
 
 	wid.id = WID_PMKID_INFO;
 	wid.type = WID_STR;
 	wid.size = (pmkid->numpmkid * sizeof(struct wilc_pmkid)) + 1;
 	wid.val = (u8 *)pmkid;
 
-	result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1,
-				      wilc_get_vif_idx(vif));
-
-	return result;
+	return wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1,
+				    wilc_get_vif_idx(vif));
 }
 
 int wilc_get_mac_address(struct wilc_vif *vif, u8 *mac_addr)
@@ -1403,8 +1400,7 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ies,
 		conn_info->req_ies_len = ies_len;
 		conn_info->req_ies = kmemdup(ies, ies_len, GFP_KERNEL);
 		if (!conn_info->req_ies) {
-			result = -ENOMEM;
-			return result;
+			return -ENOMEM;
 		}
 	}
 
@@ -1570,7 +1566,6 @@ int wilc_hif_set_cfg(struct wilc_vif *vif, struct cfg_param_attr *param)
 {
 	struct wid wid_list[4];
 	int i = 0;
-	int result;
 
 	if (param->flag & WILC_CFG_PARAM_RETRY_SHORT) {
 		wid_list[i].id = WID_SHORT_RETRY_LIMIT;
@@ -1601,10 +1596,8 @@ int wilc_hif_set_cfg(struct wilc_vif *vif, struct cfg_param_attr *param)
 		i++;
 	}
 
-	result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list,
-				      i, wilc_get_vif_idx(vif));
-
-	return result;
+	return wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list,
+				    i, wilc_get_vif_idx(vif));
 }
 
 static void get_periodic_rssi(struct timer_list *t)
@@ -2121,7 +2114,6 @@ int wilc_setup_multicast_filter(struct wilc_vif *vif, u32 enabled, u32 count,
 
 int wilc_set_tx_power(struct wilc_vif *vif, u8 tx_power)
 {
-	int ret;
 	struct wid wid;
 
 	wid.id = WID_TX_POWER;
@@ -2129,15 +2121,12 @@ int wilc_set_tx_power(struct wilc_vif *vif, u8 tx_power)
 	wid.val = &tx_power;
 	wid.size = sizeof(char);
 
-	ret = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1,
-				   wilc_get_vif_idx(vif));
-
-	return ret;
+	return wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1,
+				    wilc_get_vif_idx(vif));
 }
 
 int wilc_get_tx_power(struct wilc_vif *vif, u8 *tx_power)
 {
-	int ret;
 	struct wid wid;
 
 	wid.id = WID_TX_POWER;
@@ -2145,8 +2134,6 @@ int wilc_get_tx_power(struct wilc_vif *vif, u8 *tx_power)
 	wid.val = tx_power;
 	wid.size = sizeof(char);
 
-	ret = wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1,
-				   wilc_get_vif_idx(vif));
-
-	return ret;
+	return wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1,
+				    wilc_get_vif_idx(vif));
 }
-- 
2.17.1



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

* Re: [PATCH v2] staging: wilc1000: host_interface.c: Modify return statement.
  2019-03-29  6:02 [PATCH v2] staging: wilc1000: host_interface.c: Modify return statement Sanjana Sanikommu
@ 2019-03-29 16:09 ` Greg KH
  2019-03-30 15:57   ` sanjana99reddy99
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2019-03-29 16:09 UTC (permalink / raw)
  To: Sanjana Sanikommu; +Cc: outreachy-kernel

On Fri, Mar 29, 2019 at 11:32:38AM +0530, Sanjana Sanikommu wrote:
> Challenge suggested by coccinelle.
> Remove return variable and directly return the value
> Issue found using ret.cocci
> 
> Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
> ---
> Changes in v2:
> Adjust spaces for last argument in return statement.
>  drivers/staging/wilc1000/host_interface.c | 31 +++++++----------------
>  1 file changed, 9 insertions(+), 22 deletions(-)

You sent 3 different patches with the same subject line, so I have no
idea what is going on here.  Please make this a patch series of all
remaining patches for this driver, so I have a chance to be able to
review it properly.

thanks,

greg k-h


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

* Re: [PATCH v2] staging: wilc1000: host_interface.c: Modify return statement.
  2019-03-29 16:09 ` Greg KH
@ 2019-03-30 15:57   ` sanjana99reddy99
  0 siblings, 0 replies; 3+ messages in thread
From: sanjana99reddy99 @ 2019-03-30 15:57 UTC (permalink / raw)
  To: outreachy-kernel


[-- Attachment #1.1: Type: text/plain, Size: 900 bytes --]



On Friday, March 29, 2019 at 9:39:50 PM UTC+5:30, gregkh wrote:
>
> On Fri, Mar 29, 2019 at 11:32:38AM +0530, Sanjana Sanikommu wrote: 
> > Challenge suggested by coccinelle. 
> > Remove return variable and directly return the value 
> > Issue found using ret.cocci 
> > 
> > Signed-off-by: Sanjana Sanikommu <sanjana9...@gmail.com <javascript:>> 
> > --- 
> > Changes in v2: 
> > Adjust spaces for last argument in return statement. 
> >  drivers/staging/wilc1000/host_interface.c | 31 +++++++---------------- 
> >  1 file changed, 9 insertions(+), 22 deletions(-) 
>
> You sent 3 different patches with the same subject line, so I have no 
> idea what is going on here.  Please make this a patch series of all 
> remaining patches for this driver, so I have a chance to be able to 
> review it properly. 
>

    Sure I would make a patch series and send them in v3 

>
> thanks, 
>
> greg k-h 
>

[-- Attachment #1.2: Type: text/html, Size: 1489 bytes --]

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

end of thread, other threads:[~2019-03-30 15:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-29  6:02 [PATCH v2] staging: wilc1000: host_interface.c: Modify return statement Sanjana Sanikommu
2019-03-29 16:09 ` Greg KH
2019-03-30 15:57   ` sanjana99reddy99

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.