Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1738722

[PATCH 1/3] iio: accel: mma8452: Rename time step look up struct to generic name as the values are same for all the events.

From Harinath Nampally <harinath922@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 1/3] iio: accel: mma8452: Rename time step look up struct to generic name as the values are same for all the events.
Date 2017-09-25 05:20 +0200
Message-ID <uts66-zR-21@gated-at.bofh.it> (permalink)
References <uts65-zR-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Improves code readability, no impact on functionality.

Signed-off-by: Harinath Nampally <harinath922@gmail.com>
---
 drivers/iio/accel/mma8452.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
index 3472e7e..74b6221 100644
--- a/drivers/iio/accel/mma8452.c
+++ b/drivers/iio/accel/mma8452.c
@@ -284,7 +284,7 @@ static const int mma8452_samp_freq[8][2] = {
 };
 
 /* Datasheet table: step time "Relationship with the ODR" (sample frequency) */
-static const unsigned int mma8452_transient_time_step_us[4][8] = {
+static const unsigned int mma8452_time_step_us[4][8] = {
 	{ 1250, 2500, 5000, 10000, 20000, 20000, 20000, 20000 },  /* normal */
 	{ 1250, 2500, 5000, 10000, 20000, 80000, 80000, 80000 },  /* l p l n */
 	{ 1250, 2500, 2500, 2500, 2500, 2500, 2500, 2500 },	  /* high res*/
@@ -826,7 +826,7 @@ static int mma8452_read_thresh(struct iio_dev *indio_dev,
 		if (power_mode < 0)
 			return power_mode;
 
-		us = ret * mma8452_transient_time_step_us[power_mode][
+		us = ret * mma8452_time_step_us[power_mode][
 				mma8452_get_odr_index(data)];
 		*val = us / USEC_PER_SEC;
 		*val2 = us % USEC_PER_SEC;
@@ -883,7 +883,7 @@ static int mma8452_write_thresh(struct iio_dev *indio_dev,
 			return ret;
 
 		steps = (val * USEC_PER_SEC + val2) /
-				mma8452_transient_time_step_us[ret][
+				mma8452_time_step_us[ret][
 					mma8452_get_odr_index(data)];
 
 		if (steps < 0 || steps > 0xff)
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] This patchset refactors event related functions  Harinath Nampally <harinath922@gmail.com> - 2017-09-25 05:20 +0200
  [PATCH 2/3] iio: accel: mma8452: Rename read/write event value callbacks to generic function name. Harinath Nampally <harinath922@gmail.com> - 2017-09-25 05:20 +0200
  [PATCH 1/3] iio: accel: mma8452: Rename time step look up struct to generic name as the values are same for all the events. Harinath Nampally <harinath922@gmail.com> - 2017-09-25 05:20 +0200
  [PATCH 3/3] iio: accel: mma8452: Add single pulse/tap event detection feature for fxls8471. Harinath Nampally <harinath922@gmail.com> - 2017-09-25 05:20 +0200
    Re: [PATCH 3/3] iio: accel: mma8452: Add single pulse/tap event  detection feature for fxls8471. Martin Kepplinger <martink@posteo.de> - 2017-09-25 08:40 +0200
  Re: [PATCH 0/3] This patchset refactors event related functions Martin Kepplinger <martink@posteo.de> - 2017-09-25 08:30 +0200

csiph-web