From patchwork Thu Feb 25 00:25:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 12102995 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FD18C433E0 for ; Thu, 25 Feb 2021 00:27:22 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id DBD3164F12 for ; Thu, 25 Feb 2021 00:27:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DBD3164F12 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org 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 54E591676; Thu, 25 Feb 2021 01:26:30 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 54E591676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1614212840; bh=3uxrLxtGmOcYVWk8ummU1Xlq4fS+7NedswSPi9lhJ1w=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=dVH3fJYf680LPSPQIzzoa+dzGJEqFpVyeFnfqYmqmu/jKEX/5ziX1PJ0GvTHzVm1J rP6mlBv33YlvqMyfWv5Y8KNDknYX6H4ZPubMKBSBk/2yz+BJwUbsrmZ3LQJlXLZR3Q AklIi7p1wugEe9iNThfxJyuZnhSO3Xvpw3uIpzxs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8F27BF802E7; Thu, 25 Feb 2021 01:25:25 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 07664F802E2; Thu, 25 Feb 2021 01:25:23 +0100 (CET) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id EA8B2F8028B for ; Thu, 25 Feb 2021 01:25:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EA8B2F8028B Date: 25 Feb 2021 09:25:19 +0900 X-IronPort-AV: E=Sophos;i="5.81,203,1610377200"; d="scan'208";a="73061874" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 25 Feb 2021 09:25:19 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 7A2B0412E071; Thu, 25 Feb 2021 09:25:19 +0900 (JST) Message-ID: <87h7m1ro28.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 4/5] ASoC: rsnd: cleanup ppcheck warning for cmd.c User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown , Pierre-Louis Bossart In-Reply-To: <87mtvtro3h.wl-kuninori.morimoto.gx@renesas.com> References: <87mtvtro3h.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA 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" From: Kuninori Morimoto This patch cleanups below ppcheck warning. sound/soc/sh/rcar/cmd.c:46:20: style: The scope of the variable 'src' can be reduced. [variableScope] struct rsnd_mod *src; ^ sound/soc/sh/rcar/cmd.c:47:27: style: The scope of the variable 'tio' can be reduced. [variableScope] struct rsnd_dai_stream *tio; ^ sound/soc/sh/rcar/cmd.c:145:13: style: The scope of the variable 'ret' can be reduced. [variableScope] int i, nr, ret; ^ Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/cmd.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sound/soc/sh/rcar/cmd.c b/sound/soc/sh/rcar/cmd.c index e6bb6a9a0684..9fdb37c2cbc2 100644 --- a/sound/soc/sh/rcar/cmd.c +++ b/sound/soc/sh/rcar/cmd.c @@ -43,8 +43,6 @@ static int rsnd_cmd_init(struct rsnd_mod *mod, if (mix) { struct rsnd_dai *rdai; - struct rsnd_mod *src; - struct rsnd_dai_stream *tio; int i; /* @@ -54,8 +52,9 @@ static int rsnd_cmd_init(struct rsnd_mod *mod, */ data = 0; for_each_rsnd_dai(rdai, priv, i) { - tio = &rdai->playback; - src = rsnd_io_to_mod_src(tio); + struct rsnd_dai_stream *tio = &rdai->playback; + struct rsnd_mod *src = rsnd_io_to_mod_src(tio); + if (mix == rsnd_io_to_mod_mix(tio)) data |= path[rsnd_mod_id(src)]; @@ -142,7 +141,7 @@ int rsnd_cmd_probe(struct rsnd_priv *priv) { struct device *dev = rsnd_priv_to_dev(priv); struct rsnd_cmd *cmd; - int i, nr, ret; + int i, nr; /* This driver doesn't support Gen1 at this point */ if (rsnd_is_gen1(priv)) @@ -161,9 +160,9 @@ int rsnd_cmd_probe(struct rsnd_priv *priv) priv->cmd = cmd; for_each_rsnd_cmd(cmd, priv, i) { - ret = rsnd_mod_init(priv, rsnd_mod_get(cmd), - &rsnd_cmd_ops, NULL, - RSND_MOD_CMD, i); + int ret = rsnd_mod_init(priv, rsnd_mod_get(cmd), + &rsnd_cmd_ops, NULL, + RSND_MOD_CMD, i); if (ret) return ret; }