From: Takashi Iwai Subject: Re: [PATCH] snd_mixer_poll_descriptors_revents: iterate over all descriptors Date: Mon, 08 Aug 2011 09:18:56 +0200 Message-ID: References: <201108041206.19476.nive@nivalis.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 66CB910380B for ; Mon, 8 Aug 2011 09:18:56 +0200 (CEST) In-Reply-To: <201108041206.19476.nive@nivalis.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Olivier Trichet Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Thu, 4 Aug 2011 12:06:19 +0200, Olivier Trichet wrote: > > [1 ] > Hello, > > Reading the method snd_mixer_poll_descriptors_revents, it seems to me that the > iteration over the array 'pfds' is wrong. > Shouldn't the attached patch be applied? > > Regards, > Olivier > [2 0001-snd_mixer_poll_descriptors_revents-iterate-over-all-.patch ] > diff --git a/src/mixer/mixer.c b/src/mixer/mixer.c > index 85d843f..c3269ea 100644 > --- a/src/mixer/mixer.c > +++ b/src/mixer/mixer.c > @@ -744,7 +744,7 @@ int snd_mixer_poll_descriptors_revents(snd_mixer_t *mixer, struct pollfd *pfds, > return -EINVAL; > res = 0; > for (idx = 0; idx < nfds; idx++) > - res |= pfds->revents & (POLLIN|POLLERR|POLLNVAL); > + res |= pfds[i]->revents & (POLLIN|POLLERR|POLLNVAL); You mean idx instead of i, right? thanks, Takashi