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

This patchset removes unnecessary local return variables from functions
in the files listed below. All these patches relate to issues found with
Coccinelle using ret.cocci.

Nishka Dasgupta (3):
  staging: wilc1000: Remove return variables in host_interface.c
  staging: wilc1000: Remove return variable in host_interface.c
  staging: wilc1000: Remove return variables in wilc_spi.c

 drivers/staging/wilc1000/host_interface.c | 15 +++++----------
 drivers/staging/wilc1000/wilc_spi.c       | 10 ++++------
 2 files changed, 9 insertions(+), 16 deletions(-)

-- 
Changes in v2:
- Merged some patches relating to the same file into one patch
- Added filenames to individual patch subject lines
- Fixed alignments with parentheses in return statements

2.19.1



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

* [PATCH v2 1/3] staging: wilc1000: Remove return variables in host_interface.c
  2019-03-21  7:49 [PATCH v2 0/3] staging: wilc1000: Remove return variables Nishka Dasgupta
@ 2019-03-21  7:49 ` Nishka Dasgupta
  2019-03-21 18:59   ` Greg KH
  2019-03-21  7:49 ` [PATCH v2 2/3] staging: wilc1000: Remove return variable " Nishka Dasgupta
  2019-03-21  7:49 ` [PATCH v2 3/3] staging: wilc1000: Remove return variables in wilc_spi.c Nishka Dasgupta
  2 siblings, 1 reply; 6+ messages in thread
From: Nishka Dasgupta @ 2019-03-21  7:49 UTC (permalink / raw)
  To: gregkh, outreachy-kernel, ajay.kathat, adham.abozaeid; +Cc: Nishka Dasgupta

Remove return variables in host_interface.c. Issue suggested with
Coccinelle using ret.cocci.

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

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 56d8ed29fff9..2d30a144c97e 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1365,10 +1365,8 @@ int wilc_set_pmkid_info(struct wilc_vif *vif, struct wilc_pmkid_attr *pmkid)
 	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)
@@ -1601,10 +1599,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] 6+ messages in thread

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

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

Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
---
 drivers/staging/wilc1000/host_interface.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 2d30a144c97e..61fee74868d8 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1401,8 +1401,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;
 		}
 	}
 
-- 
2.19.1



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

* [PATCH v2 3/3] staging: wilc1000: Remove return variables in wilc_spi.c
  2019-03-21  7:49 [PATCH v2 0/3] staging: wilc1000: Remove return variables Nishka Dasgupta
  2019-03-21  7:49 ` [PATCH v2 1/3] staging: wilc1000: Remove return variables in host_interface.c Nishka Dasgupta
  2019-03-21  7:49 ` [PATCH v2 2/3] staging: wilc1000: Remove return variable " Nishka Dasgupta
@ 2019-03-21  7:49 ` Nishka Dasgupta
  2019-03-21 18:57   ` Greg KH
  2 siblings, 1 reply; 6+ messages in thread
From: Nishka Dasgupta @ 2019-03-21  7:49 UTC (permalink / raw)
  To: gregkh, outreachy-kernel, ajay.kathat, adham.abozaeid; +Cc: Nishka Dasgupta

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

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

diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c
index 4a1be9e60d74..66ac08c92927 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -934,9 +934,8 @@ static int wilc_spi_read_int(struct wilc *wilc, u32 *int_status)
 	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;
+		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) {
@@ -982,9 +981,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] 6+ messages in thread

* Re: [PATCH v2 3/3] staging: wilc1000: Remove return variables in wilc_spi.c
  2019-03-21  7:49 ` [PATCH v2 3/3] staging: wilc1000: Remove return variables in wilc_spi.c Nishka Dasgupta
@ 2019-03-21 18:57   ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2019-03-21 18:57 UTC (permalink / raw)
  To: Nishka Dasgupta; +Cc: outreachy-kernel, ajay.kathat, adham.abozaeid

On Thu, Mar 21, 2019 at 01:19:27PM +0530, Nishka Dasgupta wrote:
> Remove return variables in wilc_spi.c. Issue found with Coccinelle using
> ret.cocci.
> 
> Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
> ---
>  drivers/staging/wilc1000/wilc_spi.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c
> index 4a1be9e60d74..66ac08c92927 100644
> --- a/drivers/staging/wilc1000/wilc_spi.c
> +++ b/drivers/staging/wilc1000/wilc_spi.c
> @@ -934,9 +934,8 @@ static int wilc_spi_read_int(struct wilc *wilc, u32 *int_status)
>  	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;
> +		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) {
> @@ -982,9 +981,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);

Always run your patches through checkpatch.pl so that you do not get
grumpy maintainers telling you to run your patches through checkpatch.pl
before sending them out :)

Please fix up...

greg k-h


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

* Re: [PATCH v2 1/3] staging: wilc1000: Remove return variables in host_interface.c
  2019-03-21  7:49 ` [PATCH v2 1/3] staging: wilc1000: Remove return variables in host_interface.c Nishka Dasgupta
@ 2019-03-21 18:59   ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2019-03-21 18:59 UTC (permalink / raw)
  To: Nishka Dasgupta; +Cc: outreachy-kernel, ajay.kathat, adham.abozaeid

On Thu, Mar 21, 2019 at 01:19:25PM +0530, Nishka Dasgupta wrote:
> Remove return variables in host_interface.c. Issue suggested with
> Coccinelle using ret.cocci.
> 
> Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
> ---
>  drivers/staging/wilc1000/host_interface.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)

Patch 1 and 2 almost have identical subject lines, that is not ok.

Also, did you test build this series?  It adds new build warnings to the
kernel build process, which is not acceptable and will cause a patch to
be rejected :(

Please fix this series up and resend.

thanks,

greg k-h


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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-21  7:49 [PATCH v2 0/3] staging: wilc1000: Remove return variables Nishka Dasgupta
2019-03-21  7:49 ` [PATCH v2 1/3] staging: wilc1000: Remove return variables in host_interface.c Nishka Dasgupta
2019-03-21 18:59   ` Greg KH
2019-03-21  7:49 ` [PATCH v2 2/3] staging: wilc1000: Remove return variable " Nishka Dasgupta
2019-03-21  7:49 ` [PATCH v2 3/3] staging: wilc1000: Remove return variables in wilc_spi.c Nishka Dasgupta
2019-03-21 18:57   ` Greg KH

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.