dahdi: Trivial move of sync_tick callback to inline function.

This is a trivial cleanup to primarily to remove the #ifdef test out of
process_masterspan.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>

git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9586 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
Shaun Ruffell 2011-01-03 18:26:34 +00:00
parent 2f3b2a4f62
commit c6ae6d6cec
2 changed files with 14 additions and 5 deletions

View File

@ -8526,6 +8526,16 @@ static inline void pseudo_rx_audio(struct dahdi_chan *chan)
} }
#endif /* CONFIG_DAHDI_MIRROR */ #endif /* CONFIG_DAHDI_MIRROR */
#ifdef DAHDI_SYNC_TICK
static inline void dahdi_sync_tick(struct dahdi_span *const s)
{
if (s->ops->sync_tick)
s->ops->sync_tick(s, s == master);
}
#else
#define dahdi_sync_tick(x) do { ; } while (0)
#endif
static void process_masterspan(void) static void process_masterspan(void)
{ {
unsigned long flags; unsigned long flags;
@ -8597,10 +8607,8 @@ static void process_masterspan(void)
__buf_push(&chan->confout, NULL); __buf_push(&chan->confout, NULL);
spin_unlock(&chan->lock); spin_unlock(&chan->lock);
} }
#ifdef DAHDI_SYNC_TICK
if (s->ops->sync_tick) dahdi_sync_tick(s);
s->ops->sync_tick(s, s == master);
#endif
} }
spin_unlock_irqrestore(&chan_lock, flags); spin_unlock_irqrestore(&chan_lock, flags);
} }

View File

@ -791,7 +791,8 @@ struct dahdi_span_ops {
int (*maint)(struct dahdi_span *span, int mode); int (*maint)(struct dahdi_span *span, int mode);
#ifdef DAHDI_SYNC_TICK #ifdef DAHDI_SYNC_TICK
/*! Opt: send sync to spans */ /*! Opt: send sync to spans. Called in hard_irq context with chan_lock
* held.*/
int (*sync_tick)(struct dahdi_span *span, int is_master); int (*sync_tick)(struct dahdi_span *span, int is_master);
#endif #endif
/* ==== Channel Callback Operations ==== */ /* ==== Channel Callback Operations ==== */