Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07367adb authored by Joe Perches's avatar Joe Perches Committed by David S. Miller
Browse files

net/atm/proc.c: checkpatch cleanups



Convert #include <asm... to #include <linux...
Mostly 80 column wrapped.
Spacing cleanups
Move trailing statements to new lines
switch/case cleanups

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d81219db
Loading
Loading
Loading
Loading
+44 −37
Original line number Diff line number Diff line
@@ -24,15 +24,15 @@
#include <linux/init.h> /* for __init */
#include <net/net_namespace.h>
#include <net/atmclip.h>
#include <asm/uaccess.h>
#include <linux/uaccess.h>
#include <linux/param.h> /* for HZ */
#include <asm/atomic.h>
#include <asm/param.h> /* for HZ */
#include "resources.h"
#include "common.h" /* atm_proc_init prototype */
#include "signaling.h" /* to get sigd - ugly too */

static ssize_t proc_dev_atm_read(struct file *file,char __user *buf,size_t count,
    loff_t *pos);
static ssize_t proc_dev_atm_read(struct file *file, char __user *buf,
				 size_t count, loff_t *pos);

static const struct file_operations proc_atm_dev_ops = {
	.owner =	THIS_MODULE,
@@ -151,8 +151,8 @@ static void *vcc_seq_next(struct seq_file *seq, void *v, loff_t *pos)

static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc)
{
	static const char *const class_name[] =
		{"off","UBR","CBR","VBR","ABR"};
	static const char *const class_name[] = {
		"off", "UBR", "CBR", "VBR", "ABR"};
	static const char *const aal_name[] = {
		"---",	"1",	"2",	"3/4",	/*  0- 3 */
		"???",	"5",	"???",	"???",	/*  4- 7 */
@@ -163,7 +163,8 @@ static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc)
		   vcc->dev->number, vcc->vpi, vcc->vci,
		   vcc->qos.aal >= ARRAY_SIZE(aal_name) ? "err" :
		   aal_name[vcc->qos.aal], vcc->qos.rxtp.min_pcr,
	    class_name[vcc->qos.rxtp.traffic_class],vcc->qos.txtp.min_pcr,
		   class_name[vcc->qos.rxtp.traffic_class],
		   vcc->qos.txtp.min_pcr,
		   class_name[vcc->qos.txtp.traffic_class]);
	if (test_bit(ATM_VF_IS_CLIP, &vcc->flags)) {
		struct clip_vcc *clip_vcc = CLIP_VCC(vcc);
@@ -204,7 +205,8 @@ static void vcc_info(struct seq_file *seq, struct atm_vcc *vcc)
	default:
		seq_printf(seq, "%3d", sk->sk_family);
	}
	seq_printf(seq, " %04lx  %5d %7d/%7d %7d/%7d [%d]\n", vcc->flags, sk->sk_err,
	seq_printf(seq, " %04lx  %5d %7d/%7d %7d/%7d [%d]\n",
		   vcc->flags, sk->sk_err,
		   sk_wmem_alloc_get(sk), sk->sk_sndbuf,
		   sk_rmem_alloc_get(sk), sk->sk_rcvbuf,
		   atomic_read(&sk->sk_refcnt));
@@ -376,25 +378,28 @@ static ssize_t proc_dev_atm_read(struct file *file, char __user *buf,
	unsigned long page;
	int length;

	if (count == 0) return 0;
	if (count == 0)
		return 0;
	page = get_zeroed_page(GFP_KERNEL);
	if (!page) return -ENOMEM;
	if (!page)
		return -ENOMEM;
	dev = PDE(file->f_path.dentry->d_inode)->data;
	if (!dev->ops->proc_read)
		length = -EINVAL;
	else {
		length = dev->ops->proc_read(dev, pos, (char *)page);
		if (length > count) length = -EINVAL;
		if (length > count)
			length = -EINVAL;
	}
	if (length >= 0) {
		if (copy_to_user(buf,(char *) page,length)) length = -EFAULT;
		if (copy_to_user(buf, (char *)page, length))
			length = -EFAULT;
		(*pos)++;
	}
	free_page(page);
	return length;
}


struct proc_dir_entry *atm_proc_root;
EXPORT_SYMBOL(atm_proc_root);

@@ -410,8 +415,10 @@ int atm_proc_dev_register(struct atm_dev *dev)

	error = -ENOMEM;
	digits = 0;
	for (num = dev->number; num; num /= 10) digits++;
	if (!digits) digits++;
	for (num = dev->number; num; num /= 10)
		digits++;
	if (!digits)
		digits++;

	dev->proc_name = kmalloc(strlen(dev->type) + digits + 2, GFP_KERNEL);
	if (!dev->proc_name)
@@ -423,13 +430,13 @@ int atm_proc_dev_register(struct atm_dev *dev)
	if (!dev->proc_entry)
		goto err_free_name;
	return 0;

err_free_name:
	kfree(dev->proc_name);
err_out:
	return error;
}


void atm_proc_dev_deregister(struct atm_dev *dev)
{
	if (!dev->ops->proc_read)