Re: [PATCH] staging: iio: adt7316: use kstrtobool() for sysfs boolean parsing

From: Andy Shevchenko

Date: Mon Oct 12 2026 - 17:05:46 EST


On Tue, Oct 06, 2026 at 01:33:50PM +0300, Abdelnasser Hussein wrote:
> Replace manual and unsafe character checks (e.g., buf[0] == '1') with the
> standard kstrtobool() API in sysfs store functions. This ensures proper
> handling of standard boolean inputs, fixes potential safety issues, and
> adheres to the Linux kernel coding style.

...

> - int enable;
> + bool enable;

> if (_adt7316_store_enabled(chip, enable) < 0)
> return -EIO;

Makes sense, but check that the type of the functions in use take now boolean,
ditto for the rest.

--
With Best Regards,
Andy Shevchenko