From patchwork Fri Jun 30 11:37:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 9819345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8C5F360224 for ; Fri, 30 Jun 2017 11:38:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B2272522B for ; Fri, 30 Jun 2017 11:38:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6EE24285F1; Fri, 30 Jun 2017 11:38:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1D0D2522B for ; Fri, 30 Jun 2017 11:38:14 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 040E02674A2; Fri, 30 Jun 2017 13:37:45 +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 421262674B3; Fri, 30 Jun 2017 13:37:41 +0200 (CEST) Received: from smtp-proxy002.phy.lolipop.jp (smtp-proxy002.phy.lolipop.jp [157.7.104.43]) by alsa0.perex.cz (Postfix) with ESMTP id 7AF192674A3 for ; Fri, 30 Jun 2017 13:37:36 +0200 (CEST) Received: from smtp-proxy002.phy.lolipop.lan (HELO smtp-proxy002.phy.lolipop.jp) (172.19.44.43) (smtp-auth username m12129643-o-takashi, mechanism plain) by smtp-proxy002.phy.lolipop.jp (qpsmtpd/0.82) with ESMTPA; Fri, 30 Jun 2017 20:37:31 +0900 Received: from 127.0.0.1 (127.0.0.1) by smtp-proxy002.phy.lolipop.jp (LOLIPOP-Fsecure); Fri, 30 Jun 2017 20:37:29 +0900 (JST) X-Virus-Status: clean(LOLIPOP-Fsecure) From: Takashi Sakamoto To: tiwai@suse.de Date: Fri, 30 Jun 2017 20:37:29 +0900 Message-Id: <20170630113729.13656-7-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170630113729.13656-1-o-takashi@sakamocchi.jp> References: <20170630113729.13656-1-o-takashi@sakamocchi.jp> Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH alsa-lib v2 6/6] pcm: hw: remove superfluous code to call of SNDRV_PCM_IOCTL_SYNC_PTR in snd_pcm_hw_forward() 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP SNDRV_PCM_IOCTL_SYNC_PTR command was introduced to PCM protocol/interface in its version 2.0.7, however this command is used in a branch for the newer version protocol/interface in snd_pcm_hw_forward(). This commit removes the superfluous code as a part of work for code refactoring. Fixes: eafb4925124b ("- added SYNC_PTR ioctl support for pcm_hw plugin") Signed-off-by: Takashi Sakamoto --- src/pcm/pcm_hw.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c index 9c8fc3f6..16d45e74 100644 --- a/src/pcm/pcm_hw.c +++ b/src/pcm/pcm_hw.c @@ -144,13 +144,6 @@ static int sync_ptr1(snd_pcm_hw_t *hw, unsigned int flags) return 0; } -static int sync_ptr(snd_pcm_hw_t *hw, unsigned int flags) -{ - if (hw->mmap_status_fallbacked || hw->mmap_control_fallbacked) - return sync_ptr1(hw, flags); - return 0; -} - static int issue_avail_min(snd_pcm_hw_t *hw) { if (!hw->mmap_control_fallbacked) @@ -777,9 +770,6 @@ static snd_pcm_sframes_t snd_pcm_hw_forward(snd_pcm_t *pcm, snd_pcm_uframes_t fr } else { snd_pcm_sframes_t avail; - err = sync_ptr(hw, SNDRV_PCM_SYNC_PTR_HWSYNC); - if (err < 0) - return err; switch (FAST_PCM_STATE(hw)) { case SNDRV_PCM_STATE_RUNNING: case SNDRV_PCM_STATE_DRAINING: @@ -797,9 +787,6 @@ static snd_pcm_sframes_t snd_pcm_hw_forward(snd_pcm_t *pcm, snd_pcm_uframes_t fr if (frames > (snd_pcm_uframes_t)avail) frames = avail; snd_pcm_mmap_appl_forward(pcm, frames); - err = sync_ptr(hw, 0); - if (err < 0) - return err; return frames; } }