All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] staging: wilc1000: Remove local return variables
@ 2019-03-21 19:55 Nishka Dasgupta
  2019-03-21 19:55 ` [PATCH v4 1/2] staging: wilc1000: Remove return variable from host_interface.c Nishka Dasgupta
  2019-03-21 19:55 ` [PATCH v4 2/2] staging: wilc1000: Remove return variables from wilc_spi.c Nishka Dasgupta
  0 siblings, 2 replies; 3+ messages in thread
From: Nishka Dasgupta @ 2019-03-21 19:55 UTC (permalink / raw)
  To: gregkh, outreachy-kernel, ajay.kathat, adham.abozaeid; +Cc: Nishka Dasgupta

Remove unnecessary local return variables in wilc1000. Issues found with
Coccinelle using ret.cocci.

Nishka Dasgupta (2):
  staging: wilc1000: Remove return variable from host_interface.c
  staging: wilc1000: Remove return variables from wilc_spi.c

 drivers/staging/wilc1000/host_interface.c | 20 ++++++--------------
 drivers/staging/wilc1000/wilc_spi.c       | 13 +++++--------
 2 files changed, 11 insertions(+), 22 deletions(-)

-- 
Changes in v4:
- Remove braces around single-statement if-block

2.19.1



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

* [PATCH v4 1/2] staging: wilc1000: Remove return variable from host_interface.c
  2019-03-21 19:55 [PATCH v4 0/2] staging: wilc1000: Remove local return variables Nishka Dasgupta
@ 2019-03-21 19:55 ` Nishka Dasgupta
  2019-03-21 19:55 ` [PATCH v4 2/2] staging: wilc1000: Remove return variables from wilc_spi.c Nishka Dasgupta
  1 sibling, 0 replies; 3+ messages in thread
From: Nishka Dasgupta @ 2019-03-21 19:55 UTC (permalink / raw)
  To: gregkh, outreachy-kernel, ajay.kathat, adham.abozaeid; +Cc: Nishka Dasgupta

Remove return variable from host_interface.c. Issue found with
Coccinelle using ret.cocci.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
---
 drivers/staging/wilc1000/host_interface.c | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 56d8ed29fff9..44556b22613e 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)
@@ -1402,10 +1399,8 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ies,
 	if (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;
-		}
+		if (!conn_info->req_ies)
+			return -ENOMEM;
 	}
 
 	result = wilc_send_connect_wid(vif);
@@ -1570,7 +1565,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 +1595,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)
-- 
2.19.1



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

* [PATCH v4 2/2] staging: wilc1000: Remove return variables from wilc_spi.c
  2019-03-21 19:55 [PATCH v4 0/2] staging: wilc1000: Remove local return variables Nishka Dasgupta
  2019-03-21 19:55 ` [PATCH v4 1/2] staging: wilc1000: Remove return variable from host_interface.c Nishka Dasgupta
@ 2019-03-21 19:55 ` Nishka Dasgupta
  1 sibling, 0 replies; 3+ messages in thread
From: Nishka Dasgupta @ 2019-03-21 19:55 UTC (permalink / raw)
  To: gregkh, outreachy-kernel, ajay.kathat, adham.abozaeid; +Cc: Nishka Dasgupta

Remove return variables from wilc_spi.c. Issue found with Coccinelle
using ret.cocci.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
---
Changes in v4:
- Remove braces around single-statement if-block.

 drivers/staging/wilc1000/wilc_spi.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c
index 4a1be9e60d74..d8910bf9cb75 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -933,11 +933,9 @@ static int wilc_spi_read_int(struct wilc *wilc, u32 *int_status)
 	u32 irq_flags;
 	int k = IRG_FLAGS_OFFSET + 5;
 
-	if (spi_priv->has_thrpt_enh) {
-		ret = spi_internal_read(wilc, 0xe840 - WILC_SPI_REG_BASE,
-					int_status);
-		return ret;
-	}
+	if (spi_priv->has_thrpt_enh)
+		return spi_internal_read(wilc, 0xe840 - WILC_SPI_REG_BASE,
+					 int_status);
 	ret = wilc_spi_read_reg(wilc, WILC_VMM_TO_HOST_SIZE, &byte_cnt);
 	if (!ret) {
 		dev_err(&spi->dev,
@@ -982,9 +980,8 @@ static int wilc_spi_clear_int_ext(struct wilc *wilc, u32 val)
 	u32 tbl_ctl;
 
 	if (spi_priv->has_thrpt_enh) {
-		ret = spi_internal_write(wilc, 0xe844 - WILC_SPI_REG_BASE,
-					 val);
-		return ret;
+		return spi_internal_write(wilc, 0xe844 - WILC_SPI_REG_BASE,
+					  val);
 	}
 
 	flags = val & (BIT(MAX_NUM_INT) - 1);
-- 
2.19.1



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

end of thread, other threads:[~2019-03-21 19:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-21 19:55 [PATCH v4 0/2] staging: wilc1000: Remove local return variables Nishka Dasgupta
2019-03-21 19:55 ` [PATCH v4 1/2] staging: wilc1000: Remove return variable from host_interface.c Nishka Dasgupta
2019-03-21 19:55 ` [PATCH v4 2/2] staging: wilc1000: Remove return variables from wilc_spi.c Nishka Dasgupta

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.