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

Commit b653d081 authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Linus Torvalds
Browse files

[PATCH] proc: remove useless (and buggy) ->nlink settings



Bug: pnx8550 code creates directory but resets ->nlink to 1.

create_proc_entry() et al will correctly set ->nlink for you.

Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Corey Minyard <minyard@acm.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Greg KH <greg@kroah.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 891dcd2f
Loading
Loading
Loading
Loading
+1 −6
Original line number Original line Diff line number Diff line
@@ -79,10 +79,7 @@ static int pnx8550_proc_init( void )


	// Create /proc/pnx8550
	// Create /proc/pnx8550
        pnx8550_dir = create_proc_entry("pnx8550", S_IFDIR|S_IRUGO, NULL);
        pnx8550_dir = create_proc_entry("pnx8550", S_IFDIR|S_IRUGO, NULL);
        if (pnx8550_dir){
        if (!pnx8550_dir) {
                pnx8550_dir->nlink = 1;
        }
        else {
                printk(KERN_ERR "Can't create pnx8550 proc dir\n");
                printk(KERN_ERR "Can't create pnx8550 proc dir\n");
                return -1;
                return -1;
        }
        }
@@ -90,7 +87,6 @@ static int pnx8550_proc_init( void )
	// Create /proc/pnx8550/timers
	// Create /proc/pnx8550/timers
        pnx8550_timers = create_proc_entry("timers", S_IFREG|S_IRUGO, pnx8550_dir );
        pnx8550_timers = create_proc_entry("timers", S_IFREG|S_IRUGO, pnx8550_dir );
        if (pnx8550_timers){
        if (pnx8550_timers){
                pnx8550_timers->nlink = 1;
                pnx8550_timers->read_proc = pnx8550_timers_read;
                pnx8550_timers->read_proc = pnx8550_timers_read;
        }
        }
        else {
        else {
@@ -100,7 +96,6 @@ static int pnx8550_proc_init( void )
	// Create /proc/pnx8550/registers
	// Create /proc/pnx8550/registers
        pnx8550_registers = create_proc_entry("registers", S_IFREG|S_IRUGO, pnx8550_dir );
        pnx8550_registers = create_proc_entry("registers", S_IFREG|S_IRUGO, pnx8550_dir );
        if (pnx8550_registers){
        if (pnx8550_registers){
                pnx8550_registers->nlink = 1;
                pnx8550_registers->read_proc = pnx8550_registers_read;
                pnx8550_registers->read_proc = pnx8550_registers_read;
        }
        }
        else {
        else {
+0 −1
Original line number Original line Diff line number Diff line
@@ -71,7 +71,6 @@ static int __init proc_ppc64_init(void)
	pde = create_proc_entry("ppc64/systemcfg", S_IFREG|S_IRUGO, NULL);
	pde = create_proc_entry("ppc64/systemcfg", S_IFREG|S_IRUGO, NULL);
	if (!pde)
	if (!pde)
		return 1;
		return 1;
	pde->nlink = 1;
	pde->data = vdso_data;
	pde->data = vdso_data;
	pde->size = PAGE_SIZE;
	pde->size = PAGE_SIZE;
	pde->proc_fops = &page_map_fops;
	pde->proc_fops = &page_map_fops;
+0 −1
Original line number Original line Diff line number Diff line
@@ -708,7 +708,6 @@ static struct proc_dir_entry *create_flash_pde(const char *filename,


	ent = create_proc_entry(filename, S_IRUSR | S_IWUSR, NULL);
	ent = create_proc_entry(filename, S_IRUSR | S_IWUSR, NULL);
	if (ent != NULL) {
	if (ent != NULL) {
		ent->nlink = 1;
		ent->proc_fops = fops;
		ent->proc_fops = fops;
		ent->owner = THIS_MODULE;
		ent->owner = THIS_MODULE;
	}
	}
+0 −4
Original line number Original line Diff line number Diff line
@@ -1253,7 +1253,6 @@ static int __init mf_proc_init(void)
		ent = create_proc_entry("cmdline", S_IFREG|S_IRUSR|S_IWUSR, mf);
		ent = create_proc_entry("cmdline", S_IFREG|S_IRUSR|S_IWUSR, mf);
		if (!ent)
		if (!ent)
			return 1;
			return 1;
		ent->nlink = 1;
		ent->data = (void *)(long)i;
		ent->data = (void *)(long)i;
		ent->read_proc = proc_mf_dump_cmdline;
		ent->read_proc = proc_mf_dump_cmdline;
		ent->write_proc = proc_mf_change_cmdline;
		ent->write_proc = proc_mf_change_cmdline;
@@ -1264,7 +1263,6 @@ static int __init mf_proc_init(void)
		ent = create_proc_entry("vmlinux", S_IFREG|S_IWUSR, mf);
		ent = create_proc_entry("vmlinux", S_IFREG|S_IWUSR, mf);
		if (!ent)
		if (!ent)
			return 1;
			return 1;
		ent->nlink = 1;
		ent->data = (void *)(long)i;
		ent->data = (void *)(long)i;
		ent->proc_fops = &proc_vmlinux_operations;
		ent->proc_fops = &proc_vmlinux_operations;
	}
	}
@@ -1272,7 +1270,6 @@ static int __init mf_proc_init(void)
	ent = create_proc_entry("side", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root);
	ent = create_proc_entry("side", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root);
	if (!ent)
	if (!ent)
		return 1;
		return 1;
	ent->nlink = 1;
	ent->data = (void *)0;
	ent->data = (void *)0;
	ent->read_proc = proc_mf_dump_side;
	ent->read_proc = proc_mf_dump_side;
	ent->write_proc = proc_mf_change_side;
	ent->write_proc = proc_mf_change_side;
@@ -1280,7 +1277,6 @@ static int __init mf_proc_init(void)
	ent = create_proc_entry("src", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root);
	ent = create_proc_entry("src", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root);
	if (!ent)
	if (!ent)
		return 1;
		return 1;
	ent->nlink = 1;
	ent->data = (void *)0;
	ent->data = (void *)0;
	ent->read_proc = proc_mf_dump_src;
	ent->read_proc = proc_mf_dump_src;
	ent->write_proc = proc_mf_change_src;
	ent->write_proc = proc_mf_change_src;
+0 −1
Original line number Original line Diff line number Diff line
@@ -513,7 +513,6 @@ static int proc_ppc64_create_ofdt(void)


	ent = create_proc_entry("ppc64/ofdt", S_IWUSR, NULL);
	ent = create_proc_entry("ppc64/ofdt", S_IWUSR, NULL);
	if (ent) {
	if (ent) {
		ent->nlink = 1;
		ent->data = NULL;
		ent->data = NULL;
		ent->size = 0;
		ent->size = 0;
		ent->proc_fops = &ofdt_fops;
		ent->proc_fops = &ofdt_fops;
Loading