Re: [PATCH v2] coccinelle: device_attr_show: Adapt to the latest Documentation/filesystems/sysfs.rst

From: Zhijian Li (Fujitsu)
Date: Sun Jan 21 2024 - 22:29:23 EST




On 21/01/2024 05:20, Julia Lawall wrote:
>> V2:
>> - changed title from coccinelle: device_attr_show.cocci: update description and warning message
>> - Fix MODE=patch
>> - Extract patch from the patch set[1] so that maintainer can accept it separately.
> Applied.
>
> I subsequently simplified the patch case to contain the following:
>
> - snprintf(BUF, SZ, FORMAT
> + sysfs_emit(BUF, FORMAT
> ,...);
Great, that was what i want. But i didn't get the correct syntax. I wrote it wrongly:
- snprintf(BUF, SZ, FORMAT, ...);
+ sysfs_emit(BUF, SZ, FORMAT, ...);



>
> This also works for the case where there are only three arguments.
> It has the benefit that the change is recognized as a line replacement, so
> no extra {} are added when the call is in an if branch.