From patchwork Tue Oct 8 08:57:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Yu X-Patchwork-Id: 13826002 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 6EC6ECF8863 for ; Tue, 8 Oct 2024 08:58:49 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3722C86F; Tue, 8 Oct 2024 10:58:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3722C86F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1728377927; bh=swKULQrE+YLS6/i3Nv/hVVQoqmwcDy+ZHSZ5ye/0InY=; h=From:To:CC:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=Go/TiOKcIquNcpKKI/SZYzGklhZqKUKvo/spCCy9XNSdZZ5tAvxvaPYuD0tlA8omY by5IIpjpG29ninIeGZHS6/fgG+PGpfbHdSmtKhiuK5wffOvzmAhVbcTDqcjZ5UTEdp c7MRVAnR2a6NXeL7M8/kuyZ0NbRkRVpdr4BABGmU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8693AF805EB; Tue, 8 Oct 2024 10:57:59 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id E7EF9F805D3; Tue, 8 Oct 2024 10:57:58 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BD571F80528; Tue, 8 Oct 2024 10:57:48 +0200 (CEST) Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8E387F80527 for ; Tue, 8 Oct 2024 10:57:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8E387F80527 Authentication-Results: alsa1.perex.cz; dkim=temperror header.d=realtek.com header.i=@realtek.com header.a=rsa-sha256 header.s=dkim header.b=fR+LByy2 X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4988vboJ73103585, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=realtek.com; s=dkim; t=1728377857; bh=swKULQrE+YLS6/i3Nv/hVVQoqmwcDy+ZHSZ5ye/0InY=; h=Content-Type:From:To:CC:Subject:Date:Message-ID:MIME-Version; b=fR+LByy24wz8/inc8Fvdf+uggn0njWMo7DqgeXH34l6L23bPsMg70oLMGipA6BEhg 1S5P0R6wnJrdKLiI+EzXt9wM95Bzo/TePNPF4nxm6KWIotDkRgW9/puM2JXteK4ptu 6fShD0J6Ujnz+GX+4BsJJOsJjJ85Nvpq+1vpc7ZUGQ67WPt1LQRrRHS+KFX/YNiA1y zrNHvVtywLWrR4KE3gIv+cjrD0K9IltWnMC+GFX6OUhV93FeWyErelrlKMsC0v9d2V +Qgk3fbGay6YPQsB8nPv7p9GoSUs0p/48ZIS38gIhNHTD5iOINyXzRfPCLfSTPlSVr deHDTtzcL/p+A== Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/3.06/5.92) with ESMTPS id 4988vboJ73103585 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2024 16:57:37 +0800 Received: from RTEXMBS05.realtek.com.tw (172.21.6.98) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 8 Oct 2024 16:57:37 +0800 Received: from RTEXMBS01.realtek.com.tw (172.21.6.94) by RTEXMBS05.realtek.com.tw (172.21.6.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 8 Oct 2024 16:57:36 +0800 Received: from RTEXMBS01.realtek.com.tw ([fe80::147b:e1e8:e867:41c2]) by RTEXMBS01.realtek.com.tw ([fe80::147b:e1e8:e867:41c2%7]) with mapi id 15.01.2507.035; Tue, 8 Oct 2024 16:57:36 +0800 From: Jack Yu To: "broonie@kernel.org" , "lgirdwood@gmail.com" CC: "alsa-devel@alsa-project.org" , "lars@metafoo.de" , "bard.liao@intel.com" , "naveen.m@intel.com" , "Flove(HsinFu)" , Oder Chiou , =?big5_tw?b?U2h1bWluZyBbrVOu0bvKXQ==?= , =?big5_tw?b?RGVyZWsgW6TovHe4cV0=?= , Jack Yu Subject: [PATCH 2/2] ASoC: rt721-sdca: Fix issue of warning message Thread-Topic: [PATCH 2/2] ASoC: rt721-sdca: Fix issue of warning message Thread-Index: AdsZYB5twYpxAqYfT+6Yl9jzt54Bxg== Date: Tue, 8 Oct 2024 08:57:36 +0000 Message-ID: <065c0b7d84cf47d3a9186235447521c5@realtek.com> Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-TNEF-Correlator: <065c0b7d84cf47d3a9186235447521c5@realtek.com> x-originating-ip: [172.21.6.42] MIME-Version: 1.0 Message-ID-Hash: MSWO6FGSRGJHTHD6B3W4F2MQ3H7GQO7C X-Message-ID-Hash: MSWO6FGSRGJHTHD6B3W4F2MQ3H7GQO7C X-MailFrom: jack.yu@realtek.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Fix issue of warning messages caused by some variables. Signed-off-by: Jack Yu --- sound/soc/codecs/rt-sdw-common.c | 2 +- sound/soc/codecs/rt721-sdca.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/rt-sdw-common.c b/sound/soc/codecs/rt-sdw-common.c index 9ed0e9855699..a422da6cf702 100644 --- a/sound/soc/codecs/rt-sdw-common.c +++ b/sound/soc/codecs/rt-sdw-common.c @@ -108,7 +108,7 @@ EXPORT_SYMBOL_GPL(rt_sdca_index_update_bits); int rt_sdca_btn_type(unsigned char *buffer) { u8 btn_type = 0; - int ret; + int ret = 0; btn_type |= buffer[0] & 0xf; btn_type |= (buffer[0] >> 4) & 0xf; diff --git a/sound/soc/codecs/rt721-sdca.c b/sound/soc/codecs/rt721-sdca.c index 36056cb7a3ca..201cb667c8c1 100644 --- a/sound/soc/codecs/rt721-sdca.c +++ b/sound/soc/codecs/rt721-sdca.c @@ -30,7 +30,7 @@ static void rt721_sdca_jack_detect_handler(struct work_struct *work) { struct rt721_sdca_priv *rt721 = container_of(work, struct rt721_sdca_priv, jack_detect_work.work); - int btn_type = 0, ret; + int btn_type = 0; if (!rt721->hs_jack) return; @@ -42,7 +42,7 @@ static void rt721_sdca_jack_detect_handler(struct work_struct *work) if (rt721->scp_sdca_stat1 & SDW_SCP_SDCA_INT_SDCA_6) { rt721->jack_type = rt_sdca_headset_detect(rt721->regmap, RT721_SDCA_ENT_GE49); - if (ret < 0) + if (rt721->jack_type < 0) return; }