Re: [PATCH 2/3] iio:accel:bmc150-accel: make use of mask definition

Octavian Purdila
2015-06-16T10:34:44Z

On Tue, Jun 16, 2015 at 12:48 AM, Hartmut Knaack <knaack.h@gmx.de> wrote:
> BMC150_ACCEL_SLOPE_THRES_MASK was defined some time ago, but its 'magic'
> value got used instead in bmc150_accel_write_event(). Make use of it for
> improved readability.
>
> Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>

Reviewed-by: Octavian Purdila <octavian.purdila@intel.com>

> ---
> drivers/iio/accel/bmc150-accel.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/accel/bmc150-accel.c b/drivers/iio/accel/bmc150-accel.c
> index cc5a357..36a9cd5 100644
> --- a/drivers/iio/accel/bmc150-accel.c
> +++ b/drivers/iio/accel/bmc150-accel.c
> @@ -776,7 +776,7 @@ static int bmc150_accel_write_event(struct iio_dev *indio_dev,
>
> switch (info) {
> case IIO_EV_INFO_VALUE:
> - data->slope_thres = val & 0xFF;
> + data->slope_thres = val & BMC150_ACCEL_SLOPE_THRES_MASK;
> break;
> case IIO_EV_INFO_PERIOD:
> data->slope_dur = val & BMC150_ACCEL_SLOPE_DUR_MASK;
> --
> 2.3.6
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html