* [PATCH] ALSA: asihpi: Combine multiple if statements
@ 2025-04-08 12:29 Thorsten Blum
0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2025-04-08 12:29 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai, Thomas Gleixner, Ingo Molnar,
Zhu Jun
Cc: Thorsten Blum, Takashi Iwai, linux-sound, linux-kernel
Combine multiple if statements into a single code block to improve
readability. No functional changes intended.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
sound/pci/asihpi/asihpi.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c
index 5a84591b13fc..6c32df43d1ec 100644
--- a/sound/pci/asihpi/asihpi.c
+++ b/sound/pci/asihpi/asihpi.c
@@ -982,12 +982,12 @@ static int snd_card_asihpi_playback_open(struct snd_pcm_substream *substream)
err = hpi_outstream_open(card->hpi->adapter->index,
substream->number, &dpcm->h_stream);
hpi_handle_error(err);
- if (err)
+ if (err) {
kfree(dpcm);
- if (err == HPI_ERROR_OBJ_ALREADY_OPEN)
- return -EBUSY;
- if (err)
+ if (err == HPI_ERROR_OBJ_ALREADY_OPEN)
+ return -EBUSY;
return -EIO;
+ }
/*? also check ASI5000 samplerate source
If external, only support external rate.
@@ -1156,12 +1156,12 @@ static int snd_card_asihpi_capture_open(struct snd_pcm_substream *substream)
err = hpi_handle_error(
hpi_instream_open(card->hpi->adapter->index,
substream->number, &dpcm->h_stream));
- if (err)
+ if (err) {
kfree(dpcm);
- if (err == HPI_ERROR_OBJ_ALREADY_OPEN)
- return -EBUSY;
- if (err)
+ if (err == HPI_ERROR_OBJ_ALREADY_OPEN)
+ return -EBUSY;
return -EIO;
+ }
timer_setup(&dpcm->timer, snd_card_asihpi_timer_function, 0);
dpcm->substream = substream;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-04-08 12:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-08 12:29 [PATCH] ALSA: asihpi: Combine multiple if statements Thorsten Blum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox