mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ALSA: ak4117: remove redundant check on err being < 0
@ 2016-07-12 10:22 Colin King
  2016-07-12 10:27 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2016-07-12 10:22 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, alsa-devel; +Cc: linux-kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: ak4117: remove redundant check on err being < 0
  2016-07-12 10:22 [PATCH] ALSA: ak4117: remove redundant check on err being < 0 Colin King
@ 2016-07-12 10:27 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2016-07-12 10:27 UTC (permalink / raw)
  To: Colin King; +Cc: alsa-devel, Jaroslav Kysela, linux-kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-12 10:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-12 10:22 [PATCH] ALSA: ak4117: remove redundant check on err being < 0 Colin King
2016-07-12 10:27 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®