From nobody Fri Nov 29 21:59:35 2024 Received: from cmccmta2.chinamobile.com (cmccmta2.chinamobile.com [111.22.67.135]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8FA3783CD6; Sat, 14 Sep 2024 07:24:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=111.22.67.135 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726298659; cv=none; b=AK4uGMC0rdWTmtcBJdxdX661gOva1QKy7aCPmFbUYf07FOUN+R6nOjJlRSSjTxc/wYNds1Pevqrau2I3AaxZRwiIJsHgyzST+6Bm/xpuZiAVj1sWT03nodNWuUuov6WdSaclrFXn447Lsn89UtnfsF15BDzNkjA4DSkC2yBPrUM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726298659; c=relaxed/simple; bh=VkMGAtffLbvdQYgO/+tFo8X5yq65AjvU2bRStlj604g=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=fHdH4Xxt1ZfenZgJmiRdxj/UhcqZa6j4aIkDLrmL6j9iE4VgtGdNZGTuxarb3Y/z2hUu04p1NqNAjpijT8DperDtmQDhjk2ueqTaXnR/qePLUAQXbzeUPEXRF+PQslG8tDryYofMYwb31askOvvaaCF9O6v1phKKzJF6tz97K/U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=cmss.chinamobile.com; spf=pass smtp.mailfrom=cmss.chinamobile.com; arc=none smtp.client-ip=111.22.67.135 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=cmss.chinamobile.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmss.chinamobile.com X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from spf.mail.chinamobile.com (unknown[10.188.0.87]) by rmmx-syy-dmz-app07-12007 (RichMail) with SMTP id 2ee766e53a1a0c5-390cb; Sat, 14 Sep 2024 15:24:13 +0800 (CST) X-RM-TRANSID: 2ee766e53a1a0c5-390cb X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from leadsec.example.com.localdomain (unknown[10.54.5.252]) by rmsmtp-syy-appsvr07-12007 (RichMail) with SMTP id 2ee766e53a1344e-94fe4; Sat, 14 Sep 2024 15:24:12 +0800 (CST) X-RM-TRANSID: 2ee766e53a1344e-94fe4 From: Tang Bin To: shenghao-ding@ti.com, kevin-lu@ti.com, baojun.xu@ti.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Tang Bin Subject: [PATCH] ASoC: tas2781: Fix redundant parameter assignment Date: Sat, 14 Sep 2024 15:23:52 +0800 Message-Id: <20240914072352.2997-1-tangbin@cmss.chinamobile.com> X-Mailer: git-send-email 2.33.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In these functions, the variable 'rc' is redundant, thus remove it. Signed-off-by: Tang Bin --- sound/soc/codecs/tas2781-i2c.c | 35 ++++++++-------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/sound/soc/codecs/tas2781-i2c.c b/sound/soc/codecs/tas2781-i2c.c index 8a8d97dd7..68887799e 100644 --- a/sound/soc/codecs/tas2781-i2c.c +++ b/sound/soc/codecs/tas2781-i2c.c @@ -650,7 +650,6 @@ static int tasdev_tf_data_get(struct snd_kcontrol *kcon= trol, (struct soc_bytes_ext *) kcontrol->private_value; unsigned char *dst =3D ucontrol->value.bytes.data; unsigned int reg; - int rc =3D -1; =20 if (tas_priv->chip_id =3D=3D TAS2781) reg =3D TAS2781_RUNTIME_RE_REG_TF; @@ -659,9 +658,7 @@ static int tasdev_tf_data_get(struct snd_kcontrol *kcon= trol, =20 guard(mutex)(&tas_priv->codec_lock); dst[0] =3D bytes_ext->max; - rc =3D calib_data_get(tas_priv, reg, &dst[1]); - - return rc; + return calib_data_get(tas_priv, reg, &dst[1]); } =20 static int tasdev_re_data_get(struct snd_kcontrol *kcontrol, @@ -673,7 +670,6 @@ static int tasdev_re_data_get(struct snd_kcontrol *kcon= trol, (struct soc_bytes_ext *) kcontrol->private_value; unsigned char *dst =3D ucontrol->value.bytes.data; unsigned int reg; - int rc =3D -1; =20 if (tas_priv->chip_id =3D=3D TAS2781) reg =3D TAS2781_RUNTIME_RE_REG; @@ -681,9 +677,7 @@ static int tasdev_re_data_get(struct snd_kcontrol *kcon= trol, reg =3D TAS2563_RUNTIME_RE_REG; guard(mutex)(&tas_priv->codec_lock); dst[0] =3D bytes_ext->max; - rc =3D calib_data_get(tas_priv, reg, &dst[1]); - - return rc; + return calib_data_get(tas_priv, reg, &dst[1]); } =20 static int tasdev_r0_data_get(struct snd_kcontrol *kcontrol, @@ -696,7 +690,6 @@ static int tasdev_r0_data_get(struct snd_kcontrol *kcon= trol, (struct soc_bytes_ext *) kcontrol->private_value; unsigned char *dst =3D ucontrol->value.bytes.data; unsigned int reg; - int rc =3D -1; =20 guard(mutex)(&tas_priv->codec_lock); =20 @@ -707,9 +700,7 @@ static int tasdev_r0_data_get(struct snd_kcontrol *kcon= trol, else return -1; dst[0] =3D bytes_ext->max; - rc =3D calib_data_get(tas_priv, reg, &dst[1]); - - return rc; + return calib_data_get(tas_priv, reg, &dst[1]); } =20 static int tasdev_XMA1_data_get(struct snd_kcontrol *kcontrol, @@ -721,13 +712,10 @@ static int tasdev_XMA1_data_get(struct snd_kcontrol *= kcontrol, (struct soc_bytes_ext *) kcontrol->private_value; unsigned char *dst =3D ucontrol->value.bytes.data; unsigned int reg =3D TASDEVICE_XM_A1_REG; - int rc =3D -1; =20 guard(mutex)(&tas_priv->codec_lock); dst[0] =3D bytes_ext->max; - rc =3D calib_data_get(tas_priv, reg, &dst[1]); - - return rc; + return calib_data_get(tas_priv, reg, &dst[1]); } =20 static int tasdev_XMA2_data_get(struct snd_kcontrol *kcontrol, @@ -739,13 +727,10 @@ static int tasdev_XMA2_data_get(struct snd_kcontrol *= kcontrol, (struct soc_bytes_ext *) kcontrol->private_value; unsigned char *dst =3D ucontrol->value.bytes.data; unsigned int reg =3D TASDEVICE_XM_A2_REG; - int rc =3D -1; =20 guard(mutex)(&tas_priv->codec_lock); dst[0] =3D bytes_ext->max; - rc =3D calib_data_get(tas_priv, reg, &dst[1]); - - return rc; + return calib_data_get(tas_priv, reg, &dst[1]); } =20 static int tasdev_nop_get( @@ -1115,14 +1100,12 @@ static int tasdevice_active_num_put(struct snd_kcon= trol *kcontrol, struct snd_soc_component *codec =3D snd_soc_kcontrol_component(kcontrol); struct tasdevice_priv *tas_priv =3D snd_soc_component_get_drvdata(codec); int dev_id =3D ucontrol->value.integer.value[0]; - int max =3D tas_priv->ndev - 1, rc; + int max =3D tas_priv->ndev - 1; =20 dev_id =3D clamp(dev_id, 0, max); =20 guard(mutex)(&tas_priv->codec_lock); - rc =3D tasdev_chn_switch(tas_priv, dev_id); - - return rc; + return tasdev_chn_switch(tas_priv, dev_id); } =20 static int tasdevice_dsp_create_ctrls(struct tasdevice_priv *tas_priv) @@ -1339,10 +1322,8 @@ static int tasdevice_create_cali_ctrls(struct tasdev= ice_priv *priv) i++; } =20 - rc =3D snd_soc_add_component_controls(priv->codec, cali_ctrls, + return snd_soc_add_component_controls(priv->codec, cali_ctrls, nctrls < i ? nctrls : i); - - return rc; } =20 static void tasdevice_fw_ready(const struct firmware *fmw, --=20 2.33.0