[PATCH] proc: remove useless (and buggy) ->nlink settings
authorAlexey Dobriyan <adobriyan@gmail.com>
Sat, 10 Feb 2007 09:45:54 +0000 (01:45 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 11 Feb 2007 18:51:32 +0000 (10:51 -0800)
Bug: pnx8550 code creates directory but resets ->nlink to 1.

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

Signed-off-by: Alexey 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 files changed:
arch/mips/philips/pnx8550/common/proc.c
arch/powerpc/kernel/proc_ppc64.c
arch/powerpc/kernel/rtas_flash.c
arch/powerpc/platforms/iseries/mf.c
arch/powerpc/platforms/pseries/reconfig.c
arch/um/drivers/ubd_kern.c
drivers/char/ipmi/ipmi_msghandler.c
drivers/ide/ide-proc.c
drivers/macintosh/via-pmu.c
drivers/misc/hdpuftrs/hdpu_nexus.c
drivers/parisc/led.c
drivers/s390/crypto/zcrypt_api.c
drivers/usb/gadget/rndis.c
kernel/irq/proc.c
kernel/profile.c

index 72a016767e09d399f3ff65d95641a7082e639e32..3f097558ef1365df5b3f1d62343744322e731782 100644 (file)
@@ -79,10 +79,7 @@ static int pnx8550_proc_init( void )
 
        // Create /proc/pnx8550
         pnx8550_dir = create_proc_entry("pnx8550", S_IFDIR|S_IRUGO, NULL);
-        if (pnx8550_dir){
-                pnx8550_dir->nlink = 1;
-        }
-        else {
+        if (!pnx8550_dir) {
                 printk(KERN_ERR "Can't create pnx8550 proc dir\n");
                 return -1;
         }
@@ -90,7 +87,6 @@ static int pnx8550_proc_init( void )
        // Create /proc/pnx8550/timers
         pnx8550_timers = create_proc_entry("timers", S_IFREG|S_IRUGO, pnx8550_dir );
         if (pnx8550_timers){
-                pnx8550_timers->nlink = 1;
                 pnx8550_timers->read_proc = pnx8550_timers_read;
         }
         else {
@@ -100,7 +96,6 @@ static int pnx8550_proc_init( void )
        // Create /proc/pnx8550/registers
         pnx8550_registers = create_proc_entry("registers", S_IFREG|S_IRUGO, pnx8550_dir );
         if (pnx8550_registers){
-                pnx8550_registers->nlink = 1;
                 pnx8550_registers->read_proc = pnx8550_registers_read;
         }
         else {
index dd7001cacf75cfc09040b05961c39bb7c0471cfd..3d437c32546ee6a463af22c4a0270e28279cae71 100644 (file)
@@ -71,7 +71,6 @@ static int __init proc_ppc64_init(void)
        pde = create_proc_entry("ppc64/systemcfg", S_IFREG|S_IRUGO, NULL);
        if (!pde)
                return 1;
-       pde->nlink = 1;
        pde->data = vdso_data;
        pde->size = PAGE_SIZE;
        pde->proc_fops = &page_map_fops;
index 0c4fcd34bfe585ce199271ec7f73fcc549e9d171..65e4ebe8db319e58c16730c37642a13770a80f43 100644 (file)
@@ -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);
        if (ent != NULL) {
-               ent->nlink = 1;
                ent->proc_fops = fops;
                ent->owner = THIS_MODULE;
        }
index 1ad0e4aaad1a0d5ba514e4d1d136c9cf7d40907c..90d3d49f713e827b6312d43a8656f4981d3b397c 100644 (file)
@@ -1253,7 +1253,6 @@ static int __init mf_proc_init(void)
                ent = create_proc_entry("cmdline", S_IFREG|S_IRUSR|S_IWUSR, mf);
                if (!ent)
                        return 1;
-               ent->nlink = 1;
                ent->data = (void *)(long)i;
                ent->read_proc = proc_mf_dump_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);
                if (!ent)
                        return 1;
-               ent->nlink = 1;
                ent->data = (void *)(long)i;
                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);
        if (!ent)
                return 1;
-       ent->nlink = 1;
        ent->data = (void *)0;
        ent->read_proc = proc_mf_dump_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);
        if (!ent)
                return 1;
-       ent->nlink = 1;
        ent->data = (void *)0;
        ent->read_proc = proc_mf_dump_src;
        ent->write_proc = proc_mf_change_src;
index 4ad33e41b0082794582e9a8710d063aa6e7ab599..789a5e99aefdedc7b77c6bdbd719494df50b06a1 100644 (file)
@@ -513,7 +513,6 @@ static int proc_ppc64_create_ofdt(void)
 
        ent = create_proc_entry("ppc64/ofdt", S_IWUSR, NULL);
        if (ent) {
-               ent->nlink = 1;
                ent->data = NULL;
                ent->size = 0;
                ent->proc_fops = &ofdt_fops;
index da0badcd7551de2bad7e2a970532eb0497deedd9..f98d26e513813483dc27681ce75f180e7566f4ae 100644 (file)
@@ -235,7 +235,6 @@ static void make_ide_entries(char *dev_name)
 
        ent = create_proc_entry("media", S_IFREG|S_IRUGO, dir);
        if(!ent) return;
-       ent->nlink = 1;
        ent->data = NULL;
        ent->read_proc = proc_ide_read_media;
        ent->write_proc = NULL;
index 230064ede08d9ade7c9fa26f3ce5e7f76127ccd6..3aff5e99b674360bad4fa42407d70a9d594656e4 100644 (file)
@@ -1887,7 +1887,6 @@ int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name,
                kfree(entry);
                rv = -ENOMEM;
        } else {
-               file->nlink = 1;
                file->data = data;
                file->read_proc = read_proc;
                file->write_proc = write_proc;
index aa049dab3d95c17609f3a1d54621f18a01896749..ad49bd823ebd11548696e43c66ee7392ac5a8306 100644 (file)
@@ -413,7 +413,6 @@ void ide_add_proc_entries(struct proc_dir_entry *dir, ide_proc_entry_t *p, void
        while (p->name != NULL) {
                ent = create_proc_entry(p->name, p->mode, dir);
                if (!ent) return;
-               ent->nlink = 1;
                ent->data = data;
                ent->read_proc = p->read_proc;
                ent->write_proc = p->write_proc;
index 8ca75e52f637021ea33f49d3c6a4175506313ecc..eb6653f69ce4dfc60111d5e34d9cbfd2fade4a1b 100644 (file)
@@ -516,7 +516,6 @@ static int __init via_pmu_dev_init(void)
                                        proc_get_irqstats, NULL);
                proc_pmu_options = create_proc_entry("options", 0600, proc_pmu_root);
                if (proc_pmu_options) {
-                       proc_pmu_options->nlink = 1;
                        proc_pmu_options->read_proc = proc_read_options;
                        proc_pmu_options->write_proc = proc_write_options;
                }
index ea9d5f233c83037568350a82224d5870bda6a7ba..6a51e99a8079995adfb9183a0af21108eb0705ff 100644 (file)
@@ -72,11 +72,9 @@ static int hdpu_nexus_probe(struct platform_device *pdev)
                printk("Could not map slot id\n");
        hdpu_slot_id = create_proc_entry("sky_slot_id", 0666, &proc_root);
        hdpu_slot_id->read_proc = hdpu_slot_id_read;
-       hdpu_slot_id->nlink = 1;
 
        hdpu_chassis_id = create_proc_entry("sky_chassis_id", 0666, &proc_root);
        hdpu_chassis_id->read_proc = hdpu_chassis_id_read;
-       hdpu_chassis_id->nlink = 1;
        return 0;
 }
 
index 8dac2ba82bb95ee748d6b69d5f56e02f4b30e329..9a731c101d102ed11305372a6416b9b92ac3d76c 100644 (file)
@@ -252,7 +252,6 @@ static int __init led_create_procfs(void)
        proc_pdc_root->owner = THIS_MODULE;
        ent = create_proc_entry("led", S_IFREG|S_IRUGO|S_IWUSR, proc_pdc_root);
        if (!ent) return -1;
-       ent->nlink = 1;
        ent->data = (void *)LED_NOLCD; /* LED */
        ent->read_proc = led_proc_read;
        ent->write_proc = led_proc_write;
@@ -262,7 +261,6 @@ static int __init led_create_procfs(void)
        {
                ent = create_proc_entry("lcd", S_IFREG|S_IRUGO|S_IWUSR, proc_pdc_root);
                if (!ent) return -1;
-               ent->nlink = 1;
                ent->data = (void *)LED_HASLCD; /* LCD */
                ent->read_proc = led_proc_read;
                ent->write_proc = led_proc_write;
index b9e59bc9435aea3e3c6ad0dea4e903cde728b21a..2c785148d21e5e060334bb9296da7a03baa2458b 100644 (file)
@@ -1063,7 +1063,6 @@ int __init zcrypt_api_init(void)
                rc = -ENOMEM;
                goto out_misc;
        }
-       zcrypt_entry->nlink = 1;
        zcrypt_entry->data = NULL;
        zcrypt_entry->read_proc = zcrypt_status_read;
        zcrypt_entry->write_proc = zcrypt_status_write;
index 408c3380d60203254b510c43a728da6214a42c7c..6ec8cf1a3ccb1cd14d39667231da28b36abdecdf 100644 (file)
@@ -1419,7 +1419,6 @@ int __devinit rndis_init (void)
                        return -EIO;
                }
 
-               rndis_connect_state [i]->nlink = 1;
                rndis_connect_state [i]->write_proc = rndis_proc_write;
                rndis_connect_state [i]->read_proc = rndis_proc_read;
                rndis_connect_state [i]->data = (void *)
index 61f5c717a8f579cbe5dd3c9b3991b7ef2fb5cead..6d3be06e8ce6362d2f2e106452c9c5383ebc6cfc 100644 (file)
@@ -136,7 +136,6 @@ void register_irq_proc(unsigned int irq)
                entry = create_proc_entry("smp_affinity", 0600, irq_desc[irq].dir);
 
                if (entry) {
-                       entry->nlink = 1;
                        entry->data = (void *)(long)irq;
                        entry->read_proc = irq_affinity_read_proc;
                        entry->write_proc = irq_affinity_write_proc;
index d6579d511069130980196be79005f2724a01b8d3..9bfadb248dd877b009e49710db79957f13188c5d 100644 (file)
@@ -449,7 +449,6 @@ void create_prof_cpu_mask(struct proc_dir_entry *root_irq_dir)
        /* create /proc/irq/prof_cpu_mask */
        if (!(entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir)))
                return;
-       entry->nlink = 1;
        entry->data = (void *)&prof_cpu_mask;
        entry->read_proc = prof_cpu_mask_read_proc;
        entry->write_proc = prof_cpu_mask_write_proc;