Commit 3531df81 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: seq: Drop superfluous filter argument of get_event_dest_client()

All callers of get_event_dest_clienter() pass 0 to the filter
argument, and it means that the check there is utterly redundant.

Drop the superfluous filter argument and its check as a code cleanup.

Link: https://patch.msgid.link/20240819084757.11902-1-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 32108c22
...@@ -70,7 +70,7 @@ static int bounce_error_event(struct snd_seq_client *client, ...@@ -70,7 +70,7 @@ static int bounce_error_event(struct snd_seq_client *client,
int err, int atomic, int hop); int err, int atomic, int hop);
static int snd_seq_deliver_single_event(struct snd_seq_client *client, static int snd_seq_deliver_single_event(struct snd_seq_client *client,
struct snd_seq_event *event, struct snd_seq_event *event,
int filter, int atomic, int hop); int atomic, int hop);
#if IS_ENABLED(CONFIG_SND_SEQ_UMP) #if IS_ENABLED(CONFIG_SND_SEQ_UMP)
static void free_ump_info(struct snd_seq_client *client); static void free_ump_info(struct snd_seq_client *client);
...@@ -525,10 +525,8 @@ static int check_port_perm(struct snd_seq_client_port *port, unsigned int flags) ...@@ -525,10 +525,8 @@ static int check_port_perm(struct snd_seq_client_port *port, unsigned int flags)
/* /*
* check if the destination client is available, and return the pointer * check if the destination client is available, and return the pointer
* if filter is non-zero, client filter bitmap is tested.
*/ */
static struct snd_seq_client *get_event_dest_client(struct snd_seq_event *event, static struct snd_seq_client *get_event_dest_client(struct snd_seq_event *event)
int filter)
{ {
struct snd_seq_client *dest; struct snd_seq_client *dest;
...@@ -543,8 +541,6 @@ static struct snd_seq_client *get_event_dest_client(struct snd_seq_event *event, ...@@ -543,8 +541,6 @@ static struct snd_seq_client *get_event_dest_client(struct snd_seq_event *event,
if ((dest->filter & SNDRV_SEQ_FILTER_USE_EVENT) && if ((dest->filter & SNDRV_SEQ_FILTER_USE_EVENT) &&
! test_bit(event->type, dest->event_filter)) ! test_bit(event->type, dest->event_filter))
goto __not_avail; goto __not_avail;
if (filter && !(dest->filter & filter))
goto __not_avail;
return dest; /* ok - accessible */ return dest; /* ok - accessible */
__not_avail: __not_avail:
...@@ -588,7 +584,7 @@ static int bounce_error_event(struct snd_seq_client *client, ...@@ -588,7 +584,7 @@ static int bounce_error_event(struct snd_seq_client *client,
bounce_ev.data.quote.origin = event->dest; bounce_ev.data.quote.origin = event->dest;
bounce_ev.data.quote.event = event; bounce_ev.data.quote.event = event;
bounce_ev.data.quote.value = -err; /* use positive value */ bounce_ev.data.quote.value = -err; /* use positive value */
result = snd_seq_deliver_single_event(NULL, &bounce_ev, 0, atomic, hop + 1); result = snd_seq_deliver_single_event(NULL, &bounce_ev, atomic, hop + 1);
if (result < 0) { if (result < 0) {
client->event_lost++; client->event_lost++;
return result; return result;
...@@ -655,7 +651,7 @@ int __snd_seq_deliver_single_event(struct snd_seq_client *dest, ...@@ -655,7 +651,7 @@ int __snd_seq_deliver_single_event(struct snd_seq_client *dest,
*/ */
static int snd_seq_deliver_single_event(struct snd_seq_client *client, static int snd_seq_deliver_single_event(struct snd_seq_client *client,
struct snd_seq_event *event, struct snd_seq_event *event,
int filter, int atomic, int hop) int atomic, int hop)
{ {
struct snd_seq_client *dest = NULL; struct snd_seq_client *dest = NULL;
struct snd_seq_client_port *dest_port = NULL; struct snd_seq_client_port *dest_port = NULL;
...@@ -664,7 +660,7 @@ static int snd_seq_deliver_single_event(struct snd_seq_client *client, ...@@ -664,7 +660,7 @@ static int snd_seq_deliver_single_event(struct snd_seq_client *client,
direct = snd_seq_ev_is_direct(event); direct = snd_seq_ev_is_direct(event);
dest = get_event_dest_client(event, filter); dest = get_event_dest_client(event);
if (dest == NULL) if (dest == NULL)
goto __skip; goto __skip;
dest_port = snd_seq_port_use_ptr(dest, event->dest.port); dest_port = snd_seq_port_use_ptr(dest, event->dest.port);
...@@ -744,8 +740,7 @@ static int __deliver_to_subscribers(struct snd_seq_client *client, ...@@ -744,8 +740,7 @@ static int __deliver_to_subscribers(struct snd_seq_client *client,
/* convert time according to flag with subscription */ /* convert time according to flag with subscription */
update_timestamp_of_queue(event, subs->info.queue, update_timestamp_of_queue(event, subs->info.queue,
subs->info.flags & SNDRV_SEQ_PORT_SUBS_TIME_REAL); subs->info.flags & SNDRV_SEQ_PORT_SUBS_TIME_REAL);
err = snd_seq_deliver_single_event(client, event, err = snd_seq_deliver_single_event(client, event, atomic, hop);
0, atomic, hop);
if (err < 0) { if (err < 0) {
/* save first error that occurs and continue */ /* save first error that occurs and continue */
if (!result) if (!result)
...@@ -818,7 +813,7 @@ static int snd_seq_deliver_event(struct snd_seq_client *client, struct snd_seq_e ...@@ -818,7 +813,7 @@ static int snd_seq_deliver_event(struct snd_seq_client *client, struct snd_seq_e
event->dest.client == SNDRV_SEQ_ADDRESS_SUBSCRIBERS) event->dest.client == SNDRV_SEQ_ADDRESS_SUBSCRIBERS)
result = deliver_to_subscribers(client, event, atomic, hop); result = deliver_to_subscribers(client, event, atomic, hop);
else else
result = snd_seq_deliver_single_event(client, event, 0, atomic, hop); result = snd_seq_deliver_single_event(client, event, atomic, hop);
return result; return result;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment