From: Takashi Iwai <tiwai@suse.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jaroslav Kysela <perex@perex.cz>,
alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] ALSA: ak411x: simplify snd_ak4113_create() a bit
Date: Mon, 23 Mar 2015 13:59:08 +0100 [thread overview]
Message-ID: <s5hr3sf50pv.wl-tiwai@suse.de> (raw)
In-Reply-To: <20150323093445.GA558@mwanda>
At Mon, 23 Mar 2015 12:34:46 +0300,
Dan Carpenter wrote:
>
> "err" is always a negative error code here, so there is no point in
> checking. Removing the check silences a static checker warning and
> makes the code a bit more clear. Also we don't need to initialize "err".
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied, thanks.
Takashi
>
> diff --git a/sound/i2c/other/ak4113.c b/sound/i2c/other/ak4113.c
> index 8884488..2183e9e 100644
> --- a/sound/i2c/other/ak4113.c
> +++ b/sound/i2c/other/ak4113.c
> @@ -73,7 +73,7 @@ int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read,
> void *private_data, struct ak4113 **r_ak4113)
> {
> struct ak4113 *chip;
> - int err = 0;
> + int err;
> unsigned char reg;
> static struct snd_device_ops ops = {
> .dev_free = snd_ak4113_dev_free,
> @@ -109,7 +109,7 @@ int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read,
>
> __fail:
> snd_ak4113_free(chip);
> - return err < 0 ? err : -EIO;
> + return err;
> }
> EXPORT_SYMBOL_GPL(snd_ak4113_create);
>
>
prev parent reply other threads:[~2015-03-23 12:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-23 9:34 [patch] ALSA: ak411x: simplify snd_ak4113_create() a bit Dan Carpenter
2015-03-23 12:59 ` Takashi Iwai [this message]
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=s5hr3sf50pv.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=perex@perex.cz \
/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