Skip to content

Commit ccf5455

Browse files
Cristina Ciocanjic23
Cristina Ciocan
authored andcommitted
iio: Fix IIO_EVENT_CODE_EXTRACT_DIR bit mask
The direction field is set on 7 bits, thus we need to AND it with 0111 111 mask in order to retrieve it, that is 0x7F, not 0xCF as it is now. Fixes: ade7ef7 (staging:iio: Differential channel handling) Signed-off-by: Cristina Ciocan <[email protected]> Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent b598aac commit ccf5455

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/iio/events.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct iio_event_data {
7272

7373
#define IIO_EVENT_CODE_EXTRACT_TYPE(mask) ((mask >> 56) & 0xFF)
7474

75-
#define IIO_EVENT_CODE_EXTRACT_DIR(mask) ((mask >> 48) & 0xCF)
75+
#define IIO_EVENT_CODE_EXTRACT_DIR(mask) ((mask >> 48) & 0x7F)
7676

7777
#define IIO_EVENT_CODE_EXTRACT_CHAN_TYPE(mask) ((mask >> 32) & 0xFF)
7878

0 commit comments

Comments
 (0)