Re: [PATCH] staging: iio/meter: add name to function definition arguments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Daniel

> Hi Rodrigo,
> 
> I think this is a nice finding. One comment inline:
> 
> On Vi, 2018-02-16 at 10:50 -0200, rodrigosiqueira wrote:
> > This patch fixes the checkpatch.pl warning:
> > 
> > drivers/staging/iio/meter/ade7854.h:157: WARNING: function definition
> > argument 'struct device *' should also have an identifier name...
>
> > +	int (*read_reg_32)(struct device *dev, u16 reg_address, u32 *val);
> > +	int (*write_reg_8)(struct device *dev, u16 reg_address, u8 value);
> 
> 
> Any particular reason for using val vs value? I get that one is a pointer
> and another a plain type, but I think the name should be the same.

Before I selected the name, I figure out that read_reg_* and write_reg_*
was assigned inside the iio/meter/ade7754-(i2c|spi).c files by function
like ade7754_*_read_reg_* and ade7754_*_write_reg_* .

I considered to use 'value' name for both functions parameters, however,
I noticed that function ade7754_*_write_reg_* adopted the name 'value'
for the last argument and ade7754_*_read_reg_* named the last argument
as 'val'. So, for consistency sake between the header file and the c
code, I decided to use the same parameter name patterns.


> thanks,
> Daniel.
>

Thanks 
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux