* [alsa-devel] [PATCH] ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret
@ 2020-02-08 21:55 ` Colin King
0 siblings, 0 replies; 6+ messages in thread
From: Colin King @ 2020-02-08 21:55 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>
---
sound/soc/ti/davinci-mcasp.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
index e1e937eb1dc1..450c394b2882 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;
+ if (!pdata)
return pdata;
- }
} else {
/* control shouldn't reach here. something is wrong */
ret = -EINVAL;
--
2.25.0
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret
@ 2020-02-08 21:55 ` Colin King
0 siblings, 0 replies; 6+ messages in thread
From: Colin King @ 2020-02-08 21:55 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>
---
sound/soc/ti/davinci-mcasp.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
index e1e937eb1dc1..450c394b2882 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;
+ if (!pdata)
return pdata;
- }
} else {
/* control shouldn't reach here. something is wrong */
ret = -EINVAL;
--
2.25.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret
@ 2020-02-08 21:55 ` Colin King
0 siblings, 0 replies; 6+ messages in thread
From: Colin King @ 2020-02-08 21:55 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>
---
sound/soc/ti/davinci-mcasp.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
index e1e937eb1dc1..450c394b2882 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;
+ if (!pdata)
return pdata;
- }
} else {
/* control shouldn't reach here. something is wrong */
ret = -EINVAL;
--
2.25.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [alsa-devel] [PATCH] ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret
2020-02-08 21:55 ` Colin King
(?)
@ 2020-02-10 8:35 ` Dan Carpenter
-1 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2020-02-10 8:35 UTC (permalink / raw)
To: Colin King
Cc: alsa-devel, linux-kernel, kernel-janitors, Takashi Iwai,
Liam Girdwood, Peter Ujfalusi, Mark Brown
On Sat, Feb 08, 2020 at 09:55:23PM +0000, 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.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> sound/soc/ti/davinci-mcasp.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
> index e1e937eb1dc1..450c394b2882 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;
> + if (!pdata)
> return pdata;
Use a literal NULL for readability. "return NULL;".
regards,
dan carpenter
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret
@ 2020-02-10 8:35 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2020-02-10 8:35 UTC (permalink / raw)
To: Colin King
Cc: alsa-devel, linux-kernel, kernel-janitors, Takashi Iwai,
Liam Girdwood, Peter Ujfalusi, Mark Brown
On Sat, Feb 08, 2020 at 09:55:23PM +0000, 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.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> sound/soc/ti/davinci-mcasp.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
> index e1e937eb1dc1..450c394b2882 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;
> + if (!pdata)
> return pdata;
Use a literal NULL for readability. "return NULL;".
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret
@ 2020-02-10 8:35 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2020-02-10 8:35 UTC (permalink / raw)
To: Colin King
Cc: Peter Ujfalusi, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, alsa-devel, kernel-janitors, linux-kernel
On Sat, Feb 08, 2020 at 09:55:23PM +0000, 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.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> sound/soc/ti/davinci-mcasp.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
> index e1e937eb1dc1..450c394b2882 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;
> + if (!pdata)
> return pdata;
Use a literal NULL for readability. "return NULL;".
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-02-10 8:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-08 21:55 [alsa-devel] [PATCH] ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret Colin King
2020-02-08 21:55 ` Colin King
2020-02-08 21:55 ` Colin King
2020-02-10 8:35 ` [alsa-devel] " Dan Carpenter
2020-02-10 8:35 ` Dan Carpenter
2020-02-10 8:35 ` Dan Carpenter
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.