All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Lyu <richard.lyu@suse.com>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Richard Lyu <richard.lyu@suse.com>,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/apic/msi: Use guard(mutex) in dmar_get_irq_domain()
Date: Wed, 11 Mar 2026 23:15:50 +0800	[thread overview]
Message-ID: <abGHJiH02XF-GGp_@r1chard> (raw)
In-Reply-To: <697cdfdc-027a-4170-b31f-349cb01dd1d0@intel.com>

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


      reply	other threads:[~2026-03-11 15:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11 14:59 [PATCH] x86/apic/msi: Use guard(mutex) in dmar_get_irq_domain() Richard Lyu
2026-03-11 15:03 ` Dave Hansen
2026-03-11 15:15   ` Richard Lyu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=abGHJiH02XF-GGp_@r1chard \
    --to=richard.lyu@suse.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.