Skip to content

Commit 01f567d

Browse files
dlechjic23
authored andcommitted
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
1 parent dff100b commit 01f567d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

include/linux/iio/events.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <uapi/linux/iio/events.h>
1111

1212
/**
13-
* IIO_EVENT_CODE() - create event identifier
13+
* _IIO_EVENT_CODE() - create event identifier
1414
* @chan_type: Type of the channel. Should be one of enum iio_chan_type.
1515
* @diff: Whether the event is for an differential channel or not.
1616
* @modifier: Modifier for the channel. Should be one of enum iio_modifier.
@@ -19,10 +19,13 @@
1919
* @chan: Channel number for non-differential channels.
2020
* @chan1: First channel number for differential channels.
2121
* @chan2: Second channel number for differential channels.
22+
*
23+
* Drivers should use the specialized macros below instead of using this one
24+
* directly.
2225
*/
2326

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) \
2629
(((u64)type << 56) | ((u64)diff << 55) | \
2730
((u64)direction << 48) | ((u64)modifier << 40) | \
2831
((u64)chan_type << 32) | (((u16)chan2) << 16) | ((u16)chan1) | \
@@ -41,7 +44,7 @@
4144

4245
#define IIO_MOD_EVENT_CODE(chan_type, number, modifier, \
4346
type, direction) \
44-
IIO_EVENT_CODE(chan_type, 0, modifier, direction, type, number, 0, 0)
47+
_IIO_EVENT_CODE(chan_type, 0, modifier, direction, type, number, 0, 0)
4548

4649
/**
4750
* IIO_UNMOD_EVENT_CODE() - create event identifier for unmodified (non
@@ -53,7 +56,7 @@
5356
*/
5457

5558
#define IIO_UNMOD_EVENT_CODE(chan_type, number, type, direction) \
56-
IIO_EVENT_CODE(chan_type, 0, 0, direction, type, number, 0, 0)
59+
_IIO_EVENT_CODE(chan_type, 0, 0, direction, type, number, 0, 0)
5760

5861
/**
5962
* IIO_DIFF_EVENT_CODE() - create event identifier for differential channels
@@ -65,6 +68,6 @@
6568
*/
6669

6770
#define IIO_DIFF_EVENT_CODE(chan_type, chan1, chan2, type, direction) \
68-
IIO_EVENT_CODE(chan_type, 1, 0, direction, type, 0, chan1, chan2)
71+
_IIO_EVENT_CODE(chan_type, 1, 0, direction, type, 0, chan1, chan2)
6972

7073
#endif

0 commit comments

Comments
 (0)