All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Harinath Nampally <harinath922@gmail.com>
Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
	gregkh@linuxfoundation.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org, amsfield22@gmail.com,
	martink@posteo.de
Subject: Re: [PATCH] iio: accel: mma8452: Rename structs holding event configuration registers to more appropriate names.
Date: Sat, 30 Sep 2017 18:56:38 +0100	[thread overview]
Message-ID: <20170930185638.289ff0bf@archlinux> (raw)
In-Reply-To: <1506275376-5037-1-git-send-email-harinath922@gmail.com>

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;


      reply	other threads:[~2017-09-30 17:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 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=20170930185638.289ff0bf@archlinux \
    --to=jic23@kernel.org \
    --cc=amsfield22@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=harinath922@gmail.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martink@posteo.de \
    --cc=pmeerw@pmeerw.net \
    /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 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.