From patchwork Mon Jan 23 11:08:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Menzel X-Patchwork-Id: 9536503 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 7F431601D7 for ; Wed, 25 Jan 2017 08:04:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C91826E77 for ; Wed, 25 Jan 2017 08:04:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 609D027D85; Wed, 25 Jan 2017 08:04:03 +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 2FFE326E77 for ; Wed, 25 Jan 2017 08:04:01 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id A55152675F4; Wed, 25 Jan 2017 09:04:00 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id DC7C62675E1; Wed, 25 Jan 2017 09:01:41 +0100 (CET) X-Original-To: alsa-devel@mailman.alsa-project.org Delivered-To: alsa-devel@mailman.alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 91ABE266B91; Mon, 23 Jan 2017 12:08:53 +0100 (CET) Received: from mx1.molgen.mpg.de (mx1.molgen.mpg.de [141.14.17.9]) by alsa0.perex.cz (Postfix) with ESMTP id 95863266B85 for ; Mon, 23 Jan 2017 12:08:48 +0100 (CET) Received: from keineahnung.molgen.mpg.de (keineahnung.molgen.mpg.de [141.14.17.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id B15032012A59E6 for ; Mon, 23 Jan 2017 12:08:47 +0100 (CET) To: alsa-devel@mailman.alsa-project.org From: Paul Menzel Message-ID: Date: Mon, 23 Jan 2017 12:08:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 25 Jan 2017 07:48:35 +0100 Subject: [alsa-devel] [PATCH] alsaloop: Correct check in if condition 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 Date: Mon, 23 Jan 2017 11:45:13 +0100 Fix the error below found by gcc (Debian 6.3.0-4) 6.3.0 20170121. ``` gcc -DHAVE_CONFIG_H -I. -I../include -I../include -D_GNU_SOURCE -O2 -Wall -pipe -g -MT pcmjob.o -MD -MP -MF .deps/pcmjob.Tpo -c -o pcmjob.o pcmjob.c pcmjob.c: In function 'pcmjob_start': pcmjob.c:1482:27: warning: self-comparison always evaluates to true [-Wtautological-compare] loop->play->channels == loop->play->channels && ^~ ``` Judging from the surrounding code, the check should make sure the channels of the play and capture device are equal. Signed-off-by: Paul Menzel --- I hope, this patch gets through without any mangling from Mozilla Thunderbird. alsaloop/pcmjob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alsaloop/pcmjob.c b/alsaloop/pcmjob.c index 4df59e8..2be0732 100644 --- a/alsaloop/pcmjob.c +++ b/alsaloop/pcmjob.c @@ -1479,7 +1479,7 @@ __again: if (loop->play->access == loop->capt->access && loop->play->format == loop->capt->format && loop->play->rate == loop->capt->rate && - loop->play->channels == loop->play->channels && + loop->play->channels == loop->capt->channels && loop->sync != SYNC_TYPE_SAMPLERATE) { if (verbose > 1) snd_output_printf(loop->output, "shared buffer!!!\n");