lkml.org 
[lkml]   [2022]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/5] ASoC: sh: rz-ssi: Add functions to get/set substream pointer
On Mon, Jan 10, 2022 at 09:47:11AM +0000, Lad Prabhakar wrote:

> +static struct snd_pcm_substream *rz_ssi_get_substream(struct rz_ssi_stream *strm)
> +{
> + struct rz_ssi_priv *ssi = strm->priv;
> + struct snd_pcm_substream *substream;
> + unsigned long flags;
> +
> + spin_lock_irqsave(&ssi->lock, flags);
> + substream = strm->substream;
> + spin_unlock_irqrestore(&ssi->lock, flags);

This locking doesn't seem useful, we just take a copy of the lock and
then immediately return so the lock isn't protecting anything in
particular - the caller can happily continue using the substream after
the variable has been updated.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2022-01-10 16:11    [W:0.093 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site