From: Claudiu Beznea Date: Mon, 19 Jan 2026 19:52:49 +0000 (+0200) Subject: ASoC: renesas: rz-ssi: Simplify the logic in rz_ssi_stream_is_play() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53dfb2ad6fcff111f58aa506afbbf6fd82f32cb1;p=thirdparty%2Fkernel%2Flinux.git ASoC: renesas: rz-ssi: Simplify the logic in rz_ssi_stream_is_play() The code in rz_ssi_stream_is_play() checks whether substream->stream is different from SNDRV_PCM_STREAM_PLAYBACK and returns the capture struct rz_ssi_stream in that case. The logic is easier to follow if substream->stream is compared directly against SNDRV_PCM_STREAM_CAPTURE and return the capture struct rz_ssi_stream. Use the conditional operator to simplify the code. Signed-off-by: Claudiu Beznea Link: https://patch.msgid.link/20260119195252.3362486-2-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/renesas/rz-ssi.c b/sound/soc/renesas/rz-ssi.c index f4dc2f68deada..f144cbc89fad6 100644 --- a/sound/soc/renesas/rz-ssi.c +++ b/sound/soc/renesas/rz-ssi.c @@ -178,12 +178,7 @@ static inline bool rz_ssi_stream_is_play(struct snd_pcm_substream *substream) static inline struct rz_ssi_stream * rz_ssi_stream_get(struct rz_ssi_priv *ssi, struct snd_pcm_substream *substream) { - struct rz_ssi_stream *stream = &ssi->playback; - - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) - stream = &ssi->capture; - - return stream; + return (ssi->playback.substream == substream) ? &ssi->playback : &ssi->capture; } static inline bool rz_ssi_is_dma_enabled(struct rz_ssi_priv *ssi)