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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 6CD21C43334 for ; Mon, 6 Jun 2022 08:49:35 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4LGnH16skLz3bp5 for ; Mon, 6 Jun 2022 18:49:33 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=a+vuSOi6; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2a00:1450:4864:20::12d; helo=mail-lf1-x12d.google.com; envelope-from=shengjiu.wang@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=a+vuSOi6; dkim-atps=neutral Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4LGcJl50N7z304G for ; Mon, 6 Jun 2022 12:05:25 +1000 (AEST) Received: by mail-lf1-x12d.google.com with SMTP id j10so21116580lfe.12 for ; Sun, 05 Jun 2022 19:05:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=usJf20AAKPNtkFpO9IZiGVXBDrUnP/ALbP63KHhfdLQ=; b=a+vuSOi68MhI1PKcYt3CMKt9Uf57841GUcl9gCLFK4tfHAJN48nnCmiwniiVs9BuRd yVZLjQ2Kr/LDR1XsRn/V22KGLrjUEHH+ZzYFAg/O8jSBgnHWPPFak/0ZzhGp6h8a14x3 2HV9wB1P5QXJi9QpbM6nc4o9wKsQc+NUvZSdGTSsYleyR2MdLV/vcPErSZC9yXqqZ01v xVBKscWN7yNui6uyk4VDE1KLEOt3PZUkjDphq1o4N5ZDjk3eetObHHVfXgJF3IAEapY7 QElmOyA0NIFyWqHrxSklUCgxVvhL2tGqDDU6+oGP7ACSFDt6zgNt3fq1XBNo0ZHKkWo4 Zhsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=usJf20AAKPNtkFpO9IZiGVXBDrUnP/ALbP63KHhfdLQ=; b=hhDp3hpDHLcbvydL9rx1yS/95JWi2iiXVln5io8Enw6Bc41ZEzOZ8Pg+MFl2sdkWgR aQnWgAi8IEbtTHJFtUqyI4y9K8NKCHpPptOu9MYKACmdcTUiK/4P/p6AitFwun5JvN88 csxSZIsOxF0eQgQfpYf56WrJWDDulnY1J8kHC+26n44I64iuXThlwzveTupzcPfd8L+a esPJrWp9dXclOoOcjbYv30IxDbbSgAhx479G9wEHQ2oIbKr7o8nibV2wSOS5Qjeapy3A AAvcsqkO1ybJEOMCtw6Tlz5DaDfzBzyCZ7FexkwHAuke4IoFSkkm1X0vtEQsKttktP5k uglw== X-Gm-Message-State: AOAM530IZMTQAs/j+6bjpCXdcDYnC7BSkkJ2n2LtreQhslE1qs2Xr0mE SII5940Zin7ZqStTgnRnWegKArMiJ4gTczjVb0Q= X-Google-Smtp-Source: ABdhPJwBmXnUl2NGPk5lZ8R0xen/iXYV2x5d7WrIVpi6p25LtCkBtFqrb5Op3lqB6XE56tNT16CkC2WEnU654rAl2JY= X-Received: by 2002:a19:6445:0:b0:479:141c:cb5b with SMTP id b5-20020a196445000000b00479141ccb5bmr11724447lfj.280.1654481121323; Sun, 05 Jun 2022 19:05:21 -0700 (PDT) MIME-Version: 1.0 References: <20220602071448.277968-1-chi.minghao@zte.com.cn> In-Reply-To: <20220602071448.277968-1-chi.minghao@zte.com.cn> From: Shengjiu Wang Date: Mon, 6 Jun 2022 10:05:10 +0800 Message-ID: Subject: Re: [PATCH] ASoC: imx-audmux: remove unnecessary check of clk_disable_unprepare To: cgel.zte@gmail.com Content-Type: multipart/alternative; boundary="000000000000863c1105e0bde762" X-Mailman-Approved-At: Mon, 06 Jun 2022 18:49:00 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, linux-kernel , Xiubo Li , linuxppc-dev , Zeal Robot , Liam Girdwood , Minghao Chi , Jaroslav Kysela , Nicolin Chen , Mark Brown , Fabio Estevam , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" --000000000000863c1105e0bde762 Content-Type: text/plain; charset="UTF-8" On Thu, Jun 2, 2022 at 3:14 PM wrote: > From: Minghao Chi > > Because clk_disable_unprepare already checked NULL clock > parameter, so the additional checks are unnecessary, just remove them. > > Reported-by: Zeal Robot > Signed-off-by: Minghao Chi > --- > sound/soc/fsl/imx-audmux.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c > index dfa05d40b276..f434fa7decc1 100644 > --- a/sound/soc/fsl/imx-audmux.c > +++ b/sound/soc/fsl/imx-audmux.c > @@ -71,8 +71,7 @@ static ssize_t audmux_read_file(struct file *file, char > __user *user_buf, > ptcr = readl(audmux_base + IMX_AUDMUX_V2_PTCR(port)); > pdcr = readl(audmux_base + IMX_AUDMUX_V2_PDCR(port)); > > - if (audmux_clk) > - clk_disable_unprepare(audmux_clk); > + clk_disable_unprepare(audmux_clk); > I think the check of audmux_clk before "clk_prepare_enable" also can be removed? > buf = kmalloc(PAGE_SIZE, GFP_KERNEL); > if (!buf) > @@ -218,8 +217,7 @@ int imx_audmux_v2_configure_port(unsigned int port, > unsigned int ptcr, > writel(ptcr, audmux_base + IMX_AUDMUX_V2_PTCR(port)); > writel(pdcr, audmux_base + IMX_AUDMUX_V2_PDCR(port)); > > - if (audmux_clk) > - clk_disable_unprepare(audmux_clk); > + clk_disable_unprepare(audmux_clk); > ditto best regards wang shengjiu > > return 0; > } > -- > 2.25.1 > > > --000000000000863c1105e0bde762 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Thu, Jun 2, 2022 at 3:14 PM <cgel.zte@gmail.com> wrote:
From: Minghao Chi <= ;chi.minghao@zt= e.com.cn>

Because clk_disable_unprepare already checked NULL clock
parameter, so the additional checks are unnecessary, just remove them.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
---
=C2=A0sound/soc/fsl/imx-audmux.c | 6 ++----
=C2=A01 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c
index dfa05d40b276..f434fa7decc1 100644
--- a/sound/soc/fsl/imx-audmux.c
+++ b/sound/soc/fsl/imx-audmux.c
@@ -71,8 +71,7 @@ static ssize_t audmux_read_file(struct file *file, char _= _user *user_buf,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ptcr =3D readl(audmux_base + IMX_AUDMUX_V2_PTCR= (port));
=C2=A0 =C2=A0 =C2=A0 =C2=A0 pdcr =3D readl(audmux_base + IMX_AUDMUX_V2_PDCR= (port));

-=C2=A0 =C2=A0 =C2=A0 =C2=A0if (audmux_clk)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0clk_disable_unprepa= re(audmux_clk);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0clk_disable_unprepare(audmux_clk);

I think the check of audmux_clk before "clk_pr= epare_enable"=C2=A0 also
can be removed?

<= /div>


=C2=A0 =C2=A0 =C2=A0 =C2=A0 buf =3D kmalloc(PAGE_SIZE, GFP_KERNEL);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (!buf)
@@ -218,8 +217,7 @@ int imx_audmux_v2_configure_port(unsigned int port, uns= igned int ptcr,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 writel(ptcr, audmux_base + IMX_AUDMUX_V2_PTCR(p= ort));
=C2=A0 =C2=A0 =C2=A0 =C2=A0 writel(pdcr, audmux_base + IMX_AUDMUX_V2_PDCR(p= ort));

-=C2=A0 =C2=A0 =C2=A0 =C2=A0if (audmux_clk)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0clk_disable_unprepa= re(audmux_clk);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0clk_disable_unprepare(audmux_clk);

ditto

best regards
wang shengjiu

=C2=A0 =C2=A0 =C2=A0 =C2=A0 return 0;
=C2=A0}
--
2.25.1


--000000000000863c1105e0bde762--