Re: [PATCH 2/2] ipmi: Consolidate the run to completion checking for xmit msgs lock
From: Breno Leitao
Date: Tue Jan 27 2026 - 10:13:01 EST
On Tue, Jan 27, 2026 at 08:46:06AM -0600, Corey Minyard wrote:
> On Tue, Jan 27, 2026 at 06:41:48AM -0800, Breno Leitao wrote:
> > 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 <corey@xxxxxxxxxxx>
> > > ---
> > > 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);
> > }
>
> Yes, that's better, I've changed it.
Thanks. feel free to add:
Reviewed-by: Breno Leitao <leitao@xxxxxxxxxx>
Thanks for the quick replies,
--breno