[PATCH v2 4/7] ALSA: pcm: Drop redundant nonseekable_open() return check
From: phucduc . bui
Date: Thu Jul 02 2026 - 05:18:35 EST
From: bui duc phuc <phucduc.bui@xxxxxxxxx>
nonseekable_open() always returns 0, so the error check is unnecessary.
Remove the dead error handling path.
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
sound/core/pcm_native.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 7dc0060617f1..7032f329e827 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -2873,9 +2873,10 @@ static int snd_pcm_open_file(struct file *file,
static int snd_pcm_playback_open(struct inode *inode, struct file *file)
{
struct snd_pcm *pcm;
- int err = nonseekable_open(inode, file);
- if (err < 0)
- return err;
+ int err;
+
+ nonseekable_open(inode, file);
+
pcm = snd_lookup_minor_data(iminor(inode),
SNDRV_DEVICE_TYPE_PCM_PLAYBACK);
err = snd_pcm_open(file, pcm, SNDRV_PCM_STREAM_PLAYBACK);
@@ -2887,9 +2888,10 @@ static int snd_pcm_playback_open(struct inode *inode, struct file *file)
static int snd_pcm_capture_open(struct inode *inode, struct file *file)
{
struct snd_pcm *pcm;
- int err = nonseekable_open(inode, file);
- if (err < 0)
- return err;
+ int err;
+
+ nonseekable_open(inode, file);
+
pcm = snd_lookup_minor_data(iminor(inode),
SNDRV_DEVICE_TYPE_PCM_CAPTURE);
err = snd_pcm_open(file, pcm, SNDRV_PCM_STREAM_CAPTURE);
--
2.43.0