From: Takashi Iwai Subject: Re: [PATCH alsa-lib 0/1] bug fix and comment on "switch" Date: Mon, 14 May 2012 16:58:49 +0200 Message-ID: References: <1336838783-30686-1-git-send-email-borneo.antonio@gmail.com> 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 E4C96249F2 for ; Mon, 14 May 2012 16:58:49 +0200 (CEST) In-Reply-To: <1336838783-30686-1-git-send-email-borneo.antonio@gmail.com> 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: Antonio Borneo Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Sun, 13 May 2012 00:06:22 +0800, Antonio Borneo wrote: > > Hi, > > this is a very simple one line patch but the issue was > driving me crazy for few days. > > After this finding, I have reviewed all the "switch" > statements in alsa-lib. All well done with proper comment > when a "case" falls through the next "case". Thanks, applied the patch now. > But there is one "switch" that does not follow the usual > scheme. > In file src/pcm/pcm_dsnoop.c > procedure snd_pcm_dsnoop_delay() > following code fragment: > > switch(dsnoop->state) { > case SNDRV_PCM_STATE_DRAINING: > case SNDRV_PCM_STATE_RUNNING: > err = snd_pcm_dsnoop_sync_ptr(pcm); > if (err < 0) > return err; > case SNDRV_PCM_STATE_PREPARED: > case SNDRV_PCM_STATE_SUSPENDED: > *delayp = snd_pcm_mmap_capture_hw_avail(pcm); > return 0; > > If snd_pcm_dsnoop_sync_ptr() returns no error, execution > falls through next "case". > It's missing the usual comment > /* Fall through */ > to highlight such code behavior. > I think the code is correct, but I do not have enough > experience on alsa-lib to be sure. Please confirm. > In such case, I would suggest adding the comment above. Yes, the comment should be added. Care to send a patch? Takashi