From patchwork Sun Sep 7 19:43:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Clemens Ladisch X-Patchwork-Id: 4859231 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E22BEC0338 for ; Sun, 7 Sep 2014 19:43:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 04F8820125 for ; Sun, 7 Sep 2014 19:43:43 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 0CC6320122 for ; Sun, 7 Sep 2014 19:43:42 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7A8E72610B0; Sun, 7 Sep 2014 21:43:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_SORBS_WEB,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 8397A2610B9; Sun, 7 Sep 2014 21:43:20 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 90AD32610B5; Sun, 7 Sep 2014 21:43:19 +0200 (CEST) Received: from dehamd003.servertools24.de (dehamd003.servertools24.de [31.47.254.18]) by alsa0.perex.cz (Postfix) with ESMTP id 3363A2608C7 for ; Sun, 7 Sep 2014 21:42:53 +0200 (CEST) Received: from [192.168.42.199] (tmo-096-176.customers.d1-online.com [80.187.96.176]) by dehamd003.servertools24.de (Postfix) with ESMTPSA id 883E7F814B; Sun, 7 Sep 2014 21:42:25 +0200 (CEST) Message-ID: <540CB56D.6080708@ladisch.de> Date: Sun, 07 Sep 2014 21:43:41 +0200 From: Clemens Ladisch User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Takashi Iwai References: <540CB520.50909@ladisch.de> In-Reply-To: <540CB520.50909@ladisch.de> X-PPP-Message-ID: <20140907194225.502727.13534@dehamd003.servertools24.de> X-PPP-Vhost: ladisch.de Cc: alsa-devel@alsa-project.org Subject: Re: [alsa-devel] [PATCH 0/5] ALSA: pcm: snd_interval_step: fix changes of open intervals X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Changing an interval boundary to a multiple of the step size makes that boundary exact. Signed-off-by: Clemens Ladisch --- sound/core/pcm_lib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 6fd5e1c..b03c7ae 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -1120,11 +1120,13 @@ static int snd_interval_step(struct snd_interval *i, unsigned int step) n = i->min % step; if (n != 0 || i->openmin) { i->min += step - n; + i->openmin = 0; changed = 1; } n = i->max % step; if (n != 0 || i->openmax) { i->max -= n; + i->openmax = 0; changed = 1; } if (snd_interval_checkempty(i)) {