remove unnecessary local variables
cover remove unnecessary local variables
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(-)
Signature · 1 line
2.17.1
PATCH 1/2 staging: wilc1000: remove unnecessary variable ret
Remove unnecessary local variable "ret" and its assignments from function wilc_set_tx_power. Suggested by Coccinelle.
--- drivers/staging/wilc1000/host_interface.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/wilc1000/host_interface.c +1 -3
@@ -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)
Signature · 1 line
2.17.1
Greg KH
maintainerRe: [PATCH 1/2] staging: wilc1000: remove unnecessary variable ret
Quoted 35 lines · Himadri Pandya
Remove unnecessary local variable "ret" and its assignments from function
wilc_set_tx_power. Suggested by Coccinelle.Signed-off-by Himadri Pandya <[email protected]>--- drivers/staging/wilc1000/host_interface.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/staging/wilc1000/host_interface.c +1
-3@@ -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)Signature · 1 line
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
PATCH 1/1 staging: wilc1000: remove unnecessary local variables
In reply to Himadri PandyaRemove unnecessary local variable "ret" and its assignments from functions wilc_set_tx_power and wilc_get_tx_power. Suggested by Coccinelle.
--- drivers/staging/wilc1000/host_interface.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/staging/wilc1000/host_interface.c +3 -9
@@ -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)); }
Signature · 1 line
2.17.1
PATCH 2/2 staging: wilc1000: remove unnecessary local variable
In reply to Himadri PandyaRemove unnecessary local variable "ret" and its assignments from function wilc_get_tx_power. Suggested by Coccinelle.
--- drivers/staging/wilc1000/host_interface.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/wilc1000/host_interface.c +2 -4
@@ -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; }
Signature · 1 line
2.17.1
Quoted 2 lines · Himadri Pandya
This patchset removes unnecessary local variables from functions
wilc_set_tx_powerandwilc_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
Quoted 18 lines
Himadri Pandya (2):
staging: wilc1000: remove unnecessary variable ret
staging: wilc1000: remove unnecessary local variabledrivers/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 [email protected]. To post to this group, send email to [email protected].
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.
Greg KH
maintainerQuoted 9 lines · Himadri Pandya
This patchset removes unnecessary local variables from functions
wilc_set_tx_powerandwilc_get_tx_power.Himadri Pandya (2):
staging: wilc1000: remove unnecessary variable ret
staging: wilc1000: remove unnecessary local variabledrivers/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
Quoted 11 lines · Greg KH,
Quoted 9 lines · Himadri Pandya
This patchset removes unnecessary local variables from functions
wilc_set_tx_powerandwilc_get_tx_power.Himadri Pandya (2):
staging: wilc1000: remove unnecessary variable ret
staging: wilc1000: remove unnecessary local variabledrivers/staging/wilc1000/host_interface.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
Quoted 9 lines
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