Re: [PATCH v3] x86/platform/uv: Rework NMI "action" modparam handling

From: Andy Shevchenko
Date: Sat Sep 16 2023 - 09:36:35 EST


On Sat, Sep 16, 2023 at 4:07 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
>
> Rework NMI "action" modparam handling:
>
> 1. Replace the uv_nmi_action string with an enum; and
> 2. Use sysfs_match_string() for string parsing in param_set_action()

Reviewed-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>

...

> static int param_get_action(char *buffer, const struct kernel_param *kp)
> {
> - return sprintf(buffer, "%s\n", uv_nmi_action);
> + return sprintf(buffer, "%s\n", actions[uv_nmi_action]);
> }

Recently I have sent a patch to make all *printf() to be sysfs_emit()
in params.c a s I believe that those are for sysfs only. That said, I
think this is the case here. But, this is out of scope of the change
and up to you what to do with this (meanwhile you are using
*sysfs*_match_string() which emphasizes the use case already).

--
With Best Regards,
Andy Shevchenko