Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: imu: inv_mpu6050: Use upper_16_bits()/lower_16_bits() helpers

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>
Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Link: https://patch.msgid.link/20240904184543.1219866-1-andy.shevchenko@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
482447fd 1d562313

+4 -2
+4 -2
drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
··· 10 10 #include <linux/i2c.h> 11 11 #include <linux/dmi.h> 12 12 #include <linux/acpi.h> 13 + #include <linux/wordpart.h> 14 + 13 15 #include "inv_mpu_iio.h" 14 16 15 17 enum inv_mpu_product_name { ··· 120 118 return ret; 121 119 122 120 acpi_dev_free_resource_list(&resources); 123 - *primary_addr = i2c_addr & 0x0000ffff; 124 - *secondary_addr = (i2c_addr & 0xffff0000) >> 16; 121 + *primary_addr = lower_16_bits(i2c_addr); 122 + *secondary_addr = upper_16_bits(i2c_addr); 125 123 126 124 return 0; 127 125 }