All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Removing an assert
@ 2012-07-05  7:55 Martin Sandsmark
  2012-07-05  8:09 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Sandsmark @ 2012-07-05  7:55 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 444 bytes --]

Hi!

There is an assert in snd_hctl_handle_event in alsa-lib that gets triggered on 
every login for many KDE users. From what I can see it is superflous, and gets 
triggered because the device in an event has gone away. This case is handled 
just beneath the assert as well, and I therefore don't see the reason for this 
assert at all.

Entry in bug tracker:
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5471


-- 
Martin Sandsmark

[-- Attachment #2: 0001-Remove-a-useless-assert.patch --]
[-- Type: text/x-patch, Size: 934 bytes --]

>From dff3de9705eb617b619251c2aec30d5ca9c13046 Mon Sep 17 00:00:00 2001
From: Martin Sandsmark <martin.sandsmark@kde.org>
Date: Thu, 5 Jul 2012 09:40:07 +0200
Subject: [PATCH] Remove a useless assert.

The case where the element is unavailable (for example gone away since
the event was created) is handled beneath.

See also bug 5471.
---
 src/control/hcontrol.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/control/hcontrol.c b/src/control/hcontrol.c
index 8ffc434..ee1d907 100644
--- a/src/control/hcontrol.c
+++ b/src/control/hcontrol.c
@@ -761,7 +761,6 @@ static int snd_hctl_handle_event(snd_hctl_t *hctl, snd_ctl_event_t *event)
 	if (event->data.elem.mask & (SNDRV_CTL_EVENT_MASK_VALUE |
 				     SNDRV_CTL_EVENT_MASK_INFO)) {
 		elem = snd_hctl_find_elem(hctl, &event->data.elem.id);
-		assert(elem);
 		if (!elem)
 			return -ENOENT;
 		res = snd_hctl_elem_throw_event(elem, event->data.elem.mask &
-- 
1.7.11.1


[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH] Removing an assert
  2012-07-05  7:55 [PATCH] Removing an assert Martin Sandsmark
@ 2012-07-05  8:09 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2012-07-05  8:09 UTC (permalink / raw)
  To: Martin Sandsmark; +Cc: alsa-devel

At Thu, 05 Jul 2012 09:55:23 +0200,
Martin Sandsmark wrote:
> 
> Hi!
> 
> There is an assert in snd_hctl_handle_event in alsa-lib that gets triggered on 
> every login for many KDE users. From what I can see it is superflous, and gets 
> triggered because the device in an event has gone away. This case is handled 
> just beneath the assert as well, and I therefore don't see the reason for this 
> assert at all.
> 
> Entry in bug tracker:
> https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5471

Thanks, applied now to git tree.


Takashi

> 
> 
> -- 
> Martin Sandsmark
> [2 0001-Remove-a-useless-assert.patch <text/x-patch; UTF-8 (7bit)>]
> >From dff3de9705eb617b619251c2aec30d5ca9c13046 Mon Sep 17 00:00:00 2001
> From: Martin Sandsmark <martin.sandsmark@kde.org>
> Date: Thu, 5 Jul 2012 09:40:07 +0200
> Subject: [PATCH] Remove a useless assert.
> 
> The case where the element is unavailable (for example gone away since
> the event was created) is handled beneath.
> 
> See also bug 5471.
> ---
>  src/control/hcontrol.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/src/control/hcontrol.c b/src/control/hcontrol.c
> index 8ffc434..ee1d907 100644
> --- a/src/control/hcontrol.c
> +++ b/src/control/hcontrol.c
> @@ -761,7 +761,6 @@ static int snd_hctl_handle_event(snd_hctl_t *hctl, snd_ctl_event_t *event)
>  	if (event->data.elem.mask & (SNDRV_CTL_EVENT_MASK_VALUE |
>  				     SNDRV_CTL_EVENT_MASK_INFO)) {
>  		elem = snd_hctl_find_elem(hctl, &event->data.elem.id);
> -		assert(elem);
>  		if (!elem)
>  			return -ENOENT;
>  		res = snd_hctl_elem_throw_event(elem, event->data.elem.mask &
> -- 
> 1.7.11.1
> 
> [3  <text/plain; us-ascii (7bit)>]
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

end of thread, other threads:[~2012-07-05  8:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-05  7:55 [PATCH] Removing an assert Martin Sandsmark
2012-07-05  8:09 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.