[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251027143850.2070427-5-andriy.shevchenko@linux.intel.com>
Date: Mon, 27 Oct 2025 15:34:53 +0100
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
linux-iio@...r.kernel.org,
chrome-platform@...ts.linux.dev,
linux-kernel@...r.kernel.org,
linux-media@...r.kernel.org
Cc: Jonathan Cameron <jic23@...nel.org>,
David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>,
Benson Leung <bleung@...omium.org>,
Guenter Roeck <groeck@...omium.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Michael Hennerich <Michael.Hennerich@...log.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
"Daniel W. S. Almeida" <dwlsalmeida@...il.com>
Subject: [PATCH v1 4/6] iio: cros_ec_sensors: Convert to use PI definition
Convert to use PI definition instead of open coded value of it.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
index 82cef4a12442..7e7b7f97454d 100644
--- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
+++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
@@ -21,6 +21,7 @@
#include <linux/platform_data/cros_ec_commands.h>
#include <linux/platform_data/cros_ec_proto.h>
#include <linux/platform_device.h>
+#include <linux/units.h>
#include <linux/slab.h>
#define CROS_EC_SENSORS_MAX_CHANNELS 4
@@ -120,8 +121,7 @@ static int cros_ec_sensors_read(struct iio_dev *indio_dev,
* loss. Round to the nearest integer.
*/
*val = 0;
- *val2 = div_s64(val64 * 3141592653ULL,
- 180 << (CROS_EC_SENSOR_BITS - 1));
+ *val2 = div_s64(val64 * PI, 180 << (CROS_EC_SENSOR_BITS - 1));
ret = IIO_VAL_INT_PLUS_NANO;
break;
case MOTIONSENSE_TYPE_MAG:
--
2.50.1
Powered by blists - more mailing lists