Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1441229 > unrolled thread
| Started by | Colin King <colin.king@canonical.com> |
|---|---|
| First post | 2016-07-12 12:30 +0200 |
| Last post | 2016-07-12 12:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] ALSA: ak4117: remove redundant check on err being < 0 Colin King <colin.king@canonical.com> - 2016-07-12 12:30 +0200
Re: [PATCH] ALSA: ak4117: remove redundant check on err being < 0 Takashi Iwai <tiwai@suse.de> - 2016-07-12 12:30 +0200
| From | Colin King <colin.king@canonical.com> |
|---|---|
| Date | 2016-07-12 12:30 +0200 |
| Subject | [PATCH] ALSA: ak4117: remove redundant check on err being < 0 |
| Message-ID | <rU36V-3AD-3@gated-at.bofh.it> |
From: Colin Ian King <colin.king@canonical.com>
snd_ak4117_create checks if the error return err is less than zero
or not. This is a redundant check, err can only be < 0 to get to
the __fail label, in which case just return err and remove the
redundant check (since we never return -EIO).
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
sound/i2c/other/ak4117.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/i2c/other/ak4117.c b/sound/i2c/other/ak4117.c
index 48848909..0702f05 100644
--- a/sound/i2c/other/ak4117.c
+++ b/sound/i2c/other/ak4117.c
@@ -110,7 +110,7 @@ int snd_ak4117_create(struct snd_card *card, ak4117_read_t *read, ak4117_write_t
__fail:
snd_ak4117_free(chip);
- return err < 0 ? err : -EIO;
+ return err;
}
void snd_ak4117_reg_write(struct ak4117 *chip, unsigned char reg, unsigned char mask, unsigned char val)
--
2.8.1
[toc] | [next] | [standalone]
| From | Takashi Iwai <tiwai@suse.de> |
|---|---|
| Date | 2016-07-12 12:30 +0200 |
| Message-ID | <rU36V-3AD-1@gated-at.bofh.it> |
| In reply to | #1441229 |
On Tue, 12 Jul 2016 12:22:40 +0200, Colin King wrote: > > From: Colin Ian King <colin.king@canonical.com> > > snd_ak4117_create checks if the error return err is less than zero > or not. This is a redundant check, err can only be < 0 to get to > the __fail label, in which case just return err and remove the > redundant check (since we never return -EIO). > > Signed-off-by: Colin Ian King <colin.king@canonical.com> Applied, thanks. Takashi
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web