Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Jean-Baptiste Maneyrol <Jean-Baptiste.Maneyrol@tdk.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: [PATCH v1 1/1] iio: imu: inv_mpu6050: Use upper_16_bits()/lower_16_bits() helpers
Date: Sat, 7 Sep 2024 18:18:53 +0100	[thread overview]
Message-ID: <20240907181853.78367ac4@jic23-huawei> (raw)
In-Reply-To: <FR3P281MB1757F1ABDB6FC9F2F02C21B4CE9D2@FR3P281MB1757.DEUP281.PROD.OUTLOOK.COM>

On Thu, 5 Sep 2024 09:16:22 +0000
Jean-Baptiste Maneyrol <Jean-Baptiste.Maneyrol@tdk.com> wrote:

> Hello,
> 
> looks good for me, nice reading improvement indeed.
> 
> Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Applied.

> 
> Thanks for the patch,
> JB
> 
> ________________________________________
> From: Andy Shevchenko <andy.shevchenko@gmail.com>
> Sent: Wednesday, September 4, 2024 20:45
> To: Andy Shevchenko <andy.shevchenko@gmail.com>; linux-iio@vger.kernel.org <linux-iio@vger.kernel.org>; linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>
> Cc: Jonathan Cameron <jic23@kernel.org>; Lars-Peter Clausen <lars@metafoo.de>
> Subject: [PATCH v1 1/1] iio: imu: inv_mpu6050: Use upper_16_bits()/lower_16_bits() helpers
>  
> This Message Is From an External Sender
> This message came from outside your organization.
>  
> Use upper_16_bits()/lower_16_bits() helpers instead of open-coding them.
> This is easier to scan quickly compared to bitwise manipulation, and
> it is pleasingly symmetric.
> 
> Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> ---
>  drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
> index f7bce428d9eb..b15d8c94cc11 100644
> --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
> +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
> @@ -10,6 +10,8 @@
>  #include <linux/i2c.h>
>  #include <linux/dmi.h>
>  #include <linux/acpi.h>
> +#include <linux/wordpart.h>
> +
>  #include "inv_mpu_iio.h"
>  
>  enum inv_mpu_product_name {
> @@ -118,8 +120,8 @@ static int inv_mpu_process_acpi_config(struct i2c_client *client,
>  		return ret;
>  
>  	acpi_dev_free_resource_list(&resources);
> -	*primary_addr = i2c_addr & 0x0000ffff;
> -	*secondary_addr = (i2c_addr & 0xffff0000) >> 16;
> +	*primary_addr = lower_16_bits(i2c_addr);
> +	*secondary_addr = upper_16_bits(i2c_addr);
>  
>  	return 0;
>  }


      reply	other threads:[~2024-09-07 17:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-04 18:45 [PATCH v1 1/1] iio: imu: inv_mpu6050: Use upper_16_bits()/lower_16_bits() helpers Andy Shevchenko
2024-09-05  9:16 ` Jean-Baptiste Maneyrol
2024-09-07 17:18   ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240907181853.78367ac4@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Jean-Baptiste.Maneyrol@tdk.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox