summaryrefslogtreecommitdiff
path: root/drivers/dahdi/dahdi-base.c
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2009-07-23 22:26:25 +0000
committerShaun Ruffell <sruffell@digium.com>2009-07-23 22:26:25 +0000
commit5b501aaa331dd9133b15498270e1fe1173b3d13c (patch)
treed1094613fb713c783d5e6ab4160c0b17cce1bb8b /drivers/dahdi/dahdi-base.c
parent85f5aac4bea8ed5beee84d93146d4d19801da96d (diff)
dahdi-base: Update formatting in ioctl_load_zone.
Fixes checkpatch.pl formatting errors from the previous commit. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6891 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/dahdi-base.c')
-rw-r--r--drivers/dahdi/dahdi-base.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index 6d57188..ec84116 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -2948,7 +2948,8 @@ static int ioctl_load_zone(unsigned long data)
if (!work)
return -ENOMEM;
- if (copy_from_user(&work->th, (struct dahdi_tone_def_header *) data, sizeof(work->th))) {
+ if (copy_from_user(&work->th, (struct dahdi_tone_def_header *)data,
+ sizeof(work->th))) {
kfree(work);
return -EFAULT;
}
@@ -2968,7 +2969,8 @@ static int ioctl_load_zone(unsigned long data)
return -E2BIG;
}
- if (!(z = ptr = slab = kzalloc(size, GFP_KERNEL))) {
+ z = ptr = slab = kzalloc(size, GFP_KERNEL);
+ if (!z) {
kfree(work);
return -ENOMEM;
}
@@ -2999,7 +3001,9 @@ static int ioctl_load_zone(unsigned long data)
return -EINVAL;
}
- if (copy_from_user(&work->td, (struct dahdi_tone_def *) data, sizeof(work->td))) {
+ res = copy_from_user(&work->td, (struct dahdi_tone_def *)data,
+ sizeof(work->td));
+ if (res) {
kfree(slab);
kfree(work);
return -EFAULT;
@@ -3019,8 +3023,11 @@ static int ioctl_load_zone(unsigned long data)
work->next[x] = work->td.next;
/* Make sure the "next" one is sane */
- if ((work->next[x] >= work->th.count) || (work->next[x] < 0)) {
- module_printk(KERN_NOTICE, "Invalid 'next' pointer: %d\n", work->next[x]);
+ if ((work->next[x] >= work->th.count) ||
+ (work->next[x] < 0)) {
+ module_printk(KERN_NOTICE,
+ "Invalid 'next' pointer: %d\n",
+ work->next[x]);
kfree(slab);
kfree(work);
return -EINVAL;
@@ -3046,7 +3053,9 @@ static int ioctl_load_zone(unsigned long data)
work->td.tone -= DAHDI_TONE_MFR2_REV_BASE;
t = &z->mfr2_rev[work->td.tone];
} else {
- module_printk(KERN_NOTICE, "Invalid tone (%d) defined\n", work->td.tone);
+ module_printk(KERN_NOTICE,
+ "Invalid tone (%d) defined\n",
+ work->td.tone);
kfree(slab);
kfree(work);
return -EINVAL;
@@ -3070,7 +3079,8 @@ static int ioctl_load_zone(unsigned long data)
t->tonesamples = global_dialparams.dtmf_tonelen;
t->next = &dtmf_silence;
z->dtmf_continuous[work->td.tone] = *t;
- z->dtmf_continuous[work->td.tone].next = &z->dtmf_continuous[work->td.tone];
+ z->dtmf_continuous[work->td.tone].next =
+ &z->dtmf_continuous[work->td.tone];
break;
case MFR1_TONE:
switch (work->td.tone + DAHDI_TONE_MFR1_BASE) {
@@ -3092,13 +3102,15 @@ static int ioctl_load_zone(unsigned long data)
t->tonesamples = global_dialparams.mfr2_tonelen;
t->next = &dtmf_silence;
z->mfr2_fwd_continuous[work->td.tone] = *t;
- z->mfr2_fwd_continuous[work->td.tone].next = &z->mfr2_fwd_continuous[work->td.tone];
+ z->mfr2_fwd_continuous[work->td.tone].next =
+ &z->mfr2_fwd_continuous[work->td.tone];
break;
case MFR2_REV_TONE:
t->tonesamples = global_dialparams.mfr2_tonelen;
t->next = &dtmf_silence;
z->mfr2_rev_continuous[work->td.tone] = *t;
- z->mfr2_rev_continuous[work->td.tone].next = &z->mfr2_rev_continuous[work->td.tone];
+ z->mfr2_rev_continuous[work->td.tone].next =
+ &z->mfr2_rev_continuous[work->td.tone];
break;
}
}
@@ -3108,7 +3120,8 @@ static int ioctl_load_zone(unsigned long data)
work->samples[x]->next = work->samples[work->next[x]];
}
- if ((res = dahdi_register_tone_zone(work->th.zone, z))) {
+ res = dahdi_register_tone_zone(work->th.zone, z);
+ if (res) {
kfree(slab);
} else {
if ( -1 == default_zone ) {