linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Irina Tirdea <irina.tirdea@intel.com>,
	linux-iio@vger.kernel.org, Hartmut Knaack <knaack.h@gmx.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/8] iio: accel: mma9553: fix gpio bitnum init value
Date: Thu, 09 Apr 2015 12:42:56 +0100	[thread overview]
Message-ID: <552665C0.2000005@kernel.org> (raw)
In-Reply-To: <1428503857-9081-4-git-send-email-irina.tirdea@intel.com>

On 08/04/15 15:37, Irina Tirdea wrote:
> Initial value of gpio bitnum is set to -1, but
> the variable is declared as unsigned.
> 
> Use a positive invalid value for initial gpio
> bitnum.
> 
> Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
> Suggested-by: Hartmut Knaack <knaack.h@gmx.de>
This is fine, but I'm feeling lazy as this isn't going
anywhere until after the merge window now. Will pick it
up once you've done the reordering to pull the fixes to the
top of the series.

J
> ---
>  drivers/iio/accel/mma9553.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/accel/mma9553.c b/drivers/iio/accel/mma9553.c
> index 9cfedb5..d781999 100644
> --- a/drivers/iio/accel/mma9553.c
> +++ b/drivers/iio/accel/mma9553.c
> @@ -78,6 +78,7 @@
>  
>  /* Bitnum used for GPIO configuration = bit number in high status byte */
>  #define MMA9553_STATUS_TO_BITNUM(bit)	(ffs(bit) - 9)
> +#define MMA9553_MAX_BITNUM		MMA9553_STATUS_TO_BITNUM(BIT(16))
>  
>  #define MMA9553_DEFAULT_SAMPLE_RATE	30	/* Hz */
>  
> @@ -406,8 +407,8 @@ static int mma9553_init(struct mma9553_data *data)
>  	}
>  
>  
> -	data->gpio_bitnum = -1;
>  	/* Reset GPIO */
> +	data->gpio_bitnum = MMA9553_MAX_BITNUM;
>  	ret = mma9553_conf_gpio(data);
>  	if (ret < 0)
>  		return ret;
> 


  reply	other threads:[~2015-04-09 11:42 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-08 14:37 [PATCH 0/8] Fixes for the mma9553 driver Irina Tirdea
2015-04-08 14:37 ` [PATCH 1/8] iio: accel: mma9553: coding style fixes Irina Tirdea
2015-04-09 11:31   ` Jonathan Cameron
2015-04-13 13:43     ` Tirdea, Irina
2015-04-08 14:37 ` [PATCH 2/8] iio: accel: mma9553: use unsigned counters Irina Tirdea
2015-04-09 11:36   ` Jonathan Cameron
2015-04-13 13:54     ` Tirdea, Irina
2015-04-08 14:37 ` [PATCH 3/8] iio: accel: mma9553: fix gpio bitnum init value Irina Tirdea
2015-04-09 11:42   ` Jonathan Cameron [this message]
2015-04-08 14:37 ` [PATCH 4/8] iio: accel: mma9553: refactor mma9553_read_activity_stepcnt Irina Tirdea
2015-04-09 11:44   ` Jonathan Cameron
2015-04-08 14:37 ` [PATCH 5/8] iio: accel: mma9553: refactor mma9553_read_raw Irina Tirdea
2015-04-09 11:45   ` Jonathan Cameron
2015-04-08 14:37 ` [PATCH 6/8] iio: accel: mma9553: check input value for activity period Irina Tirdea
2015-04-09 11:46   ` Jonathan Cameron
2015-04-08 14:37 ` [PATCH 7/8] iio: accel: mma9551_core: prevent buffer overrun Irina Tirdea
2015-04-09 11:51   ` Jonathan Cameron
2015-04-13 13:48     ` Tirdea, Irina
2015-04-08 14:37 ` [PATCH 8/8] iio: accel: mma9553: add enable channel for activity Irina Tirdea
2015-04-09 11:52   ` Jonathan Cameron
2015-04-09 11:13 ` [PATCH 0/8] Fixes for the mma9553 driver Jonathan Cameron
2015-04-13 13:42   ` Tirdea, Irina

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=552665C0.2000005@kernel.org \
    --to=jic23@kernel.org \
    --cc=irina.tirdea@intel.com \
    --cc=knaack.h@gmx.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).