Re: [PATCH 08/24] platform/x86: thinkpad_acpi: Move adaptive kbd event handling to tpacpi_driver_event()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 22, 2024 at 11:29 AM Ilpo Järvinen
<ilpo.jarvinen@xxxxxxxxxxxxxxx> wrote:
> On Sun, 21 Apr 2024, Hans de Goede wrote:

...

> > +     int mode = adaptive_keyboard_get_mode();
> > +
> > +     if (mode < 0)
>
> Please try to keep call and it's error handling together, it costs one
> line but takes less effort to understand:
>
>         int mode;
>
>         mode = adaptive_keyboard_get_mode();
>         if (mode < 0)
>
> > +             return;

And not only that. In long-term maintenance the original code is prone
to subtle errors in case some other code is squeezed in between.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux