Re: [PATCH] x86/apic/msi: Use guard(mutex) in dmar_get_irq_domain()

From: Dave Hansen

Date: Wed Mar 11 2026 - 11:03:54 EST


On 3/11/26 07:59, Richard Lyu wrote:
> The dmar_get_irq_domain() function uses a mutex to protect the
> initialization of the dmar_domain. Using guard(mutex) simplifies the
> control flow, removes the need for a 'out' label, and ensures the
> lock is automatically released regardless of the return path.

I think these are kinda like whitespace fixes: If you're fixing a bug or
otherwise refactoring the code, go right ahead and convert over to
guard(). Otherwise, they're not worth the code churn.