[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5442559C.9080800@kernel.org>
Date: Sat, 18 Oct 2014 12:57:16 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Daniel Baluta <daniel.baluta@...el.com>
CC: linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
srinivas.pandruvada@...ux.intel.com
Subject: Re: [PATCH] io: accel: kxcjk-1013: Fix iio_event_spec direction
On 10/10/14 15:53, Daniel Baluta wrote:
> Because IIO_EV_DIR_* are not bitmasks but enums,
> IIO_EV_DIR_RISING | IIO_EV_DIR_FALLING is not equal
> with IIO_EV_DIR_EITHER.
>
> This could lead to potential misformatted sysfs attributes
> like:
> * in_accel_x_thresh_(null)_en
> * in_accel_x_thresh_(null)_period
> * in_accel_x_thresh_(null)_value
>
> or even memory corruption.
>
> Fixes: b4b491c083 (iio: accel: kxcjk-1013: Support threshold)
> Signed-off-by: Daniel Baluta <daniel.baluta@...el.com>
Good catch. I'll have to hold this for a little until Greg takes
my last pull request and I can bring the fixes branch up past the
merge window.
> ---
> drivers/iio/accel/kxcjk-1013.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c
> index 98909a9..a23e58c 100644
> --- a/drivers/iio/accel/kxcjk-1013.c
> +++ b/drivers/iio/accel/kxcjk-1013.c
> @@ -894,7 +894,7 @@ static const struct attribute_group kxcjk1013_attrs_group = {
>
> static const struct iio_event_spec kxcjk1013_event = {
> .type = IIO_EV_TYPE_THRESH,
> - .dir = IIO_EV_DIR_RISING | IIO_EV_DIR_FALLING,
> + .dir = IIO_EV_DIR_EITHER,
> .mask_separate = BIT(IIO_EV_INFO_VALUE) |
> BIT(IIO_EV_INFO_ENABLE) |
> BIT(IIO_EV_INFO_PERIOD)
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists