Re: [PATCH v3 03/10] x86/mce: Make several functions return bool and rename a function

From: Borislav Petkov
Date: Wed Oct 30 2024 - 06:25:26 EST


On Tue, Oct 29, 2024 at 03:32:00AM +0000, Zhuo, Qiuxu wrote:
> At first glance, the function name mce_notify_irq() it looks like "MCE
> notifies IRQ ...", which is confusing and doesn't clearly reflect what it
> does.

Maybe to you but the name means exactly that - it is run in irq context.

> But I think the comments above the function clearly indicates which types of
> context it can be used in, so it doesn't need the suffix '_irq' in the
> function name. Renaming it back to mce_notify_user() can better reflect its
> function of notifying the user(s) about the new machine check events.

Who else would you be notifying except the users?!

> renamed mce_notify_user() to mce_notify_irq() to indicate that this function
> should only be called from interrupt context and not used in machine check
> or NMI context. However, the function name mce_notify_irq() is confusing and
> doesn't clearly reflect what it does.

Maybe it confuses you only.

Considering how there's not a notify-in-NMI/MCE counterpart, I guess this
function could be renamed to "mce_notify" simply.

Or not do anything at all. It has been that way for over a decade and hasn't
bothered anyone. Let's not get overeager.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette