Re: [PATCH 01/20] ASoC: Intel: catpt: ipc: Use guard() for mutex & spin locks

From: Bui Duc Phuc

Date: Fri Jun 12 2026 - 00:05:54 EST


Hi,

> The catpt_dsp_send_msg_timeout is already part of Mark's tree [1]. At
> the same time I'm against using scoped_guard() for
> catpt_dsp_do_send_msg(). The existing code is small and transparent,
> there is no need to tabify it.
>

> > @@ -97,10 +96,10 @@ static int catpt_dsp_do_send_msg(struct catpt_dev *cdev,
> > (reply && reply->size > ipc->config.outbox_size))
> > return -EINVAL;
> >
> > - spin_lock_irqsave(&ipc->lock, flags);
> > - catpt_ipc_msg_init(ipc, reply);
> > - catpt_dsp_send_tx(cdev, &request);
> > - spin_unlock_irqrestore(&ipc->lock, flags);
> > + scoped_guard(spinlock_irqsave, &ipc->lock) {
> > + catpt_ipc_msg_init(ipc, reply);
> > + catpt_dsp_send_tx(cdev, &request);
> > + }
> >
> > ret = catpt_wait_msg_completion(cdev, timeout);

So I understand that, for this conversion effort, you would prefer a
case-by-case approach rather than converting everything to
guard()/scoped_guard() purely for consistency. Is that correct?

Best regards,
Phuc