mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sang-Heon Jeon <ekffu200098@gmail.com>
To: Julia.Lawall@inria.fr,
	Vijendar Mukunda <Vijendar.Mukunda@amd.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Cezary Rojewski <cezary.rojewski@intel.com>,
	Peter Ujfalusi <peter.ujfalusi@linux.intel.com>,
	Bard Liao <yung-chuan.liao@linux.intel.com>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Daniel Baluta <daniel.baluta@nxp.com>
Cc: cocci@inria.fr, linux-kernel@vger.kernel.org,
	linux-sound@vger.kernel.org,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
	sound-open-firmware@alsa-project.org,
	Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Subject: [PATCH 14/36] ASoC: remove conditional return with no effect
Date: Fri, 24 Jul 2026 03:45:16 +0900	[thread overview]
Message-ID: <20260723184538.3888637-15-ekffu200098@gmail.com> (raw)
In-Reply-To: <20260723184538.3888637-1-ekffu200098@gmail.com>

Both branches of the check return the same value, so the check has
no effect. Remove it and return the value directly.

This is the result of running the Coccinelle script from
scripts/coccinelle/misc/cond_return_no_effect.cocci.

Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
 sound/soc/amd/acp/acp-mach-common.c          | 11 +++--------
 sound/soc/intel/atom/sst-mfld-platform-pcm.c |  7 +------
 sound/soc/samsung/smdk_spdif.c               |  8 ++------
 sound/soc/sof/intel/hda-dsp.c                |  6 +-----
 4 files changed, 7 insertions(+), 25 deletions(-)

diff --git a/sound/soc/amd/acp/acp-mach-common.c b/sound/soc/amd/acp/acp-mach-common.c
index ef784cca13f2..01a0aaa60246 100644
--- a/sound/soc/amd/acp/acp-mach-common.c
+++ b/sound/soc/amd/acp/acp-mach-common.c
@@ -938,15 +938,10 @@ static int acp_max98388_hw_params(struct snd_pcm_substream *substream,
 	struct snd_soc_dai *codec_dai =
 			snd_soc_card_get_codec_dai(card,
 						   MAX98388_CODEC_DAI);
-	int ret;
 
-	ret = snd_soc_dai_set_fmt(codec_dai,
-				  SND_SOC_DAIFMT_CBC_CFC | SND_SOC_DAIFMT_I2S |
-				  SND_SOC_DAIFMT_NB_NF);
-	if (ret < 0)
-		return ret;
-
-	return ret;
+	return snd_soc_dai_set_fmt(codec_dai,
+				   SND_SOC_DAIFMT_CBC_CFC | SND_SOC_DAIFMT_I2S |
+				   SND_SOC_DAIFMT_NB_NF);
 }
 
 static const struct snd_soc_ops acp_max98388_ops = {
diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
index 9ee4d9926e06..a4c8cbfba096 100644
--- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c
+++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
@@ -236,12 +236,7 @@ static int sst_platform_alloc_stream(struct snd_pcm_substream *substream,
 
 	stream->stream_info.str_id = str_params.stream_id;
 
-	ret_val = stream->ops->open(sst->dev, &str_params);
-	if (ret_val <= 0)
-		return ret_val;
-
-
-	return ret_val;
+	return stream->ops->open(sst->dev, &str_params);
 }
 
 static void sst_period_elapsed(void *arg)
diff --git a/sound/soc/samsung/smdk_spdif.c b/sound/soc/samsung/smdk_spdif.c
index 2474eb619882..515e4dfc1432 100644
--- a/sound/soc/samsung/smdk_spdif.c
+++ b/sound/soc/samsung/smdk_spdif.c
@@ -130,12 +130,8 @@ static int smdk_hw_params(struct snd_pcm_substream *substream,
 		return ret;
 
 	/* Set S/PDIF uses internal source clock */
-	ret = snd_soc_dai_set_sysclk(cpu_dai, SND_SOC_SPDIF_INT_MCLK,
-					rclk_rate, SND_SOC_CLOCK_IN);
-	if (ret < 0)
-		return ret;
-
-	return ret;
+	return snd_soc_dai_set_sysclk(cpu_dai, SND_SOC_SPDIF_INT_MCLK,
+				      rclk_rate, SND_SOC_CLOCK_IN);
 }
 
 static const struct snd_soc_ops smdk_spdif_ops = {
diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c
index e9f092f082a1..b9b2bdff4ccb 100644
--- a/sound/soc/sof/intel/hda-dsp.c
+++ b/sound/soc/sof/intel/hda-dsp.c
@@ -1114,11 +1114,7 @@ static int hda_dsp_s5_quirk(struct snd_sof_dev *sdev)
 	usleep_range(500, 1000);
 
 	/* Restore state for shutdown, back to reset */
-	ret = hda_dsp_ctrl_link_reset(sdev, true);
-	if (ret < 0)
-		return ret;
-
-	return ret;
+	return hda_dsp_ctrl_link_reset(sdev, true);
 }
 
 int hda_dsp_shutdown_dma_flush(struct snd_sof_dev *sdev)
-- 
2.43.0


  parent reply	other threads:[~2026-07-23 18:46 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23 18:45 [PATCH 00/36] treewide: remove conditional returns " Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 01/36] coccinelle: misc: add cond_return_no_effect.cocci Sang-Heon Jeon
2026-07-24 11:19   ` [cocci] " Markus Elfring
2026-07-24 11:38     ` Julia Lawall
2026-07-24 11:47       ` Markus Elfring
2026-07-24 14:42     ` Sang-Heon Jeon
2026-07-24 15:32       ` [cocci] [1/36] " Markus Elfring
2026-07-24 16:33         ` Sang-Heon Jeon
2026-07-24 16:50           ` Markus Elfring
2026-07-25  5:46           ` Markus Elfring
2026-07-24 14:41   ` [PATCH 01/36] " Sang-Heon Jeon
2026-07-24 14:55     ` Julia Lawall
2026-07-24 16:02       ` [cocci] [1/36] " Markus Elfring
2026-07-24 16:48       ` [PATCH 01/36] " Sang-Heon Jeon
2026-07-26 11:30       ` [cocci] [1/36] " Markus Elfring
2026-07-26 11:54         ` Julia Lawall
2026-07-26 12:42           ` Markus Elfring
2026-07-27  9:51   ` [cocci] [PATCH 01/36] " Markus Elfring
2026-07-23 18:45 ` [PATCH 02/36] drm/amd: remove conditional return with no effect Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 03/36] drm/radeon: " Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 04/36] dpll: zl3073x: " Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 05/36] drm/i915: " Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 06/36] drm: " Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 07/36] net: ethernet: " Sang-Heon Jeon
2026-07-23 20:24   ` Niklas Söderlund
2026-07-23 20:35   ` Kiyanovski, Arthur
2026-07-23 18:45 ` [PATCH 08/36] net: " Sang-Heon Jeon
2026-07-23 19:04   ` Andrew Lunn
2026-07-23 18:45 ` [PATCH 09/36] net: intel: " Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 10/36] wifi: " Sang-Heon Jeon
2026-07-24  0:37   ` Ping-Ke Shih
2026-07-23 18:45 ` [PATCH 11/36] ipvs: " Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 12/36] media: " Sang-Heon Jeon
2026-07-23 20:26   ` Niklas Söderlund
2026-08-07  7:52   ` Eugen Hristev
2026-08-07 12:28   ` Laurent Pinchart
2026-08-10  9:41     ` Sakari Ailus
2026-07-23 18:45 ` [PATCH 13/36] ALSA: " Sang-Heon Jeon
2026-07-23 18:45 ` Sang-Heon Jeon [this message]
2026-07-24  5:05   ` [PATCH 14/36] ASoC: " Mukunda,Vijendar
2026-07-23 18:45 ` [PATCH 15/36] iio: " Sang-Heon Jeon
2026-07-23 21:46   ` Joshua Crofts
2026-07-24  0:38   ` Jonathan Cameron
2026-07-24 15:22     ` Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 16/36] Input: " Sang-Heon Jeon
2026-07-24 19:30   ` Dmitry Torokhov
2026-07-25 12:10     ` Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 17/36] clk: " Sang-Heon Jeon
2026-07-24 15:49   ` Brian Masney
2026-07-23 18:45 ` [PATCH 18/36] crypto: drivers - " Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 19/36] dmaengine: qcom_hidma: " Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 20/36] stm class: " Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 21/36] RDMA/ocrdma: " Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 22/36] iommu/s390: " Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 23/36] dm vdo: " Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 24/36] pinctrl: mediatek: " Sang-Heon Jeon
2026-07-25 13:50   ` Linus Walleij
2026-07-23 18:45 ` [PATCH 25/36] platform/x86: toshiba_haps: " Sang-Heon Jeon
2026-07-24 15:44   ` Ilpo Järvinen
2026-07-24 16:21     ` Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 26/36] power: supply: pm8916_lbc: " Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 27/36] RAS/AMD/ATL: " Sang-Heon Jeon
2026-07-23 19:44   ` Borislav Petkov
2026-07-23 18:45 ` [PATCH 28/36] regulator: wm831x-isink: " Sang-Heon Jeon
2026-07-24  8:24   ` Charles Keepax
2026-07-23 18:45 ` [PATCH 29/36] rtc: pcf2127: " Sang-Heon Jeon
2026-07-26 15:15   ` Bruno Thomsen
2026-08-20 21:28   ` (subset) " Alexandre Belloni
2026-07-23 18:45 ` [PATCH 30/36] scsi: mpt3sas: " Sang-Heon Jeon
2026-07-29  2:31   ` Martin K. Petersen
2026-07-23 18:45 ` [PATCH 31/36] thermal/drivers/k3_bandgap: " Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 32/36] USB: serial: ch341: " Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 33/36] usb: typec: fusb302: " Sang-Heon Jeon
2026-07-27 13:35   ` Heikki Krogerus
2026-07-23 18:45 ` [PATCH 34/36] smb: client: " Sang-Heon Jeon
2026-07-23 20:27   ` Steve French
2026-07-24 17:12     ` Sang-Heon Jeon
2026-07-25 16:58       ` Steve French
2026-07-23 18:45 ` [PATCH 35/36] cpupower: " Sang-Heon Jeon
2026-08-04 19:15   ` Shuah
2026-07-23 18:45 ` [PATCH 36/36] memblock: " Sang-Heon Jeon
2026-07-24 21:48 ` [PATCH 00/36] treewide: remove conditional returns " Jakub Kicinski
2026-07-27  8:30   ` Jani Nikula
2026-07-27 11:08     ` Sang-Heon Jeon
2026-07-27 11:36       ` Jani Nikula
2026-07-24 23:35 ` (subset) " Sebastian Reichel
2026-07-27 12:12 ` Mark Brown
2026-07-27 12:59   ` Sang-Heon Jeon
2026-07-27 12:26 ` (subset) " Mark Brown
2026-08-06 19:06 ` Martin K. Petersen
2026-08-11 18:51 ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260723184538.3888637-15-ekffu200098@gmail.com \
    --to=ekffu200098@gmail.com \
    --cc=Julia.Lawall@inria.fr \
    --cc=Vijendar.Mukunda@amd.com \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=cocci@inria.fr \
    --cc=daniel.baluta@nxp.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=s.nawrocki@samsung.com \
    --cc=sound-open-firmware@alsa-project.org \
    --cc=tiwai@suse.com \
    --cc=venkataprasad.potturu@amd.com \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®