From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Colin King <colin.king@canonical.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>, <alsa-devel@alsa-project.org>
Cc: <kernel-janitors@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][V2] ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret
Date: Mon, 10 Feb 2020 12:47:14 +0200 [thread overview]
Message-ID: <bc05a46a-fc38-c95f-4aa1-25034d3eb6cc@ti.com> (raw)
In-Reply-To: <20200210092423.327499-1-colin.king@canonical.com>
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
next prev parent reply other threads:[~2020-02-10 10:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2020-02-11 15:49 ` Applied "ASoC: ti: davinci-mcasp: remove redundant assignment to variable ret" to the asoc tree Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bc05a46a-fc38-c95f-4aa1-25034d3eb6cc@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=colin.king@canonical.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).