Skip to contentSkip to conversation

ALSA: core: Drop redundant stream_open() return check

PATCH Superseded [email protected] 1 participant 1 message Jul 2 Sound

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: core: Drop redundant stream_open() return check

From: bui duc phuc <[email protected]>

The previous conversion from nonseekable_open() to stream_open() retained the existing error check.
Since stream_open() always returns 0, remove the dead error handling path.

---
 sound/core/rawmidi.c           | 4 +---
 sound/core/seq/seq_clientmgr.c | 5 +----
 sound/core/timer.c             | 5 +----
 3 files changed, 3 insertions(+), 11 deletions(-)
sound/core/rawmidi.c +1 -3
index 4dfd9d53e6d3..789254a88e53 100644
@@ -441,9 +441,7 @@ static int snd_rawmidi_open(struct inode *inode, struct file *file)
 	if ((file->f_flags & O_APPEND) && !(file->f_flags & O_NONBLOCK))
 		return -EINVAL;		/* invalid combination */
 
-	err = stream_open(inode, file);
-	if (err < 0)
-		return err;
+	stream_open(inode, file);
 
 	if (maj == snd_major) {
 		rmidi = snd_lookup_minor_data(iminor(inode),
sound/core/seq/seq_clientmgr.c +1 -4
index 28782e1776fa..8fe872367568 100644
@@ -296,11 +296,8 @@ static int snd_seq_open(struct inode *inode, struct file *file)
 	int c, mode;			/* client id */
 	struct snd_seq_client *client;
 	struct snd_seq_user_client *user;
-	int err;
 
-	err = stream_open(inode, file);
-	if (err < 0)
-		return err;
+	stream_open(inode, file);
 
 	scoped_guard(mutex, &register_mutex) {
 		client = seq_create_client1(-1, SNDRV_SEQ_DEFAULT_EVENTS);
sound/core/timer.c +1 -4
index 51c6ac4df9f4..937d7996f7ab 100644
@@ -1531,11 +1531,8 @@ static int realloc_user_queue(struct snd_timer_user *tu, int size)
 static int snd_timer_user_open(struct inode *inode, struct file *file)
 {
 	struct snd_timer_user *tu;
-	int err;
 
-	err = stream_open(inode, file);
-	if (err < 0)
-		return err;
+	stream_open(inode, file);
 
 	tu = kzalloc_obj(*tu);
 	if (tu == NULL)
Signature · 1 line
2.43.0