linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][V2] ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret
@ 2020-02-10  9:24 Colin King
  2020-02-10 10:47 ` Peter Ujfalusi
  2020-02-11 15:49 ` Applied "ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2020-02-10  9:24 UTC (permalink / raw)
  To: Peter Ujfalusi, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, alsa-devel
  Cc: kernel-janitors, linux-kernel

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

The assignment to ret is redundant as it is not used in the error
return path and hence can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
V2: explicitly return NULL to improve readability. Thanks to Dan Carpenter for
    suggesting this improvement.
---
 sound/soc/ti/davinci-mcasp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
index e1e937eb1dc1..6f97639c46cd 100644
--- a/sound/soc/ti/davinci-mcasp.c
+++ b/sound/soc/ti/davinci-mcasp.c
@@ -1764,10 +1764,8 @@ static struct davinci_mcasp_pdata *davinci_mcasp_set_pdata_from_of(
 	} else if (match) {
 		pdata = devm_kmemdup(&pdev->dev, match->data, sizeof(*pdata),
 				     GFP_KERNEL);
-		if (!pdata) {
-			ret = -ENOMEM;
-			return pdata;
-		}
+		if (!pdata)
+			return NULL;
 	} else {
 		/* control shouldn't reach here. something is wrong */
 		ret = -EINVAL;
-- 
2.25.0


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

* Re: [PATCH][V2] ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret
  2020-02-10  9:24 [PATCH][V2] ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret Colin King
@ 2020-02-10 10:47 ` Peter Ujfalusi
  2020-02-11 15:49 ` Applied "ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret" to the asoc tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Ujfalusi @ 2020-02-10 10:47 UTC (permalink / raw)
  To: Colin King, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, alsa-devel
  Cc: kernel-janitors, linux-kernel



On 10/02/2020 11.24, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The assignment to ret is redundant as it is not used in the error
> return path and hence can be removed.

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> V2: explicitly return NULL to improve readability. Thanks to Dan Carpenter for
>     suggesting this improvement.
> ---
>  sound/soc/ti/davinci-mcasp.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
> index e1e937eb1dc1..6f97639c46cd 100644
> --- a/sound/soc/ti/davinci-mcasp.c
> +++ b/sound/soc/ti/davinci-mcasp.c
> @@ -1764,10 +1764,8 @@ static struct davinci_mcasp_pdata *davinci_mcasp_set_pdata_from_of(
>  	} else if (match) {
>  		pdata = devm_kmemdup(&pdev->dev, match->data, sizeof(*pdata),
>  				     GFP_KERNEL);
> -		if (!pdata) {
> -			ret = -ENOMEM;
> -			return pdata;
> -		}
> +		if (!pdata)
> +			return NULL;
>  	} else {
>  		/* control shouldn't reach here. something is wrong */
>  		ret = -EINVAL;
> 

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* Applied "ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret" to the asoc tree
  2020-02-10  9:24 [PATCH][V2] ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret Colin King
  2020-02-10 10:47 ` Peter Ujfalusi
@ 2020-02-11 15:49 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2020-02-11 15:49 UTC (permalink / raw)
  To: Colin Ian King
  Cc: alsa-devel, Jaroslav Kysela, kernel-janitors, Liam Girdwood,
	linux-kernel, Mark Brown, Peter Ujfalusi, Takashi Iwai

The patch

   ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.7

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From f4d95de415b286090c1bf739c20a5ea2aefda834 Mon Sep 17 00:00:00 2001
From: Colin Ian King <colin.king@canonical.com>
Date: Mon, 10 Feb 2020 09:24:22 +0000
Subject: [PATCH] ASoC: ti: davinci-mcasp: remove redundant assignment to
 variable ret

The assignment to ret is redundant as it is not used in the error
return path and hence can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20200210092423.327499-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/ti/davinci-mcasp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
index d9c3a3210a24..734ffe925c4d 100644
--- a/sound/soc/ti/davinci-mcasp.c
+++ b/sound/soc/ti/davinci-mcasp.c
@@ -1765,10 +1765,8 @@ static struct davinci_mcasp_pdata *davinci_mcasp_set_pdata_from_of(
 	} else if (match) {
 		pdata = devm_kmemdup(&pdev->dev, match->data, sizeof(*pdata),
 				     GFP_KERNEL);
-		if (!pdata) {
-			ret = -ENOMEM;
-			return pdata;
-		}
+		if (!pdata)
+			return NULL;
 	} else {
 		/* control shouldn't reach here. something is wrong */
 		ret = -EINVAL;
-- 
2.20.1


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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-10  9:24 [PATCH][V2] ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret Colin King
2020-02-10 10:47 ` Peter Ujfalusi
2020-02-11 15:49 ` Applied "ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret" to the asoc tree Mark Brown

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).