dahdi_dynamic_loc: Reduce indentation level in 'dahdi_dynamic_local_create()'
This is a trivial formatting change in order to not introduce any warnings. 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@9565 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This commit is contained in:
parent
42b9a95b34
commit
08eb1a560d
@ -166,49 +166,55 @@ static void *dahdi_dynamic_local_create(struct dahdi_span *span, char *address)
|
|||||||
goto INVALID_ADDRESS;
|
goto INVALID_ADDRESS;
|
||||||
|
|
||||||
d = kzalloc(sizeof(*d), GFP_KERNEL);
|
d = kzalloc(sizeof(*d), GFP_KERNEL);
|
||||||
if (d) {
|
if (!d)
|
||||||
d->key = key;
|
return NULL;
|
||||||
d->id = id;
|
|
||||||
d->span = span;
|
|
||||||
|
|
||||||
spin_lock_irqsave(&local_lock, flags);
|
|
||||||
/* Add this peer to any existing spans with same key
|
|
||||||
And add them as peers to this one */
|
|
||||||
list_for_each_entry(l, &dynamic_local_list, node) {
|
|
||||||
if (l->key != d->key)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (l->id == d->id) {
|
d->key = key;
|
||||||
printk(KERN_DEBUG "TDMoL: Duplicate id (%d) for key %d\n", d->id, d->key);
|
d->id = id;
|
||||||
|
d->span = span;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&local_lock, flags);
|
||||||
|
/* Add this peer to any existing spans with same key
|
||||||
|
And add them as peers to this one */
|
||||||
|
list_for_each_entry(l, &dynamic_local_list, node) {
|
||||||
|
if (l->key != d->key)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (l->id == d->id) {
|
||||||
|
printk(KERN_DEBUG "TDMoL: Duplicate id (%d) for key "
|
||||||
|
"%d\n", d->id, d->key);
|
||||||
|
goto CLEAR_AND_DEL_FROM_PEERS;
|
||||||
|
}
|
||||||
|
if (monitor == -1) {
|
||||||
|
if (l->peer) {
|
||||||
|
printk(KERN_DEBUG "TDMoL: Span with key %d and "
|
||||||
|
"id %d already has a R/W peer\n",
|
||||||
|
d->key, d->id);
|
||||||
goto CLEAR_AND_DEL_FROM_PEERS;
|
goto CLEAR_AND_DEL_FROM_PEERS;
|
||||||
}
|
} else {
|
||||||
if (monitor == -1) {
|
l->peer = d;
|
||||||
if (l->peer) {
|
d->peer = l;
|
||||||
printk(KERN_DEBUG "TDMoL: Span with key %d and id %d already has a R/W peer\n", d->key, d->id);
|
}
|
||||||
goto CLEAR_AND_DEL_FROM_PEERS;
|
}
|
||||||
} else {
|
if (monitor == l->id) {
|
||||||
l->peer = d;
|
if (l->monitor_rx_peer) {
|
||||||
d->peer = l;
|
printk(KERN_DEBUG "TDMoL: Span with key %d and "
|
||||||
}
|
"id %d already has a monitoring peer\n",
|
||||||
}
|
d->key, d->id);
|
||||||
if (monitor == l->id) {
|
goto CLEAR_AND_DEL_FROM_PEERS;
|
||||||
if (l->monitor_rx_peer) {
|
} else {
|
||||||
printk(KERN_DEBUG "TDMoL: Span with key %d and id %d already has a monitoring peer\n", d->key, d->id);
|
l->monitor_rx_peer = d;
|
||||||
goto CLEAR_AND_DEL_FROM_PEERS;
|
|
||||||
} else {
|
|
||||||
l->monitor_rx_peer = d;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
list_add(&d->node, &dynamic_local_list);
|
|
||||||
spin_unlock_irqrestore(&local_lock, flags);
|
|
||||||
|
|
||||||
if(!try_module_get(THIS_MODULE))
|
|
||||||
printk(KERN_DEBUG "TDMoL: Unable to increment module use count\n");
|
|
||||||
|
|
||||||
printk(KERN_INFO "TDMoL: Added new interface for %s, "
|
|
||||||
"key %d id %d\n", span->name, d->key, d->id);
|
|
||||||
}
|
}
|
||||||
|
list_add(&d->node, &dynamic_local_list);
|
||||||
|
spin_unlock_irqrestore(&local_lock, flags);
|
||||||
|
|
||||||
|
if (!try_module_get(THIS_MODULE))
|
||||||
|
printk(KERN_DEBUG "TDMoL: Unable to increment module use count\n");
|
||||||
|
|
||||||
|
printk(KERN_INFO "TDMoL: Added new interface for %s, "
|
||||||
|
"key %d id %d\n", span->name, d->key, d->id);
|
||||||
return d;
|
return d;
|
||||||
|
|
||||||
CLEAR_AND_DEL_FROM_PEERS:
|
CLEAR_AND_DEL_FROM_PEERS:
|
||||||
|
Loading…
Reference in New Issue
Block a user