alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sound:soc:remove unneeded variable
@ 2021-12-09  1:57 cgel.zte
  2021-12-24 14:03 ` Mark Brown
  2021-12-24 16:17 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: cgel.zte @ 2021-12-09  1:57 UTC (permalink / raw)
  To: lgirdwood
  Cc: pierre-louis.bossart, alsa-devel, srivasam, lkp,
	kuninori.morimoto.gx, linux-kernel, tiwai, chi.minghao, broonie,
	pulehui, Zeal Robot, matthias.bgg, linux-mediatek,
	linux-arm-kernel

From: chiminghao <chi.minghao@zte.com.cn>

return value form directly instead of
taking this in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cm>
Signed-off-by: chiminghao <chi.minghao@zte.com.cn>
---
 sound/soc/codecs/mt6660.c  | 5 ++---
 sound/soc/codecs/wcd938x.c | 6 ++----
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/sound/soc/codecs/mt6660.c b/sound/soc/codecs/mt6660.c
index 358c500377df..3a881523c30f 100644
--- a/sound/soc/codecs/mt6660.c
+++ b/sound/soc/codecs/mt6660.c
@@ -47,13 +47,12 @@ static int mt6660_reg_write(void *context, unsigned int reg, unsigned int val)
 	struct mt6660_chip *chip = context;
 	int size = mt6660_get_reg_size(reg);
 	u8 reg_data[4];
-	int i, ret;
+	int i;
 
 	for (i = 0; i < size; i++)
 		reg_data[size - i - 1] = (val >> (8 * i)) & 0xff;
 
-	ret = i2c_smbus_write_i2c_block_data(chip->i2c, reg, size, reg_data);
-	return ret;
+	return i2c_smbus_write_i2c_block_data(chip->i2c, reg, size, reg_data);
 }
 
 static int mt6660_reg_read(void *context, unsigned int reg, unsigned int *val)
diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c
index 52de7d14b139..0033d61d42e8 100644
--- a/sound/soc/codecs/wcd938x.c
+++ b/sound/soc/codecs/wcd938x.c
@@ -3083,7 +3083,7 @@ static int wcd938x_mbhc_micb_ctrl_threshold_mic(struct snd_soc_component *compon
 						int micb_num, bool req_en)
 {
 	struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component);
-	int rc, micb_mv;
+	int micb_mv;
 
 	if (micb_num != MIC_BIAS_2)
 		return -EINVAL;
@@ -3097,9 +3097,7 @@ static int wcd938x_mbhc_micb_ctrl_threshold_mic(struct snd_soc_component *compon
 
 	micb_mv = req_en ? WCD_MBHC_THR_HS_MICB_MV : wcd938x->micb2_mv;
 
-	rc = wcd938x_mbhc_micb_adjust_voltage(component, micb_mv, MIC_BIAS_2);
-
-	return rc;
+	return wcd938x_mbhc_micb_adjust_voltage(component, micb_mv, MIC_BIAS_2);
 }
 
 static inline void wcd938x_mbhc_get_result_params(struct wcd938x_priv *wcd938x,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] sound:soc:remove unneeded variable
  2021-12-09  1:57 [PATCH] sound:soc:remove unneeded variable cgel.zte
@ 2021-12-24 14:03 ` Mark Brown
  2021-12-24 16:17 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-12-24 14:03 UTC (permalink / raw)
  To: cgel.zte
  Cc: pierre-louis.bossart, alsa-devel, srivasam, lkp,
	kuninori.morimoto.gx, linux-kernel, tiwai, chi.minghao,
	lgirdwood, srinivas.kandagatla, pulehui, Zeal Robot,
	matthias.bgg, linux-mediatek, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 542 bytes --]

On Thu, Dec 09, 2021 at 01:57:07AM +0000, cgel.zte@gmail.com wrote:
> From: chiminghao <chi.minghao@zte.com.cn>
> 
> return value form directly instead of
> taking this in another redundant variable.

Please submit patches using subject lines reflecting the style for the
subsystem, this makes it easier for people to identify relevant patches.
Look at what existing commits in the area you're changing are doing and
make sure your subject lines visually resemble what they're doing.
There's no need to resubmit to fix this alone.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sound:soc:remove unneeded variable
  2021-12-09  1:57 [PATCH] sound:soc:remove unneeded variable cgel.zte
  2021-12-24 14:03 ` Mark Brown
@ 2021-12-24 16:17 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-12-24 16:17 UTC (permalink / raw)
  To: cgel.zte, lgirdwood
  Cc: pierre-louis.bossart, alsa-devel, srivasam, lkp,
	kuninori.morimoto.gx, Zeal Robot, tiwai, linux-kernel,
	chi.minghao, srinivas.kandagatla, pulehui, matthias.bgg,
	linux-mediatek, linux-arm-kernel

On Thu, 9 Dec 2021 01:57:07 +0000, cgel.zte@gmail.com wrote:
> From: chiminghao <chi.minghao@zte.com.cn>
> 
> return value form directly instead of
> taking this in another redundant variable.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] sound:soc:remove unneeded variable
      commit: b2fde4deff854ca7d49ec735a8252d944418b64d

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-24 16:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-09  1:57 [PATCH] sound:soc:remove unneeded variable cgel.zte
2021-12-24 14:03 ` Mark Brown
2021-12-24 16:17 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).