From patchwork Wed May 3 13:54:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Thomson X-Patchwork-Id: 9709843 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 6A01E60351 for ; Wed, 3 May 2017 13:54:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FDB2285EA for ; Wed, 3 May 2017 13:54:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4324228602; Wed, 3 May 2017 13:54:19 +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,FROM_WORDY, 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 5E945285EA for ; Wed, 3 May 2017 13:54:18 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id C2248266DD6; Wed, 3 May 2017 15:54:14 +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 79250266DD7; Wed, 3 May 2017 15:54:13 +0200 (CEST) Received: from mail1.bemta5.messagelabs.com (mail1.bemta5.messagelabs.com [195.245.231.140]) by alsa0.perex.cz (Postfix) with ESMTP id E779F2667FE for ; Wed, 3 May 2017 15:54:09 +0200 (CEST) Received: from [85.158.139.19] by server-4.bemta-5.messagelabs.com id 71/3B-02181-FF0E9095; Wed, 03 May 2017 13:54:07 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBIsWRWlGSWpSXmKPExsUSt3Opse7/B5y RBpcWslhcuXiIyWLqwydsFt+udDBZXN41h82ic1c/q8WG72sZHdg8NnxuYvPYOesuu8emVZ1s HvveLmPzWL/lKovH501yAWxRrJl5SfkVCawZq89LFyxhrzgwt5OtgXEaWxcjF4eQwDpGiX13V zJ2MXICORUSu5o/sILYbAIWEpNPPGADsVkEVCRm964HinNwCAtESlyZIgLSKyLQxSix+tVjdp AaZoFyiS2fJjKD2LwCDhJfW3vYIGxBiZMzn7BA1EhIHHzxghlil4HE6QWNYHEJAXuJ6e+vMoP MlxDQl2g8FgsRNpT4PusbC0TYXGLPcq4JjPyzkAydhWToAkamVYwaxalFZalFuoZmeklFmekZ JbmJmTm6hgamermpxcWJ6ak5iUnFesn5uZsYgaHMAAQ7GM+f9jzEKMnBpCTKq/6KPVKILyk/p TIjsTgjvqg0J7X4EKMMB4eSBK89MDaEBItS01Mr0jJzgFEFk5bg4FES4bUASfMWFyTmFmemQ6 ROMepyzLn39T2TEEtefl6qlDjvxvtARQIgRRmleXAjYBF+iVFWSpiXEegoIZ6C1KLczBJU+Ve M4hyMSsK8z0Gm8GTmlcBtegV0BBPQEc2yHCBHlCQipKQaGF3Lthmz65+5U76qf/fS04KCxq0b rmjX5ebYhJ1U+Htqf0F1p/P7zsWyR/eqOjwtZbmSGL/D+17drlfzxbt8bn7ZNu9i0JtTwYv5J x683nzgwGmbxNbWtS8XZVbxpIn4bgq9L7QuVFnP0IOX+53WbIWKbxa9EcF++z5pX3WRdt17Iv q2rfzqQCWW4oxEQy3mouJEAI9VdubrAgAA X-Env-Sender: Adam.Thomson.Opensource@diasemi.com X-Msg-Ref: server-2.tower-178.messagelabs.com!1493819646!94389334!1 X-Originating-IP: [94.185.165.51] X-StarScan-Received: X-StarScan-Version: 9.4.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 11685 invoked from network); 3 May 2017 13:54:07 -0000 Received: from mailrelay2.diasemi.com (HELO sw-ex-cashub01.diasemi.com) (94.185.165.51) by server-2.tower-178.messagelabs.com with AES128-SHA encrypted SMTP; 3 May 2017 13:54:07 -0000 Received: from swsrvapps-01.diasemi.com (10.20.28.141) by SW-EX-CASHUB01.diasemi.com (10.20.16.140) with Microsoft SMTP Server id 14.3.248.2; Wed, 3 May 2017 14:54:06 +0100 Received: by swsrvapps-01.diasemi.com (Postfix, from userid 22379) id 5EA1E3FB6C; Wed, 3 May 2017 14:54:06 +0100 (BST) From: Adam Thomson Date: Wed, 3 May 2017 14:54:06 +0100 To: Mark Brown , Liam Girdwood , Jaroslav Kysela , Takashi Iwai Message-ID: <20170503135406.5EA1E3FB6C@swsrvapps-01.diasemi.com> MIME-Version: 1.0 X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-ServerInfo: sw-ex-cashub01.diasemi.com, 9 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 03/05/2017 08:51:00 Cc: alsa-devel@alsa-project.org, Support Opensource , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] ASoC: da7218: Fix incorrect usage of bitwise '&' operator for SRM check 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 In the SRM lock check section of code the '&' bitwise operator is used as part of checking lock status. Functionally the code works as intended, but the conditional statement is a boolean comparison so should really use '&&' logical operator instead. This commit rectifies this discrepancy. Signed-off-by: Adam Thomson Reviewed-by: Takashi Sakamoto --- sound/soc/codecs/da7218.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/da7218.c b/sound/soc/codecs/da7218.c index d256ebf..6e1940e 100644 --- a/sound/soc/codecs/da7218.c +++ b/sound/soc/codecs/da7218.c @@ -1457,7 +1457,7 @@ static int da7218_dai_event(struct snd_soc_dapm_widget *w, ++i; msleep(DA7218_SRM_CHECK_DELAY); } - } while ((i < DA7218_SRM_CHECK_TRIES) & (!success)); + } while ((i < DA7218_SRM_CHECK_TRIES) && (!success)); if (!success) dev_warn(codec->dev, "SRM failed to lock\n");