staging:iio: IIO_EVENT_CODE: Clamp channel numbers
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 2 Nov 2011 08:40:01 +0000 (09:40 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 27 Nov 2011 00:39:58 +0000 (16:39 -0800)
commit19c2aedc54b927ab10d3723038182eedf90438a4
treec097eb93b9f92c37c4c0e8fd0c69cc4435acff8c
parent43c0364551d3ca0042f6f6a3da701edf1143d62f
staging:iio: IIO_EVENT_CODE: Clamp channel numbers

Make sure we only use the allotted space for channel numbers in the event mask
and do not let them override other fields.

Since negative values are valid channel number, cast the channel number to
signed when extracting it from an event mask.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/events.h