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:
Shaun Ruffell 2011-01-03 18:24:56 +00:00
parent 42b9a95b34
commit 08eb1a560d

View File

@ -166,49 +166,55 @@ static void *dahdi_dynamic_local_create(struct dahdi_span *span, char *address)
goto INVALID_ADDRESS;
d = kzalloc(sizeof(*d), GFP_KERNEL);
if (d) {
d->key = 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 (!d)
return NULL;
if (l->id == d->id) {
printk(KERN_DEBUG "TDMoL: Duplicate id (%d) for key %d\n", d->id, d->key);
d->key = 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;
}
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;
} else {
l->peer = d;
d->peer = l;
}
}
if (monitor == l->id) {
if (l->monitor_rx_peer) {
printk(KERN_DEBUG "TDMoL: Span with key %d and id %d already has a monitoring peer\n", d->key, d->id);
goto CLEAR_AND_DEL_FROM_PEERS;
} else {
l->monitor_rx_peer = d;
}
} else {
l->peer = d;
d->peer = l;
}
}
if (monitor == l->id) {
if (l->monitor_rx_peer) {
printk(KERN_DEBUG "TDMoL: Span with key %d and "
"id %d already has a monitoring peer\n",
d->key, d->id);
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;
CLEAR_AND_DEL_FROM_PEERS: