lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241124180120.5528e84c@jic23-huawei>
Date: Sun, 24 Nov 2024 18:01:20 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Lothar Rubusch <l.rubusch@...il.com>
Cc: lars@...afoo.de, Michael.Hennerich@...log.com,
 linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
 eraretuya@...il.com
Subject: Re: [PATCH v2 03/22] iio: accel: adxl345: rename struct
 adxl34x_state

On Sun, 17 Nov 2024 18:26:32 +0000
Lothar Rubusch <l.rubusch@...il.com> wrote:

> Rename the struct "adxl345_data" to "adxl34x_state". First, the
> data structure is supposed to be extended to represent state rather than
> only hold sensor data. The data will be a separate member pointer.
> Second, the driver not only covers the adxl345 accelerometer, it also
> supports the adxl345, adxl346 and adxl375. Thus "adxl34x_" is a choice
> for a common prefix.
No to the wild card x.  Long experience has shown that manufacturers
almost never respect naming sequences so we simply name everything after
one supported part number.  It seems like a good idea, but we've been
bitten before.  

I'm fine with the _data to _state change but please combine with the previous
patch to void unnecessary churn where the same line gets updated twice.

These two changes are very closely related so fine to do them in one patch
in my opinion.

> 
> Signed-off-by: Lothar Rubusch <l.rubusch@...il.com>
> ---
>  drivers/iio/accel/adxl345_core.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/accel/adxl345_core.c b/drivers/iio/accel/adxl345_core.c
> index 3fb7a7b1b7..30896555a4 100644
> --- a/drivers/iio/accel/adxl345_core.c
> +++ b/drivers/iio/accel/adxl345_core.c
> @@ -17,7 +17,7 @@
>  
>  #include "adxl345.h"
>  
> -struct adxl345_data {
> +struct adxl34x_state {
>  	const struct adxl345_chip_info *info;
>  	struct regmap *regmap;
>  };
> @@ -43,7 +43,7 @@ static int adxl345_read_raw(struct iio_dev *indio_dev,
>  			    struct iio_chan_spec const *chan,
>  			    int *val, int *val2, long mask)
>  {
> -	struct adxl345_data *st = iio_priv(indio_dev);
> +	struct adxl34x_state *st = iio_priv(indio_dev);
>  	__le16 accel;
>  	long long samp_freq_nhz;
>  	unsigned int regval;
> @@ -99,7 +99,7 @@ static int adxl345_write_raw(struct iio_dev *indio_dev,
>  			     struct iio_chan_spec const *chan,
>  			     int val, int val2, long mask)
>  {
> -	struct adxl345_data *st = iio_priv(indio_dev);
> +	struct adxl34x_state *st = iio_priv(indio_dev);
>  	s64 n;
>  
>  	switch (mask) {
> @@ -181,7 +181,7 @@ static void adxl345_powerdown(void *regmap)
>  int adxl345_core_probe(struct device *dev, struct regmap *regmap,
>  		       int (*setup)(struct device*, struct regmap*))
>  {
> -	struct adxl345_data *st;
> +	struct adxl34x_state *st;
>  	struct iio_dev *indio_dev;
>  	u32 regval;
>  	unsigned int data_format_mask = (ADXL345_DATA_FORMAT_RANGE |


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ