Make the LIST_FOREACH_SAFE publicly visible.
We will want to use this macro in more than one source file. This patch moves the macro into the common header for possibly undefined code. Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
d465406106
commit
992e292055
7
clock.c
7
clock.c
|
@ -134,13 +134,6 @@ static int cid_eq(struct ClockIdentity *a, struct ClockIdentity *b)
|
|||
return 0 == memcmp(a, b, sizeof(*a));
|
||||
}
|
||||
|
||||
#ifndef LIST_FOREACH_SAFE
|
||||
#define LIST_FOREACH_SAFE(var, head, field, tvar) \
|
||||
for ((var) = LIST_FIRST((head)); \
|
||||
(var) && ((tvar) = LIST_NEXT((var), field), 1); \
|
||||
(var) = (tvar))
|
||||
#endif
|
||||
|
||||
static void remove_subscriber(struct clock_subscriber *s)
|
||||
{
|
||||
LIST_REMOVE(s, list);
|
||||
|
|
|
@ -60,6 +60,13 @@ enum {
|
|||
};
|
||||
#endif
|
||||
|
||||
#ifndef LIST_FOREACH_SAFE
|
||||
#define LIST_FOREACH_SAFE(var, head, field, tvar) \
|
||||
for ((var) = LIST_FIRST((head)); \
|
||||
(var) && ((tvar) = LIST_NEXT((var), field), 1); \
|
||||
(var) = (tvar))
|
||||
#endif
|
||||
|
||||
#ifndef SIOCGHWTSTAMP
|
||||
#define SIOCGHWTSTAMP 0x89b1
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue