diff options
Diffstat (limited to 'net/atm/proc.c')
-rw-r--r-- | net/atm/proc.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/net/atm/proc.c b/net/atm/proc.c index 7a96b2376bd7..f188a399c679 100644 --- a/net/atm/proc.c +++ b/net/atm/proc.c | |||
@@ -406,7 +406,6 @@ EXPORT_SYMBOL(atm_proc_root); | |||
406 | 406 | ||
407 | int atm_proc_dev_register(struct atm_dev *dev) | 407 | int atm_proc_dev_register(struct atm_dev *dev) |
408 | { | 408 | { |
409 | int digits, num; | ||
410 | int error; | 409 | int error; |
411 | 410 | ||
412 | /* No proc info */ | 411 | /* No proc info */ |
@@ -414,16 +413,9 @@ int atm_proc_dev_register(struct atm_dev *dev) | |||
414 | return 0; | 413 | return 0; |
415 | 414 | ||
416 | error = -ENOMEM; | 415 | error = -ENOMEM; |
417 | digits = 0; | 416 | dev->proc_name = kasprintf(GFP_KERNEL, "%s:%d", dev->type, dev->number); |
418 | for (num = dev->number; num; num /= 10) | ||
419 | digits++; | ||
420 | if (!digits) | ||
421 | digits++; | ||
422 | |||
423 | dev->proc_name = kmalloc(strlen(dev->type) + digits + 2, GFP_KERNEL); | ||
424 | if (!dev->proc_name) | 417 | if (!dev->proc_name) |
425 | goto err_out; | 418 | goto err_out; |
426 | sprintf(dev->proc_name, "%s:%d", dev->type, dev->number); | ||
427 | 419 | ||
428 | dev->proc_entry = proc_create_data(dev->proc_name, 0, atm_proc_root, | 420 | dev->proc_entry = proc_create_data(dev->proc_name, 0, atm_proc_root, |
429 | &proc_atm_dev_ops, dev); | 421 | &proc_atm_dev_ops, dev); |