* [PATCH] iio: accel: mma8452: Rename structs holding event configuration registers to more appropriate names.
@ 2017-09-24 17:49 Harinath Nampally
2017-09-30 17:56 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Harinath Nampally @ 2017-09-24 17:49 UTC (permalink / raw)
To: jic23
Cc: knaack.h, lars, pmeerw, gregkh, linux-iio, linux-kernel,
amsfield22, martink
Improves code readability, no impact on functionality.
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
---
drivers/iio/accel/mma8452.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
index 6194169..3472e7e 100644
--- a/drivers/iio/accel/mma8452.c
+++ b/drivers/iio/accel/mma8452.c
@@ -135,7 +135,7 @@ struct mma8452_event_regs {
u8 ev_count;
};
-static const struct mma8452_event_regs ev_regs_accel_falling = {
+static const struct mma8452_event_regs ff_mt_ev_regs = {
.ev_cfg = MMA8452_FF_MT_CFG,
.ev_cfg_ele = MMA8452_FF_MT_CFG_ELE,
.ev_cfg_chan_shift = MMA8452_FF_MT_CHAN_SHIFT,
@@ -145,7 +145,7 @@ static const struct mma8452_event_regs ev_regs_accel_falling = {
.ev_count = MMA8452_FF_MT_COUNT
};
-static const struct mma8452_event_regs ev_regs_accel_rising = {
+static const struct mma8452_event_regs trans_ev_regs = {
.ev_cfg = MMA8452_TRANSIENT_CFG,
.ev_cfg_ele = MMA8452_TRANSIENT_CFG_ELE,
.ev_cfg_chan_shift = MMA8452_TRANSIENT_CHAN_SHIFT,
@@ -777,12 +777,12 @@ static int mma8452_get_event_regs(struct mma8452_data *data,
& MMA8452_INT_TRANS) &&
(data->chip_info->enabled_events
& MMA8452_INT_TRANS))
- *ev_reg = &ev_regs_accel_rising;
+ *ev_reg = &trans_ev_regs;
else
- *ev_reg = &ev_regs_accel_falling;
+ *ev_reg = &ff_mt_ev_regs;
return 0;
case IIO_EV_DIR_FALLING:
- *ev_reg = &ev_regs_accel_falling;
+ *ev_reg = &ff_mt_ev_regs;
return 0;
default:
return -EINVAL;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iio: accel: mma8452: Rename structs holding event configuration registers to more appropriate names.
2017-09-24 17:49 [PATCH] iio: accel: mma8452: Rename structs holding event configuration registers to more appropriate names Harinath Nampally
@ 2017-09-30 17:56 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2017-09-30 17:56 UTC (permalink / raw)
To: Harinath Nampally
Cc: knaack.h, lars, pmeerw, gregkh, linux-iio, linux-kernel,
amsfield22, martink
On Sun, 24 Sep 2017 13:49:36 -0400
Harinath Nampally <harinath922@gmail.com> wrote:
> Improves code readability, no impact on functionality.
>
> Signed-off-by: Harinath Nampally <harinath922@gmail.com>
I'm unconvinced by this one. At some point we have to map from the
devices own description to that of IIO. The naming currently does
this when the structures are created - all this rename does is
push this remapping of naming down into the functions.
If others thing this helps then I don't really care either way..
Jonathan
> ---
> drivers/iio/accel/mma8452.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
> index 6194169..3472e7e 100644
> --- a/drivers/iio/accel/mma8452.c
> +++ b/drivers/iio/accel/mma8452.c
> @@ -135,7 +135,7 @@ struct mma8452_event_regs {
> u8 ev_count;
> };
>
> -static const struct mma8452_event_regs ev_regs_accel_falling = {
> +static const struct mma8452_event_regs ff_mt_ev_regs = {
> .ev_cfg = MMA8452_FF_MT_CFG,
> .ev_cfg_ele = MMA8452_FF_MT_CFG_ELE,
> .ev_cfg_chan_shift = MMA8452_FF_MT_CHAN_SHIFT,
> @@ -145,7 +145,7 @@ static const struct mma8452_event_regs ev_regs_accel_falling = {
> .ev_count = MMA8452_FF_MT_COUNT
> };
>
> -static const struct mma8452_event_regs ev_regs_accel_rising = {
> +static const struct mma8452_event_regs trans_ev_regs = {
> .ev_cfg = MMA8452_TRANSIENT_CFG,
> .ev_cfg_ele = MMA8452_TRANSIENT_CFG_ELE,
> .ev_cfg_chan_shift = MMA8452_TRANSIENT_CHAN_SHIFT,
> @@ -777,12 +777,12 @@ static int mma8452_get_event_regs(struct mma8452_data *data,
> & MMA8452_INT_TRANS) &&
> (data->chip_info->enabled_events
> & MMA8452_INT_TRANS))
> - *ev_reg = &ev_regs_accel_rising;
> + *ev_reg = &trans_ev_regs;
> else
> - *ev_reg = &ev_regs_accel_falling;
> + *ev_reg = &ff_mt_ev_regs;
> return 0;
> case IIO_EV_DIR_FALLING:
> - *ev_reg = &ev_regs_accel_falling;
> + *ev_reg = &ff_mt_ev_regs;
> return 0;
> default:
> return -EINVAL;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-09-30 17:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-24 17:49 [PATCH] iio: accel: mma8452: Rename structs holding event configuration registers to more appropriate names Harinath Nampally
2017-09-30 17:56 ` Jonathan Cameron
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.