Re: [PATCH] usb: misc: cytherm: replace deprecated simple_strtoul with kstrtoint
From: Greg KH
Date: Fri Jul 10 2026 - 09:11:15 EST
On Wed, Jul 08, 2026 at 04:20:03PM +0100, Jad Keskes wrote:
> On 07/08, Greg KH wrote:
> > This changes the user/kernel functionality, are you sure it is safe to
> > do so?
>
> Nobody writes garbage to these on purpose, and if they do by accident
> they should get an error, not 0. The only way this breaks is if some
> tool depends on "echo foo > brightness" silently setting to 0 — which
> would be a bug in that tool.
>
> > What is wrong with leaving the current calls?
>
> simple_strtoul is deprecated per deprecated.rst. It ignores overflows
> too — writing -1 wraps to ULONG_MAX then gets clamped to 0xFF instead
> of erroring out. kstrtoint returns -EINVAL for both.
Sure, it's deprecated, so don't add it to new code, but for existing
stuff, don't change how user/kernel interactions might work.
thanks,
greg k-h