All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] remove unnecessary local variables
@ 2019-03-09 11:07 Himadri Pandya
  2019-03-09 11:07 ` [PATCH 1/2] staging: wilc1000: remove unnecessary variable ret Himadri Pandya
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Himadri Pandya @ 2019-03-09 11:07 UTC (permalink / raw)
  To: adham.abozaeid, ajay.kathat, gregkh; +Cc: outreachy-kernel, Himadri Pandya

This patchset removes unnecessary local variables from functions
wilc_set_tx_power and wilc_get_tx_power.

Himadri Pandya (2):
  staging: wilc1000: remove unnecessary variable ret
  staging: wilc1000: remove unnecessary local variable

 drivers/staging/wilc1000/host_interface.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

-- 
2.17.1



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

* [PATCH 1/2] staging: wilc1000: remove unnecessary variable ret
  2019-03-09 11:07 [PATCH 0/2] remove unnecessary local variables Himadri Pandya
@ 2019-03-09 11:07 ` Himadri Pandya
  2019-03-09 13:41   ` Greg KH
  2019-03-09 15:15   ` [PATCH] staging: wilc1000: remove unnecessary local variables Himadri Pandya
  2019-03-09 11:07 ` [PATCH 2/2] staging: wilc1000: remove unnecessary local variable Himadri Pandya
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 8+ messages in thread
From: Himadri Pandya @ 2019-03-09 11:07 UTC (permalink / raw)
  To: adham.abozaeid, ajay.kathat, gregkh; +Cc: outreachy-kernel, Himadri Pandya

Remove unnecessary local variable "ret" and its assignments from
function wilc_set_tx_power. Suggested by Coccinelle.

Signed-off-by: Himadri Pandya <himadri18.07@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index fa0e1bd9f836..4a5f83ae06d2 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2119,7 +2119,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;
@@ -2127,10 +2126,9 @@ 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,
+	return wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1,
 				   wilc_get_vif_idx(vif));
 
-	return ret;
 }
 
 int wilc_get_tx_power(struct wilc_vif *vif, u8 *tx_power)
-- 
2.17.1



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

* [PATCH 2/2] staging: wilc1000: remove unnecessary local variable
  2019-03-09 11:07 [PATCH 0/2] remove unnecessary local variables Himadri Pandya
  2019-03-09 11:07 ` [PATCH 1/2] staging: wilc1000: remove unnecessary variable ret Himadri Pandya
@ 2019-03-09 11:07 ` Himadri Pandya
  2019-03-09 13:37 ` [Outreachy kernel] [PATCH 0/2] remove unnecessary local variables Julia Lawall
  2019-03-09 13:40 ` Greg KH
  3 siblings, 0 replies; 8+ messages in thread
From: Himadri Pandya @ 2019-03-09 11:07 UTC (permalink / raw)
  To: adham.abozaeid, ajay.kathat, gregkh; +Cc: outreachy-kernel, Himadri Pandya

Remove unnecessary local variable "ret" and its assignments from
function wilc_get_tx_power. Suggested by Coccinelle.

Signed-off-by: Himadri Pandya <himadri18.07@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 4a5f83ae06d2..0a309a35c63e 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2133,7 +2133,6 @@ int wilc_set_tx_power(struct wilc_vif *vif, u8 tx_power)
 
 int wilc_get_tx_power(struct wilc_vif *vif, u8 *tx_power)
 {
-	int ret;
 	struct wid wid;
 
 	wid.id = WID_TX_POWER;
@@ -2141,8 +2140,7 @@ 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 wilc_send_config_pkt(vif, WILC_GET_CFG, &wid, 1,
+				     wilc_get_vif_idx(vif));
 
-	return ret;
 }
-- 
2.17.1



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

* Re: [Outreachy kernel] [PATCH 0/2] remove unnecessary local variables
  2019-03-09 11:07 [PATCH 0/2] remove unnecessary local variables Himadri Pandya
  2019-03-09 11:07 ` [PATCH 1/2] staging: wilc1000: remove unnecessary variable ret Himadri Pandya
  2019-03-09 11:07 ` [PATCH 2/2] staging: wilc1000: remove unnecessary local variable Himadri Pandya
@ 2019-03-09 13:37 ` Julia Lawall
  2019-03-09 13:40 ` Greg KH
  3 siblings, 0 replies; 8+ messages in thread
From: Julia Lawall @ 2019-03-09 13:37 UTC (permalink / raw)
  To: Himadri Pandya; +Cc: adham.abozaeid, ajay.kathat, gregkh, outreachy-kernel



On Sat, 9 Mar 2019, Himadri Pandya wrote:

> This patchset removes unnecessary local variables from functions
> wilc_set_tx_power and wilc_get_tx_power.

The concept is almost the same, so it could be just one patch.

When you resend, check that the arguments are properly placed and there
are no blank lines at the end of the file.

julia


>
> Himadri Pandya (2):
>   staging: wilc1000: remove unnecessary variable ret
>   staging: wilc1000: remove unnecessary local variable
>
>  drivers/staging/wilc1000/host_interface.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
>
> --
> 2.17.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190309110743.41443-1-himadri18.07%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

* Re: [PATCH 0/2] remove unnecessary local variables
  2019-03-09 11:07 [PATCH 0/2] remove unnecessary local variables Himadri Pandya
                   ` (2 preceding siblings ...)
  2019-03-09 13:37 ` [Outreachy kernel] [PATCH 0/2] remove unnecessary local variables Julia Lawall
@ 2019-03-09 13:40 ` Greg KH
  2019-03-09 15:17   ` Himadri Pandya
  3 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2019-03-09 13:40 UTC (permalink / raw)
  To: Himadri Pandya; +Cc: adham.abozaeid, ajay.kathat, outreachy-kernel

On Sat, Mar 09, 2019 at 04:37:41PM +0530, Himadri Pandya wrote:
> This patchset removes unnecessary local variables from functions
> wilc_set_tx_power and wilc_get_tx_power.
> 
> Himadri Pandya (2):
>   staging: wilc1000: remove unnecessary variable ret
>   staging: wilc1000: remove unnecessary local variable
> 
>  drivers/staging/wilc1000/host_interface.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)

The Subject: line of this email should also have the subsystem (staging)
and driver (wilc1000), like your patches do.  No need to change it this
time, but please do so next time.

thanks,

greg k-h


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

* Re: [PATCH 1/2] staging: wilc1000: remove unnecessary variable ret
  2019-03-09 11:07 ` [PATCH 1/2] staging: wilc1000: remove unnecessary variable ret Himadri Pandya
@ 2019-03-09 13:41   ` Greg KH
  2019-03-09 15:15   ` [PATCH] staging: wilc1000: remove unnecessary local variables Himadri Pandya
  1 sibling, 0 replies; 8+ messages in thread
From: Greg KH @ 2019-03-09 13:41 UTC (permalink / raw)
  To: Himadri Pandya; +Cc: adham.abozaeid, ajay.kathat, outreachy-kernel

On Sat, Mar 09, 2019 at 04:37:42PM +0530, Himadri Pandya wrote:
> Remove unnecessary local variable "ret" and its assignments from
> function wilc_set_tx_power. Suggested by Coccinelle.
> 
> Signed-off-by: Himadri Pandya <himadri18.07@gmail.com>
> ---
>  drivers/staging/wilc1000/host_interface.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index fa0e1bd9f836..4a5f83ae06d2 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -2119,7 +2119,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;
> @@ -2127,10 +2126,9 @@ 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,
> +	return wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1,
>  				   wilc_get_vif_idx(vif));
>  
> -	return ret;
>  }
>  
>  int wilc_get_tx_power(struct wilc_vif *vif, u8 *tx_power)
> -- 
> 2.17.1
>


Your two patches do the same thing, but your wording is just a _little_
different.  Why not make this just one patch that does that one thing,
for two different functions?

thanks,

greg k-h


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

* [PATCH] staging: wilc1000: remove unnecessary local variables
  2019-03-09 11:07 ` [PATCH 1/2] staging: wilc1000: remove unnecessary variable ret Himadri Pandya
  2019-03-09 13:41   ` Greg KH
@ 2019-03-09 15:15   ` Himadri Pandya
  1 sibling, 0 replies; 8+ messages in thread
From: Himadri Pandya @ 2019-03-09 15:15 UTC (permalink / raw)
  To: adham.abozaeid, ajay.kathat, gregkh; +Cc: outreachy-kernel, Himadri Pandya

Remove unnecessary local variable "ret" and its assignments from
functions wilc_set_tx_power and wilc_get_tx_power. Suggested by
Coccinelle.

Signed-off-by: Himadri Pandya <himadri18.07@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index fa0e1bd9f836..76c73ef08eb2 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2119,7 +2119,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;
@@ -2127,15 +2126,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,
+	return wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1,
 				   wilc_get_vif_idx(vif));
-
-	return ret;
 }
 
 int wilc_get_tx_power(struct wilc_vif *vif, u8 *tx_power)
 {
-	int ret;
 	struct wid wid;
 
 	wid.id = WID_TX_POWER;
@@ -2143,8 +2139,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] 8+ messages in thread

* Re: [PATCH 0/2] remove unnecessary local variables
  2019-03-09 13:40 ` Greg KH
@ 2019-03-09 15:17   ` Himadri Pandya
  0 siblings, 0 replies; 8+ messages in thread
From: Himadri Pandya @ 2019-03-09 15:17 UTC (permalink / raw)
  To: Greg KH; +Cc: adham.abozaeid, ajay.kathat, outreachy-kernel

[-- Attachment #1: Type: text/plain, Size: 766 bytes --]

On Sat, 9 Mar, 2019, 7:10 PM Greg KH, <gregkh@linuxfoundation.org> wrote:

> On Sat, Mar 09, 2019 at 04:37:41PM +0530, Himadri Pandya wrote:
> > This patchset removes unnecessary local variables from functions
> > wilc_set_tx_power and wilc_get_tx_power.
> >
> > Himadri Pandya (2):
> >   staging: wilc1000: remove unnecessary variable ret
> >   staging: wilc1000: remove unnecessary local variable
> >
> >  drivers/staging/wilc1000/host_interface.c | 10 +++-------
> >  1 file changed, 3 insertions(+), 7 deletions(-)
>
> The Subject: line of this email should also have the subsystem (staging)
> and driver (wilc1000), like your patches do.  No need to change it this
> time, but please do so next time.


> thanks,
>
> greg k-h
>

Noted. Thank you.

- Himadri

>

[-- Attachment #2: Type: text/html, Size: 1563 bytes --]

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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-09 11:07 [PATCH 0/2] remove unnecessary local variables Himadri Pandya
2019-03-09 11:07 ` [PATCH 1/2] staging: wilc1000: remove unnecessary variable ret Himadri Pandya
2019-03-09 13:41   ` Greg KH
2019-03-09 15:15   ` [PATCH] staging: wilc1000: remove unnecessary local variables Himadri Pandya
2019-03-09 11:07 ` [PATCH 2/2] staging: wilc1000: remove unnecessary local variable Himadri Pandya
2019-03-09 13:37 ` [Outreachy kernel] [PATCH 0/2] remove unnecessary local variables Julia Lawall
2019-03-09 13:40 ` Greg KH
2019-03-09 15:17   ` Himadri Pandya

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.