Skip to content

Commit

Permalink
Staging: iio/accel: Changed data type of mask in store_measurement_mo…
Browse files Browse the repository at this point in the history
…de() to u8

In sca3000_store_measurement_mode() we parse a value from a string
buffer via kstrtou8, and store the parsed value into a u8 after
and-ing it with mask.

As we are only interested in the lowest two bits here and mask is
initialized with a fixed value 0x03, mask may as well be a u8.

Signed-off-by: Andreas Ruprecht <rupran@einserver.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Andreas Ruprecht authored and Greg Kroah-Hartman committed Dec 8, 2011
1 parent 0c9d196 commit bba4277
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/iio/accel/sca3000_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ sca3000_store_measurement_mode(struct device *dev,
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct sca3000_state *st = iio_priv(indio_dev);
int ret;
int mask = 0x03;
u8 mask = 0x03;
u8 val;

mutex_lock(&st->lock);
Expand Down

0 comments on commit bba4277

Please sign in to comment.