From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.de>,
Dimitris Papastamos <dp@opensource.wolfsonmicro.com>,
Wei Yongjun <yongjun_wei@trendmicro.com.cn>,
patches@opensource.wolfsonmicro.com, alsa-devel@alsa-project.org,
kernel-janitors@vger.kernel.org
Subject: Re: [patch] ASoC: wm0010: set error code on allocation failure
Date: Fri, 9 May 2014 17:18:08 +0100 [thread overview]
Message-ID: <20140509161808.GE25203@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <20140509115538.GB32027@mwanda>
On Fri, May 09, 2014 at 02:55:38PM +0300, Dan Carpenter wrote:
> We should return -ENOMEM if the kzalloc() fails instead of returning
> -ENOMEM.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/sound/soc/codecs/wm0010.c b/sound/soc/codecs/wm0010.c
> index 71ce315..8dac6c5 100644
> --- a/sound/soc/codecs/wm0010.c
> +++ b/sound/soc/codecs/wm0010.c
> @@ -682,6 +682,7 @@ static int wm0010_boot(struct snd_soc_codec *codec)
> if (!img_swap) {
> dev_err(codec->dev,
> "Failed to allocate image buffer\n");
> + ret = -ENOMEM;
No need to set this here, it is set 12 lines earlier. I agree the
current code is not the most clear, but this patch is superfluous
with the current state of the code.
Thanks,
Charles
WARNING: multiple messages have this Message-ID (diff)
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.de>,
Dimitris Papastamos <dp@opensource.wolfsonmicro.com>,
Wei Yongjun <yongjun_wei@trendmicro.com.cn>,
patches@opensource.wolfsonmicro.com, alsa-devel@alsa-project.org,
kernel-janitors@vger.kernel.org
Subject: Re: [patch] ASoC: wm0010: set error code on allocation failure
Date: Fri, 09 May 2014 16:18:08 +0000 [thread overview]
Message-ID: <20140509161808.GE25203@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <20140509115538.GB32027@mwanda>
On Fri, May 09, 2014 at 02:55:38PM +0300, Dan Carpenter wrote:
> We should return -ENOMEM if the kzalloc() fails instead of returning
> -ENOMEM.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/sound/soc/codecs/wm0010.c b/sound/soc/codecs/wm0010.c
> index 71ce315..8dac6c5 100644
> --- a/sound/soc/codecs/wm0010.c
> +++ b/sound/soc/codecs/wm0010.c
> @@ -682,6 +682,7 @@ static int wm0010_boot(struct snd_soc_codec *codec)
> if (!img_swap) {
> dev_err(codec->dev,
> "Failed to allocate image buffer\n");
> + ret = -ENOMEM;
No need to set this here, it is set 12 lines earlier. I agree the
current code is not the most clear, but this patch is superfluous
with the current state of the code.
Thanks,
Charles
next prev parent reply other threads:[~2014-05-09 16:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-09 11:55 [patch] ASoC: wm0010: set error code on allocation failure Dan Carpenter
2014-05-09 11:55 ` Dan Carpenter
2014-05-09 16:18 ` Charles Keepax [this message]
2014-05-09 16:18 ` Charles Keepax
2014-05-09 17:30 ` Dan Carpenter
2014-05-09 17:30 ` Dan Carpenter
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=20140509161808.GE25203@opensource.wolfsonmicro.com \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=dp@opensource.wolfsonmicro.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=patches@opensource.wolfsonmicro.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.de \
--cc=yongjun_wei@trendmicro.com.cn \
/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 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.