Re: [PATCH v2 10/24] platform/x86: ideapad-laptop: misc. device attribute changes

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

 



On Wed, Jan 13, 2021 at 8:23 PM Barnabás Pőcze <pobrn@xxxxxxxxxxxxxx> wrote:
>
> Do not handle zero length buffer separately. Use kstrtouint() instead
> of sscanf().

...

> -       int ret, state;
> +       int ret;
>         struct ideapad_private *priv = dev_get_drvdata(dev);
> +       unsigned int state;

Reversed xmas tree order?

...

> -       if (sscanf(buf, "%i", &state) != 1)
> -               return -EINVAL;
> +       ret = kstrtouint(buf, 0, &state);
> +       if (ret)
> +               return ret;

This seems to me a relaxing case, and should be 10 instead of 0. Am I
right about %i?
If it's true it's probably minor, but still an ABI breakage.

P.S. Same comments for the similar cases.

-- 
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