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

From: Jonathan Cameron

Date: Sat Oct 17 2026 - 18:11:40 EST


On Wed, 7 Oct 2026 16:51:51 +0300
Abdelnasser Hussein <abdelnasserhussein11@xxxxxxxxx> 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.
>
> Reviewed-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
> Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11@xxxxxxxxx>
> ---
> Changes in v2:
> - Included <linux/kstrtox.h> explicitly as requested.
> - Renamed the boolean variable from 'req' to 'val'. (My initial thought was 'req' as an abbreviation for 'user request', but 'val' is much clearer and avoids any confusion with block/network requests).
> - Added Reviewed-by tag from Joshua.

I'm not immediately spotting the tag in Joshua's reply.

If it wasn't explicitly given you shouldn't add it.

J