mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: vt6656: Remove unnecessary local variables initialization
@ 2020-03-01 13:50 Oscar Carter
  2020-03-02 15:49 ` Quentin Deslandes
  0 siblings, 1 reply; 2+ messages in thread
From: Oscar Carter @ 2020-03-01 13:50 UTC (permalink / raw)
  To: Forest Bond, Greg Kroah-Hartman
  Cc: Quentin Deslandes, Malcolm Priestley, Gabriela Bittencourt,
	Colin Ian King, Oscar Carter, devel, linux-kernel

Don't initialize variables that are then set a few lines later.

Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
---
 drivers/staging/vt6656/main_usb.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 701300202b21..bfeb5df896fe 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -109,7 +109,7 @@ static void vnt_set_options(struct vnt_private *priv)
  */
 static int vnt_init_registers(struct vnt_private *priv)
 {
-	int ret = 0;
+	int ret;
 	struct vnt_cmd_card_init *init_cmd = &priv->init_command;
 	struct vnt_rsp_card_init *init_rsp = &priv->init_response;
 	u8 antenna;
@@ -435,7 +435,7 @@ static void vnt_free_int_bufs(struct vnt_private *priv)

 static int vnt_alloc_bufs(struct vnt_private *priv)
 {
-	int ret = 0;
+	int ret;
 	struct vnt_usb_send_context *tx_context;
 	struct vnt_rcb *rcb;
 	int ii;
@@ -528,7 +528,7 @@ static void vnt_tx_80211(struct ieee80211_hw *hw,

 static int vnt_start(struct ieee80211_hw *hw)
 {
-	int ret = 0;
+	int ret;
 	struct vnt_private *priv = hw->priv;

 	priv->rx_buf_sz = MAX_TOTAL_SIZE_WITH_ALL_HEADERS;
@@ -798,7 +798,7 @@ static u64 vnt_prepare_multicast(struct ieee80211_hw *hw,
 	struct vnt_private *priv = hw->priv;
 	struct netdev_hw_addr *ha;
 	u64 mc_filter = 0;
-	u32 bit_nr = 0;
+	u32 bit_nr;

 	netdev_hw_addr_list_for_each(ha, mc_list) {
 		bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26;
@@ -973,7 +973,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
 	struct vnt_private *priv;
 	struct ieee80211_hw *hw;
 	struct wiphy *wiphy;
-	int rc = 0;
+	int rc;

 	udev = usb_get_dev(interface_to_usbdev(intf));

--
2.20.1


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

* Re: [PATCH] staging: vt6656: Remove unnecessary local variables initialization
  2020-03-01 13:50 [PATCH] staging: vt6656: Remove unnecessary local variables initialization Oscar Carter
@ 2020-03-02 15:49 ` Quentin Deslandes
  0 siblings, 0 replies; 2+ messages in thread
From: Quentin Deslandes @ 2020-03-02 15:49 UTC (permalink / raw)
  To: Oscar Carter
  Cc: Forest Bond, Greg Kroah-Hartman, Malcolm Priestley,
	Gabriela Bittencourt, Colin Ian King, devel, linux-kernel

On Sun, Mar 01, 2020 at 02:50:28PM +0100, Oscar Carter wrote:
> Don't initialize variables that are then set a few lines later.
> 
> Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
> ---
>  drivers/staging/vt6656/main_usb.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
> index 701300202b21..bfeb5df896fe 100644
> --- a/drivers/staging/vt6656/main_usb.c
> +++ b/drivers/staging/vt6656/main_usb.c
> @@ -109,7 +109,7 @@ static void vnt_set_options(struct vnt_private *priv)
>   */
>  static int vnt_init_registers(struct vnt_private *priv)
>  {
> -	int ret = 0;
> +	int ret;
>  	struct vnt_cmd_card_init *init_cmd = &priv->init_command;
>  	struct vnt_rsp_card_init *init_rsp = &priv->init_response;
>  	u8 antenna;
> @@ -435,7 +435,7 @@ static void vnt_free_int_bufs(struct vnt_private *priv)
> 
>  static int vnt_alloc_bufs(struct vnt_private *priv)
>  {
> -	int ret = 0;
> +	int ret;
>  	struct vnt_usb_send_context *tx_context;
>  	struct vnt_rcb *rcb;
>  	int ii;
> @@ -528,7 +528,7 @@ static void vnt_tx_80211(struct ieee80211_hw *hw,
> 
>  static int vnt_start(struct ieee80211_hw *hw)
>  {
> -	int ret = 0;
> +	int ret;
>  	struct vnt_private *priv = hw->priv;
> 
>  	priv->rx_buf_sz = MAX_TOTAL_SIZE_WITH_ALL_HEADERS;
> @@ -798,7 +798,7 @@ static u64 vnt_prepare_multicast(struct ieee80211_hw *hw,
>  	struct vnt_private *priv = hw->priv;
>  	struct netdev_hw_addr *ha;
>  	u64 mc_filter = 0;
> -	u32 bit_nr = 0;
> +	u32 bit_nr;
> 
>  	netdev_hw_addr_list_for_each(ha, mc_list) {
>  		bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26;
> @@ -973,7 +973,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
>  	struct vnt_private *priv;
>  	struct ieee80211_hw *hw;
>  	struct wiphy *wiphy;
> -	int rc = 0;
> +	int rc;
> 
>  	udev = usb_get_dev(interface_to_usbdev(intf));
> 
> --
> 2.20.1
> 

Looks good.

Reviewed-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk>

Thanks,
Quentin

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

end of thread, other threads:[~2020-03-02 15:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-01 13:50 [PATCH] staging: vt6656: Remove unnecessary local variables initialization Oscar Carter
2020-03-02 15:49 ` Quentin Deslandes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®