Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: events: make IIO_EVENT_CODE macro private

Make IIO_EVENT_CODE "private" by adding a leading underscore.

There are no more users of this macro in the kernel so we can make it
"private" and encourage developers to use the specialized versions of
the macro instead.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20241101-iio-fix-event-macro-use-v1-3-0000c5d09f6d@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

David Lechner and committed by
Jonathan Cameron
01f567d2 dff100b0

+9 -6
+9 -6
include/linux/iio/events.h
··· 10 10 #include <uapi/linux/iio/events.h> 11 11 12 12 /** 13 - * IIO_EVENT_CODE() - create event identifier 13 + * _IIO_EVENT_CODE() - create event identifier 14 14 * @chan_type: Type of the channel. Should be one of enum iio_chan_type. 15 15 * @diff: Whether the event is for an differential channel or not. 16 16 * @modifier: Modifier for the channel. Should be one of enum iio_modifier. ··· 19 19 * @chan: Channel number for non-differential channels. 20 20 * @chan1: First channel number for differential channels. 21 21 * @chan2: Second channel number for differential channels. 22 + * 23 + * Drivers should use the specialized macros below instead of using this one 24 + * directly. 22 25 */ 23 26 24 - #define IIO_EVENT_CODE(chan_type, diff, modifier, direction, \ 25 - type, chan, chan1, chan2) \ 27 + #define _IIO_EVENT_CODE(chan_type, diff, modifier, direction, \ 28 + type, chan, chan1, chan2) \ 26 29 (((u64)type << 56) | ((u64)diff << 55) | \ 27 30 ((u64)direction << 48) | ((u64)modifier << 40) | \ 28 31 ((u64)chan_type << 32) | (((u16)chan2) << 16) | ((u16)chan1) | \ ··· 44 41 45 42 #define IIO_MOD_EVENT_CODE(chan_type, number, modifier, \ 46 43 type, direction) \ 47 - IIO_EVENT_CODE(chan_type, 0, modifier, direction, type, number, 0, 0) 44 + _IIO_EVENT_CODE(chan_type, 0, modifier, direction, type, number, 0, 0) 48 45 49 46 /** 50 47 * IIO_UNMOD_EVENT_CODE() - create event identifier for unmodified (non ··· 56 53 */ 57 54 58 55 #define IIO_UNMOD_EVENT_CODE(chan_type, number, type, direction) \ 59 - IIO_EVENT_CODE(chan_type, 0, 0, direction, type, number, 0, 0) 56 + _IIO_EVENT_CODE(chan_type, 0, 0, direction, type, number, 0, 0) 60 57 61 58 /** 62 59 * IIO_DIFF_EVENT_CODE() - create event identifier for differential channels ··· 68 65 */ 69 66 70 67 #define IIO_DIFF_EVENT_CODE(chan_type, chan1, chan2, type, direction) \ 71 - IIO_EVENT_CODE(chan_type, 1, 0, direction, type, 0, chan1, chan2) 68 + _IIO_EVENT_CODE(chan_type, 1, 0, direction, type, 0, chan1, chan2) 72 69 73 70 #endif