From patchwork Mon Aug 22 18:42:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12951083 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64A6DC28D13 for ; Mon, 22 Aug 2022 18:44:42 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 78AAB1670; Mon, 22 Aug 2022 20:43:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 78AAB1670 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661193880; bh=LXeq1g0rOoidK7Ljzxcs+75UbaovvOPztMME8H2Yn5I=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=YxgY5uGIhlawQAKdiyrgu71lGW8gg0iaL2HYvyJuMhMFOUPSJg/xO8Eio/QyyKzKW PSNFBbic1+WThlCREAIsSfA2ZLY/F4yS6SdJEDKRg/u8ezM6x560T1IFjyuoF6p0fL LzVNcVoCPwuOQHttI76OK53mkWERI61dBsYk7QCM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5E38FF8052D; Mon, 22 Aug 2022 20:43:18 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0FC8DF80535; Mon, 22 Aug 2022 20:43:17 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 50C8AF80517 for ; Mon, 22 Aug 2022 20:43:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 50C8AF80517 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="iFWPYfrF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661193791; x=1692729791; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LXeq1g0rOoidK7Ljzxcs+75UbaovvOPztMME8H2Yn5I=; b=iFWPYfrFMsQvmAK1H1CyB5UU2vEQtOPzusV9fgalB+1SpUcI4uKU+k2Z rfbQBXR+h4YHmkllJbhjFch0FG5nNobYm4avMX2u2o+A/5rd4EunoAMa3 DIr7z6jghAYxxJhM3Qmy4ypeIwdtXXGTjAF3c5UTJWjp9+uvbIOD7+r1L WwT4ZeAeQyuyI5yzl7P4WoL7TH4cR/E+OagaAADHbavtsr1N/u3z5OPXZ I33p0aM+dH2FX095rPdt8Jmy61OTyBx0ZjrUEyRk2wsRE6SHnEzfAlwJ7 ArY3pSRbpHrw7p/s52EmYLb9+JHklBc1B0WqVS/VAlOc+mJynsAWmO9qT A==; X-IronPort-AV: E=McAfee;i="6500,9779,10447"; a="293488963" X-IronPort-AV: E=Sophos;i="5.93,255,1654585200"; d="scan'208";a="293488963" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2022 11:43:09 -0700 X-IronPort-AV: E=Sophos;i="5.93,255,1654585200"; d="scan'208";a="669671087" Received: from apascali-mobl2.ger.corp.intel.com (HELO pbossart-mobl3.home) ([10.252.42.21]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2022 11:43:06 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 2/5] ASoC: wcd-mbhc-v2: remove always-true condition Date: Mon, 22 Aug 2022 20:42:36 +0200 Message-Id: <20220822184239.169757-3-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220822184239.169757-1-pierre-louis.bossart@linux.intel.com> References: <20220822184239.169757-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: Kai Vehmanen , tiwai@suse.de, open list , Takashi Iwai , Pierre-Louis Bossart , Liam Girdwood , broonie@kernel.org, Srinivas Kandagatla , Banajit Goswami , Chao Song , Bard Liao X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" cppcheck warning: sound/soc/codecs/wcd-mbhc-v2.c:1192:26: style: Condition 'cross_conn<0' is always true [knownConditionTrueFalse] } else if (cross_conn < 0) /* Error */ ^ sound/soc/codecs/wcd-mbhc-v2.c:1188:15: note: Assuming that condition '!cross_conn' is not redundant } else if (!cross_conn) { /* no cross connection */ ^ sound/soc/codecs/wcd-mbhc-v2.c:1192:26: note: Condition 'cross_conn<0' is always true } else if (cross_conn < 0) /* Error */ ^ Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Chao Song --- sound/soc/codecs/wcd-mbhc-v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/wcd-mbhc-v2.c b/sound/soc/codecs/wcd-mbhc-v2.c index 98baef594bf31..b16a18dbfe7af 100644 --- a/sound/soc/codecs/wcd-mbhc-v2.c +++ b/sound/soc/codecs/wcd-mbhc-v2.c @@ -1189,7 +1189,7 @@ static void wcd_correct_swch_plug(struct work_struct *work) pt_gnd_mic_swap_cnt = 0; plug_type = wcd_mbhc_get_plug_from_adc(mbhc, output_mv); continue; - } else if (cross_conn < 0) /* Error */ + } else /* Error if (cross_conn < 0) */ continue; if (pt_gnd_mic_swap_cnt == GND_MIC_SWAP_THRESHOLD) {