linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Hartmut Knaack <knaack.h@gmx.de>, linux-iio@vger.kernel.org
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	Tiberiu Breana <tiberiu.a.breana@intel.com>
Subject: Re: [PATCH v2 4/5] iio:light:stk3310: use correct names and type for state
Date: Sun, 19 Jul 2015 14:58:18 +0100	[thread overview]
Message-ID: <55ABACFA.9020504@kernel.org> (raw)
In-Reply-To: <692d0850562d1381c92759fb8e91652be40772ab.1436398691.git.knaack.h@gmx.de>

On 09/07/15 22:51, Hartmut Knaack wrote:
> Indicate the bit number of predefined states, make use of these names and
> change the state type in _resume to u8 to avoid type casting.
> 
> Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
> Reviewed-by: Tiberiu Breana <tiberiu.a.breana@intel.com>
Again, needs to wait for the fixes to make their way through the trees.
> ---
>  drivers/iio/light/stk3310.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c
> index d6df40220007..0056f4870357 100644
> --- a/drivers/iio/light/stk3310.c
> +++ b/drivers/iio/light/stk3310.c
> @@ -35,8 +35,8 @@
>  #define STK3310_REG_ID				0x3E
>  #define STK3310_MAX_REG				0x80
>  
> -#define STK3310_STATE_EN_PS			0x01
> -#define STK3310_STATE_EN_ALS			0x02
> +#define STK3310_STATE_EN_PS			BIT(0)
> +#define STK3310_STATE_EN_ALS			BIT(1)
>  #define STK3310_STATE_STANDBY			0x00
>  
>  #define STK3310_CHIP_ID_VAL			0x13
> @@ -436,8 +436,8 @@ static int stk3310_set_state(struct stk3310_data *data, u8 state)
>  		dev_err(&client->dev, "failed to change sensor state\n");
>  	} else if (state != STK3310_STATE_STANDBY) {
>  		/* Don't reset the 'enabled' flags if we're going in standby */
> -		data->ps_enabled  = !!(state & 0x01);
> -		data->als_enabled = !!(state & 0x02);
> +		data->ps_enabled  = !!(state & STK3310_STATE_EN_PS);
> +		data->als_enabled = !!(state & STK3310_STATE_EN_ALS);
>  	}
>  	mutex_unlock(&data->lock);
>  
> @@ -683,7 +683,7 @@ static int stk3310_suspend(struct device *dev)
>  
>  static int stk3310_resume(struct device *dev)
>  {
> -	int state = 0;
> +	u8 state = 0;
>  	struct stk3310_data *data;
>  
>  	data = iio_priv(i2c_get_clientdata(to_i2c_client(dev)));
> 


  reply	other threads:[~2015-07-19 13:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-09 21:51 [PATCH v2 0/5] stk3310 fixes and cleanup Hartmut Knaack
2015-07-09 21:51 ` [PATCH v2 1/5] iio:light:stk3310: move device register to end of probe Hartmut Knaack
2015-07-19 13:53   ` Jonathan Cameron
2015-07-09 21:51 ` [PATCH v2 2/5] iio:light:stk3310: make endianness independent of host Hartmut Knaack
2015-07-19 13:55   ` Jonathan Cameron
2015-07-09 21:51 ` [PATCH v2 3/5] iio:light:stk3310: add more error handling Hartmut Knaack
2015-07-19 13:57   ` Jonathan Cameron
2015-08-12 21:16     ` Jonathan Cameron
2015-07-09 21:51 ` [PATCH v2 4/5] iio:light:stk3310: use correct names and type for state Hartmut Knaack
2015-07-19 13:58   ` Jonathan Cameron [this message]
2015-08-12 21:16     ` Jonathan Cameron
2015-07-09 21:51 ` [PATCH v2 5/5] iio:light:stk3310: adjust indentation Hartmut Knaack
2015-08-12 21:17   ` Jonathan Cameron
2015-07-10  8:02 ` [PATCH v2 0/5] stk3310 fixes and cleanup Breana, Tiberiu A

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=55ABACFA.9020504@kernel.org \
    --to=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=tiberiu.a.breana@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).