Re: [PATCH 0/5] iio: use permission specific variants of DEVICE_ATTR

From: Joe Perches
Date: Thu Jan 04 2018 - 10:16:26 EST


On Thu, 2018-01-04 at 20:06 +0530, Aishwarya Pant wrote:
> Series of clean-up patches which replace all DEVICE_ATTR macros with the
> permission specific variants DEVICE_ATTR_{RO/WO/RW}.
>
> Patches were created using coccinelle. The following script is for conversion to
> the DEVICE_ATTR_RO macro and the other conversions are similar. The script may
> require some manual intervention when multiple attributes share the show or
> store function.

I do think the perl scripts are a bit better here
as they can verify the show/store functions are
static, used once, the new functions names are
unused and so can be renamed without conflict.

Maybe the python bits can be extended to copy
these perl checks and avoid the possible manual
inspection and verification requirements.

https://lkml.org/lkml/2017/12/22/844