From mboxrd@z Thu Jan 1 00:00:00 1970 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 3017EC27C6E for ; Sun, 16 Jun 2024 17:27:16 +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 46D859F6; Sun, 16 Jun 2024 19:27:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 46D859F6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1718558834; bh=Xm/0Py7i6a9IMqxBVqF8drxyHQMhWCpJiWp2iMkPlSI=; h=Date:To:Cc:References:Subject:From:In-Reply-To:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=gjyixpeaohE4bI7jcnoj/pREfQKIaULD6GeLt33s21wQy1l7UyQ2qtDs4jyLuvg00 l+c82s2YpWcmiZnoFM85wd/hrvL0SVONQA3HDXUnJ9ykZHuwdF0toJF4QcUGX2u7fl 7RrobnMJRO+Fr6YxXqUuQyYpJTQ96o7YGvfjscgM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A4939F805B4; Sun, 16 Jun 2024 19:26:42 +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 3A990F805BA; Sun, 16 Jun 2024 19:26:42 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 09E21F8023A; Sun, 16 Jun 2024 19:26:38 +0200 (CEST) Received: from mout.web.de (mout.web.de [212.227.15.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4F584F800FA for ; Sun, 16 Jun 2024 19:26:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4F584F800FA Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=web.de header.i=markus.elfring@web.de header.a=rsa-sha256 header.s=s29768273 header.b=DiAAoDov DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1718558791; x=1719163591; i=markus.elfring@web.de; bh=9nBqF5ESlkCFxxxtSfxxafJZFyJpQbDfqjP2Yj1FlIk=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:To:Cc:References: Subject:From:In-Reply-To:Content-Type:Content-Transfer-Encoding: cc:content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=DiAAoDov0evEhITeHjo7u35qPLueFX6HSYuYpyisk4X5eKpIHooR7dBk95psSnjB AQdd0Y0o4dBP5/f7V43DJxJSnHNmUH5tDhZvxrR4V2DnXDnz8iec+DZ9PH5Sn2S6/ isRjwpx/TkslV7whq9ZP/B2dwQtKAFOU4c/OrcikDIqhnjfflqywSI53aYT5ZesZT ndBVylcwSHNra2fOJ3b7DWC/VN0ONRplVeI3G3PM6Ks1U/ubC4ROK+RBO8fbR2xh0 l0ruJxWrNTTxZ6PGXgmO95oRbHXwSBcDIE5yFFGWOqxdD0Kn05e1A5R7W4qpRFU1X MZOCO7WIm6G7yePL2g== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.83.95]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1M6pUQ-1sJTkO3WVq-00Ef4G; Sun, 16 Jun 2024 19:26:30 +0200 Message-ID: <2660e72f-e2a2-48d1-8571-b738d9739917@web.de> Date: Sun, 16 Jun 2024 19:26:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Konrad Dybcio , Mohammad Rafi Shaik , Prasad Kumpatla , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, Banajit Goswami , Conor Dooley , Jaroslav Kysela , Krzysztof Kozlowski , Liam Girdwood , Mark Brown , Rob Herring , Srinivas Kandagatla , Takashi Iwai Cc: LKML , Rohit kumar , Christophe Jaillet References: <20240611074557.604250-4-quic_mohs@quicinc.com> Subject: Re: [PATCH v6 3/7] ASoC: codecs: wcd937x: add wcd937x codec driver Content-Language: en-GB From: Markus Elfring In-Reply-To: <20240611074557.604250-4-quic_mohs@quicinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:c4qMevEEZoDUqoRZeATp8WmsNJbisvOlM4oORsHrrjrrsyD8K+Z nNih8QUYdTTgvUeNfktoQpIH4cAzbc3XB/e+ap8BXKwMBd8CT1AWDHCvs8pbYDpsfDsEmrj Y+tzfzcuVENc2x6GJZKi1BpOWh/TUa8Ocii93k1JzP3E8pBxPmHgismL4NvcBDZJcyCgd9d kEgzsm+XKdqqsYb7ndUfw== UI-OutboundReport: notjunk:1;M01:P0:NhWsXH4dfU8=;YdKgy7veYd3vy2o4WUWvR6kCH9a IahlDipBDK+K6LYLz6A/eX6whnMhGi7fHhxH1fkkNL4BNBPVi25uGj3OOkoyKWxk7bDRp8y9M 6PHyxB3iYqN/HqHyKIn5IYaTkMgM5sEP7nc6VvINgSZ/NoLvrls8Fz9LLcUrPZIEkq21YhN2g FIYL2JmpoWzB/IgWsTiBFLMzWknPFCsaeacBXhPp7uQwfSIh6f0YRPR96vcMC7vCbQTM9M8tH xjUGcSMZxARJ8ePFWN1wIKAbG8D2cn2P/6c9pGIcUTKxuE53RJDe4fT/+iJPRGswLUSYNlqjh o9KrXhWRaUX2Fscbuut+AxArU84irUCsOoIv4rElYWrTV620gUegA+McSJ0FRfqbDI7NAQpWj 3RoJ+T7KMaFQdyBLy9SjeXb/a7zWdMCqGmzJwdWI422XoTV91/Ksinb5JS0jQuqNST4bAqAU1 rHdTveJ3KV/OAhhFTv+2aYsbD7BO5mGVFO75nSd1cCYnhccju5ZzvoOMFDVRyg3hZ+N+zgDsm /cOjSCIlfyFS7gKuMZfh2QRt9ZyVb1sx34iNwNRCPGaHWv9b5FtCAjqj0vbQGy9z0stcqzQ3T oqbHwqNVXFVQDyMmXk8JYas7bYPFnwxU1ox6BbBbGvcP6jNz1gF+39aKq6gDJE1LXe5NUAVO4 7ru0uZ2RZF/OClscS2u++V+JhgSdkQj2hhpNiIjaZ+1H7dyMgDjqO4ewWXcfmsC5ujfEo0zZv a6NMbsSTyE6sbrWUmpol+FrIXjIBaiQR4tQ1i7Hjyxt31B+FdwgkM7CdUA32nc8d5hKfb3d8c ky9pOQn9kg0Y3xzFs4EqrN6JJQKC7TDx9UJgLxI9/2lkU= Message-ID-Hash: S6GGPUPC7G7YCEHADD2YNVSTK5IESOZW X-Message-ID-Hash: S6GGPUPC7G7YCEHADD2YNVSTK5IESOZW X-MailFrom: Markus.Elfring@web.de 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: =E2=80=A6 > +++ b/sound/soc/codecs/wcd937x.c > @@ -0,0 +1,1677 @@ =E2=80=A6 > +static bool wcd937x_mbhc_get_moisture_status(struct snd_soc_component *= component) > +{ > + struct wcd937x_priv *wcd937x =3D snd_soc_component_get_drvdata(compone= nt); > + bool ret =3D false; > + > + if (wcd937x->mbhc_cfg.moist_rref =3D=3D R_OFF) { > + snd_soc_component_write_field(component, WCD937X_MBHC_NEW_CTL_2, > + WCD937X_M_RTH_CTL_MASK, R_OFF); > + goto done; > + } I suggest to use the following statement. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Do= cumentation/process/coding-style.rst?h=3Dv6.10-rc3#n532 + return false; =E2=80=A6 > + /* Read moisture comparator status */ > + ret =3D ((snd_soc_component_read(component, WCD937X_MBHC_NEW_FSM_STATU= S) > + & 0x20) ? 0 : 1); > +done: > + return ret; > +} =E2=80=A6 How do you think about to use the following statement instead? + return (snd_soc_component_read(component, WCD937X_MBHC_NEW_FSM_STATUS) &= 0x20) ? false : true; May the local variable =E2=80=9Cret=E2=80=9D and the label =E2=80=9Cdone= =E2=80=9D be omitted in this function implementation finally? Regards, Markus