Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1480271pxf; Fri, 12 Mar 2021 10:25:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxgc3GXNLVikr43YWVaRluU/WxZc1AOnAkvAJin9hqK17lnQJhkxQl+YWHnOHwjHG9PnjnF X-Received: by 2002:a17:906:13c4:: with SMTP id g4mr10146750ejc.390.1615573509520; Fri, 12 Mar 2021 10:25:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615573509; cv=none; d=google.com; s=arc-20160816; b=SSt6zXZMu2XiaoFgqFcs2H/o1gBWNdS3Logn+Zkh0HJKJVi6pGHyd1abbfG91S7rjh fgGRYYg2yc5MFB4hugMwW3dnzHDm8l9D/uZXqdF9rNA4kWp89u4EP7XKEHBu4+jJ5VyS UFoErZP46RKSEmtK/MrARguYK3LNcfSDLePVq0jY/D74UO6lpc1AqdgMNFWpMF0FW2zU U7cCYVd6RH1Bv7vYHPf5oOVrKVapbwiaG2Tn1XFSXIfH6RvVUGm5+3IeY5CNQIpmPAZL 12OQpDQ47uMuHlQXZlEZUmFz9HUiV7A30eXy88g7cnBBOOxBxTJHPA5dgcYq0sf2kUdy GTOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=eJIUbeUVi2iq5soBjjbZoyL7Ue3r7QnlYl4ZchePeIc=; b=Yj6RLUSgWwyE6sOn++hK8//a0XLZOZCQNPQNz3oPjKEjLAPWVpG997pQBfIXAigevz /kOvCP5IwZEoGsAq+z5hq2QKY6VvucD8wXp+IlJLmD0xoG1ibRlCmJ6sgsy6b9uqxxE6 aym9fY/2pz0HdLl3xFRiHgW0CMHFSoOY9p3SzRWEoSQt7XgQsCkbUAnSecX3m67IgIXb 5aBHaZAkuGNecdFeMJ+TqdiB1yQ02eKHw0gVeaj8tj3FdbnZ8vkReDDWVpI1ti05RRyd bIS8sXhI1NaosSS7n+w2/LA3Kddwo23QloOYOHUo9FaPRhO9OBRhOV4PhmEd/V74TS/v sZmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u8si4732767ejt.132.2021.03.12.10.24.46; Fri, 12 Mar 2021 10:25:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233155AbhCLSXu (ORCPT + 99 others); Fri, 12 Mar 2021 13:23:50 -0500 Received: from mga02.intel.com ([134.134.136.20]:36926 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233128AbhCLSXT (ORCPT ); Fri, 12 Mar 2021 13:23:19 -0500 IronPort-SDR: MSdkeObA2gJNdz/cx94NNbKa8LhpObJO3oo6NdF30emNB14bourtpjFPZIm/phRL2Mv6lNRRP8 G7yfDMTiidvg== X-IronPort-AV: E=McAfee;i="6000,8403,9921"; a="175999101" X-IronPort-AV: E=Sophos;i="5.81,244,1610438400"; d="scan'208";a="175999101" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Mar 2021 10:23:18 -0800 IronPort-SDR: yJ79O1B36TnWUtl7drVOzZFz+MfVI+WpZ2EYNR0BgAN0Urj+qMm4Z9pvhLNEkyDQFesv+bOZMD oOeQPI6aT8bg== X-IronPort-AV: E=Sophos;i="5.81,244,1610438400"; d="scan'208";a="377791926" Received: from amiteshs-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.37.30]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Mar 2021 10:23:14 -0800 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, linux-kernel@vger.kernel.org, Pierre-Louis Bossart , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Kuninori Morimoto Subject: [PATCH 06/23] ASoC: cx2070x: remove duplicate else branch Date: Fri, 12 Mar 2021 12:22:29 -0600 Message-Id: <20210312182246.5153-7-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210312182246.5153-1-pierre-louis.bossart@linux.intel.com> References: <20210312182246.5153-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org cppcheck warning: sound/soc/codecs/cx2072x.c:1436:10: style:inconclusive: Found duplicate branches for 'if' and 'else'. [duplicateBranch] } else if (type & 0x4) { ^ sound/soc/codecs/cx2072x.c:1439:5: note: Found duplicate branches for 'if' and 'else'. } else { ^ sound/soc/codecs/cx2072x.c:1436:10: note: Found duplicate branches for 'if' and 'else'. } else if (type & 0x4) { ^ The last two branches do the same thing and can be collapsed together. Signed-off-by: Pierre-Louis Bossart --- sound/soc/codecs/cx2072x.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/cx2072x.c b/sound/soc/codecs/cx2072x.c index d2d004654c9b..d924e3528029 100644 --- a/sound/soc/codecs/cx2072x.c +++ b/sound/soc/codecs/cx2072x.c @@ -1430,11 +1430,11 @@ static int cx2072x_jack_status_check(void *data) state |= SND_JACK_HEADSET; if (type & 0x2) state |= SND_JACK_BTN_0; - } else if (type & 0x4) { - /* Nokia headset */ - state |= SND_JACK_HEADPHONE; } else { - /* Headphone */ + /* + * Nokia headset (type & 0x4) and + * regular Headphone + */ state |= SND_JACK_HEADPHONE; } } -- 2.25.1