Re: [PATCH] x86/apic/msi: Use guard(mutex) in dmar_get_irq_domain()
From: Richard Lyu
Date: Wed Mar 11 2026 - 11:17:10 EST
On 2026/03/11 08:03, Dave Hansen wrote:
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.
Thank you for the feedback.
That makes total sense. I understand the concern about unnecessary code
churn and will avoid sending pure stylistic cleanups unless they are
part of a larger functional change or bug fix in the future.
Richard