linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libertas: remove redundant assignment to variable ret
@ 2019-10-02 10:15 Colin King
  2019-10-02 13:17 ` Dan Carpenter
  2019-10-04 13:46 ` Kalle Valo
  0 siblings, 2 replies; 5+ messages in thread
From: Colin King @ 2019-10-02 10:15 UTC (permalink / raw)
  To: Kalle Valo, David S . Miller, libertas-dev, linux-wireless, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The variable ret is being assigned a value that is never read and is
being re-assigned a little later on. The assignment is redundant and hence
can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/marvell/libertas/mesh.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/libertas/mesh.c b/drivers/net/wireless/marvell/libertas/mesh.c
index 2747c957d18c..44c8a550da4c 100644
--- a/drivers/net/wireless/marvell/libertas/mesh.c
+++ b/drivers/net/wireless/marvell/libertas/mesh.c
@@ -1003,7 +1003,6 @@ static int lbs_add_mesh(struct lbs_private *priv)
 	if (priv->mesh_tlv) {
 		sprintf(mesh_wdev->ssid, "mesh");
 		mesh_wdev->mesh_id_up_len = 4;
-		ret = 1;
 	}
 
 	mesh_wdev->netdev = mesh_dev;
-- 
2.20.1


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

* Re: [PATCH] libertas: remove redundant assignment to variable ret
  2019-10-02 10:15 [PATCH] libertas: remove redundant assignment to variable ret Colin King
@ 2019-10-02 13:17 ` Dan Carpenter
  2019-10-04 13:46 ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2019-10-02 13:17 UTC (permalink / raw)
  To: Colin King, Lubomir Rintel
  Cc: Kalle Valo, David S . Miller, libertas-dev, linux-wireless,
	netdev, kernel-janitors, linux-kernel

Added Lubomir Rintel to the CC list.

On Wed, Oct 02, 2019 at 11:15:17AM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable ret is being assigned a value that is never read and is
> being re-assigned a little later on. The assignment is redundant and hence
> can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/net/wireless/marvell/libertas/mesh.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/marvell/libertas/mesh.c b/drivers/net/wireless/marvell/libertas/mesh.c
> index 2747c957d18c..44c8a550da4c 100644
> --- a/drivers/net/wireless/marvell/libertas/mesh.c
> +++ b/drivers/net/wireless/marvell/libertas/mesh.c
> @@ -1003,7 +1003,6 @@ static int lbs_add_mesh(struct lbs_private *priv)
>  	if (priv->mesh_tlv) {
>  		sprintf(mesh_wdev->ssid, "mesh");
>  		mesh_wdev->mesh_id_up_len = 4;
> -		ret = 1;
>  	}

Removing this is fine.  "ret = 1" is a mistake.

This was copy and pasted in commit 2199c9817670 ("libertas: use
mesh_wdev->ssid instead of priv->mesh_ssid").  The return value was
never used so it's not clear what returning 1 vs 0 was supposed to mean.

lbs_init_mesh() should just be a void function.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>

regards,
dan carpenter

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

* Re: [PATCH] libertas: remove redundant assignment to variable ret
  2019-10-02 10:15 [PATCH] libertas: remove redundant assignment to variable ret Colin King
  2019-10-02 13:17 ` Dan Carpenter
@ 2019-10-04 13:46 ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2019-10-04 13:46 UTC (permalink / raw)
  To: Colin King
  Cc: David S . Miller, libertas-dev, linux-wireless, netdev,
	kernel-janitors, linux-kernel

Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable ret is being assigned a value that is never read and is
> being re-assigned a little later on. The assignment is redundant and hence
> can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>

Patch applied to wireless-drivers-next.git, thanks.

60b5b49f6a6e libertas: remove redundant assignment to variable ret

-- 
https://patchwork.kernel.org/patch/11170731/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

* Re: [PATCH] libertas: remove redundant assignment to variable ret
  2019-07-05  8:17 Colin King
@ 2019-07-24 11:44 ` Kalle Valo
  0 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2019-07-24 11:44 UTC (permalink / raw)
  To: Colin King
  Cc: David S . Miller, libertas-dev, linux-wireless, netdev,
	kernel-janitors, linux-kernel

Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable ret is being initialized with a value that is never
> read and it is being updated later with a new value. The
> initialization is redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Patch applied to wireless-drivers-next.git, thanks.

4c8a46851019 libertas: remove redundant assignment to variable ret

-- 
https://patchwork.kernel.org/patch/11032181/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

* [PATCH] libertas: remove redundant assignment to variable ret
@ 2019-07-05  8:17 Colin King
  2019-07-24 11:44 ` Kalle Valo
  0 siblings, 1 reply; 5+ messages in thread
From: Colin King @ 2019-07-05  8:17 UTC (permalink / raw)
  To: Kalle Valo, David S . Miller, libertas-dev, linux-wireless, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The variable ret is being initialized with a value that is never
read and it is being updated later with a new value. The
initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/marvell/libertas/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/libertas/main.c b/drivers/net/wireless/marvell/libertas/main.c
index 5968852b65a7..2233b59cdf44 100644
--- a/drivers/net/wireless/marvell/libertas/main.c
+++ b/drivers/net/wireless/marvell/libertas/main.c
@@ -1046,7 +1046,7 @@ int lbs_rtap_supported(struct lbs_private *priv)
 int lbs_start_card(struct lbs_private *priv)
 {
 	struct net_device *dev = priv->dev;
-	int ret = -1;
+	int ret;
 
 	/* poke the firmware */
 	ret = lbs_setup_firmware(priv);
-- 
2.20.1


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

end of thread, other threads:[~2019-10-04 13:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-02 10:15 [PATCH] libertas: remove redundant assignment to variable ret Colin King
2019-10-02 13:17 ` Dan Carpenter
2019-10-04 13:46 ` Kalle Valo
  -- strict thread matches above, loose matches on Subject: below --
2019-07-05  8:17 Colin King
2019-07-24 11:44 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).