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


_______________________________________________
ibm-acpi-devel mailing list
ibm-acpi-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel




[Index of Archives]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Photo]     [Yosemite Photos]     [Yosemite Advice]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux