Re: [PATCH v3 2/8] iio: magnetometer: yas530: Change range of data in volatile register

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

 



On Sat, 18 Jun 2022 02:13:10 +0200
Jakob Hauser <jahau@xxxxxxxxxxxxxx> wrote:

> In function yas5xx_volatile_reg(), the range for measure data should end at
> "YAS5XX_MEASURE_DATA + 7" instead of "+ 8" as we count from 0 to 7 here.
> 
> This change is of low importance as the "+ 8" register isn't called.
> 
> Cc: Linus Walleij <linus.walleij@xxxxxxxxxx>

Drop the Cc now you have an RB from Linus.

> Signed-off-by: Jakob Hauser <jahau@xxxxxxxxxxxxxx>
> Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> ---
>  drivers/iio/magnetometer/yamaha-yas530.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/magnetometer/yamaha-yas530.c b/drivers/iio/magnetometer/yamaha-yas530.c
> index 40192aa46b04..2799ae0784fd 100644
> --- a/drivers/iio/magnetometer/yamaha-yas530.c
> +++ b/drivers/iio/magnetometer/yamaha-yas530.c
> @@ -527,7 +527,7 @@ static bool yas5xx_volatile_reg(struct device *dev, unsigned int reg)
>  {
>  	return reg == YAS5XX_ACTUATE_INIT_COIL ||
>  		reg == YAS5XX_MEASURE ||
> -		(reg >= YAS5XX_MEASURE_DATA && reg <= YAS5XX_MEASURE_DATA + 8);
> +		(reg >= YAS5XX_MEASURE_DATA && reg <= YAS5XX_MEASURE_DATA + 7);
trivial, but I'd prefer it as
reg < RAS5XX_MEASURE_DATA + 8
because we have 8 registers and do bulk reads of sizeof(u8[8]) so it is more natural
to use 8 as the constant.


>  }
>  
>  /* TODO: enable regmap cache, using mark dirty and sync at runtime resume */




[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