Re: [PATCH] misc: ad525x_dpot: Replace sprintf with sysfs_emit in sysfs_show_reg

From: Thorsten Blum
Date: Mon Nov 03 2025 - 08:14:32 EST


On 3. Nov 2025, at 13:46, Greg Kroah-Hartman wrote:
> On Mon, Nov 03, 2025 at 01:34:03PM +0100, Thorsten Blum wrote:
>> Replace sprintf() with sysfs_emit() in sysfs_show_reg(). sysfs_emit() is
>> preferred for formatting sysfs output as it provides better bounds
>> checking. No functional changes.
>>
>> Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
>> Suggested-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
>> ---
>> [...]
>
> I did not suggest doing this for existing code at all, it's only needed
> for new code, I've said so many times.

You suggested it in [1] for this function when I made another change to
it a few weeks ago. I even replied that there's no coccicheck warning,
and that the sysfs_emit change should probably be a separate patch.

No big deal, but still confusing.

Thanks,
Thorsten

[1] https://lore.kernel.org/lkml/2025082052-crawfish-revisable-7965@gregkh/