On Tue, Jan 27, 2026 at 07:54:40AM -0600, Corey Minyard wrote:
> It made things hard to read, move the check to a function.
>
> Signed-off-by: Corey Minyard <[email protected]>
> ---
> drivers/char/ipmi/ipmi_msghandler.c | 40 ++++++++++++++++-------------
> 1 file changed, 22 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/char/ipmi/ipmi_msghandler.c
> b/drivers/char/ipmi/ipmi_msghandler.c
> index a590a67294e2..030828cdb778 100644
> --- a/drivers/char/ipmi/ipmi_msghandler.c
> +++ b/drivers/char/ipmi/ipmi_msghandler.c
> @@ -602,6 +602,20 @@ static int __ipmi_bmc_register(struct ipmi_smi *intf,
> static int __scan_channels(struct ipmi_smi *intf,
> struct ipmi_device_id *id, bool rescan);
>
> +static void ipmi_lock_xmit_msgs(struct ipmi_smi *intf, int run_to_completion,
> + unsigned long *flags)
> +{
> + if (!run_to_completion)
> + spin_lock_irqsave(&intf->xmit_msgs_lock, *flags);
> +}
I usually see the opposite construction in most cases. Something like:
static void ipmi_lock_xmit_msgs(struct ipmi_smi *intf, int
run_to_completion,
unsigned long *flags)
{
if (run_to_completion)
return;
spin_lock_irqsave(&intf->xmit_msgs_lock, *flags);
}
Thanks for doing this, this looks way better!
--breno
_______________________________________________
Openipmi-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openipmi-developer