Re: [PATCH v1 03/10] staging: iio: cdc: ad7746: Remove exceptional & on function name

From: Jonathan Cameron
Date: Sat Mar 11 2017 - 13:39:53 EST


On 11/03/17 14:26, simran singhal wrote:
> Remove & from function pointers to conform to the style found elsewhere
> in the file. Done using the following semantic patch
>
> // <smpl>
> @r@
> identifier f;
> @@
>
> f(...) { ... }
> @@
> identifier r.f;
> @@
>
> - &f
> + f
> // </smpl>
>
> Signed-off-by: simran singhal <singhalsimran0@xxxxxxxxx>
Applied.

It's a little unobvious that other function pointers in this
one don't have the & as they are only used via macros.

However, I'm in general in favour of the change so don't
really care that much!

Jonathan
> ---
> drivers/staging/iio/cdc/ad7746.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/iio/cdc/ad7746.c b/drivers/staging/iio/cdc/ad7746.c
> index 81f8b9e..6294de7 100644
> --- a/drivers/staging/iio/cdc/ad7746.c
> +++ b/drivers/staging/iio/cdc/ad7746.c
> @@ -664,8 +664,8 @@ static int ad7746_read_raw(struct iio_dev *indio_dev,
>
> static const struct iio_info ad7746_info = {
> .attrs = &ad7746_attribute_group,
> - .read_raw = &ad7746_read_raw,
> - .write_raw = &ad7746_write_raw,
> + .read_raw = ad7746_read_raw,
> + .write_raw = ad7746_write_raw,
> .driver_module = THIS_MODULE,
> };
>
>