diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2007-02-10 04:45:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-11 13:51:32 -0500 |
commit | b653d081c17e26101980c858a9808740533b78b4 (patch) | |
tree | 907b6e6d97f30b61840cf4b1654f88a1df56945c | |
parent | 891dcd2f7ab15e2aaad07f6925b3a53fd8d5c02f (diff) |
[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: 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>
-rw-r--r-- | arch/mips/philips/pnx8550/common/proc.c | 7 | ||||
-rw-r--r-- | arch/powerpc/kernel/proc_ppc64.c | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/rtas_flash.c | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/mf.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/reconfig.c | 1 | ||||
-rw-r--r-- | arch/um/drivers/ubd_kern.c | 1 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 1 | ||||
-rw-r--r-- | drivers/ide/ide-proc.c | 1 | ||||
-rw-r--r-- | drivers/macintosh/via-pmu.c | 1 | ||||
-rw-r--r-- | drivers/misc/hdpuftrs/hdpu_nexus.c | 2 | ||||
-rw-r--r-- | drivers/parisc/led.c | 2 | ||||
-rw-r--r-- | drivers/s390/crypto/zcrypt_api.c | 1 | ||||
-rw-r--r-- | drivers/usb/gadget/rndis.c | 1 | ||||
-rw-r--r-- | kernel/irq/proc.c | 1 | ||||
-rw-r--r-- | kernel/profile.c | 1 |
15 files changed, 1 insertions, 25 deletions
diff --git a/arch/mips/philips/pnx8550/common/proc.c b/arch/mips/philips/pnx8550/common/proc.c index 72a016767e09..3f097558ef13 100644 --- a/arch/mips/philips/pnx8550/common/proc.c +++ b/arch/mips/philips/pnx8550/common/proc.c | |||
@@ -79,10 +79,7 @@ static int pnx8550_proc_init( void ) | |||
79 | 79 | ||
80 | // Create /proc/pnx8550 | 80 | // Create /proc/pnx8550 |
81 | pnx8550_dir = create_proc_entry("pnx8550", S_IFDIR|S_IRUGO, NULL); | 81 | pnx8550_dir = create_proc_entry("pnx8550", S_IFDIR|S_IRUGO, NULL); |
82 | if (pnx8550_dir){ | 82 | if (!pnx8550_dir) { |
83 | pnx8550_dir->nlink = 1; | ||
84 | } | ||
85 | else { | ||
86 | printk(KERN_ERR "Can't create pnx8550 proc dir\n"); | 83 | printk(KERN_ERR "Can't create pnx8550 proc dir\n"); |
87 | return -1; | 84 | return -1; |
88 | } | 85 | } |
@@ -90,7 +87,6 @@ static int pnx8550_proc_init( void ) | |||
90 | // Create /proc/pnx8550/timers | 87 | // Create /proc/pnx8550/timers |
91 | pnx8550_timers = create_proc_entry("timers", S_IFREG|S_IRUGO, pnx8550_dir ); | 88 | pnx8550_timers = create_proc_entry("timers", S_IFREG|S_IRUGO, pnx8550_dir ); |
92 | if (pnx8550_timers){ | 89 | if (pnx8550_timers){ |
93 | pnx8550_timers->nlink = 1; | ||
94 | pnx8550_timers->read_proc = pnx8550_timers_read; | 90 | pnx8550_timers->read_proc = pnx8550_timers_read; |
95 | } | 91 | } |
96 | else { | 92 | else { |
@@ -100,7 +96,6 @@ static int pnx8550_proc_init( void ) | |||
100 | // Create /proc/pnx8550/registers | 96 | // Create /proc/pnx8550/registers |
101 | pnx8550_registers = create_proc_entry("registers", S_IFREG|S_IRUGO, pnx8550_dir ); | 97 | pnx8550_registers = create_proc_entry("registers", S_IFREG|S_IRUGO, pnx8550_dir ); |
102 | if (pnx8550_registers){ | 98 | if (pnx8550_registers){ |
103 | pnx8550_registers->nlink = 1; | ||
104 | pnx8550_registers->read_proc = pnx8550_registers_read; | 99 | pnx8550_registers->read_proc = pnx8550_registers_read; |
105 | } | 100 | } |
106 | else { | 101 | else { |
diff --git a/arch/powerpc/kernel/proc_ppc64.c b/arch/powerpc/kernel/proc_ppc64.c index dd7001cacf75..3d437c32546e 100644 --- a/arch/powerpc/kernel/proc_ppc64.c +++ b/arch/powerpc/kernel/proc_ppc64.c | |||
@@ -71,7 +71,6 @@ static int __init proc_ppc64_init(void) | |||
71 | pde = create_proc_entry("ppc64/systemcfg", S_IFREG|S_IRUGO, NULL); | 71 | pde = create_proc_entry("ppc64/systemcfg", S_IFREG|S_IRUGO, NULL); |
72 | if (!pde) | 72 | if (!pde) |
73 | return 1; | 73 | return 1; |
74 | pde->nlink = 1; | ||
75 | pde->data = vdso_data; | 74 | pde->data = vdso_data; |
76 | pde->size = PAGE_SIZE; | 75 | pde->size = PAGE_SIZE; |
77 | pde->proc_fops = &page_map_fops; | 76 | pde->proc_fops = &page_map_fops; |
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c index 0c4fcd34bfe5..65e4ebe8db31 100644 --- a/arch/powerpc/kernel/rtas_flash.c +++ b/arch/powerpc/kernel/rtas_flash.c | |||
@@ -708,7 +708,6 @@ static struct proc_dir_entry *create_flash_pde(const char *filename, | |||
708 | 708 | ||
709 | ent = create_proc_entry(filename, S_IRUSR | S_IWUSR, NULL); | 709 | ent = create_proc_entry(filename, S_IRUSR | S_IWUSR, NULL); |
710 | if (ent != NULL) { | 710 | if (ent != NULL) { |
711 | ent->nlink = 1; | ||
712 | ent->proc_fops = fops; | 711 | ent->proc_fops = fops; |
713 | ent->owner = THIS_MODULE; | 712 | ent->owner = THIS_MODULE; |
714 | } | 713 | } |
diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c index 1ad0e4aaad1a..90d3d49f713e 100644 --- a/arch/powerpc/platforms/iseries/mf.c +++ b/arch/powerpc/platforms/iseries/mf.c | |||
@@ -1253,7 +1253,6 @@ static int __init mf_proc_init(void) | |||
1253 | ent = create_proc_entry("cmdline", S_IFREG|S_IRUSR|S_IWUSR, mf); | 1253 | ent = create_proc_entry("cmdline", S_IFREG|S_IRUSR|S_IWUSR, mf); |
1254 | if (!ent) | 1254 | if (!ent) |
1255 | return 1; | 1255 | return 1; |
1256 | ent->nlink = 1; | ||
1257 | ent->data = (void *)(long)i; | 1256 | ent->data = (void *)(long)i; |
1258 | ent->read_proc = proc_mf_dump_cmdline; | 1257 | ent->read_proc = proc_mf_dump_cmdline; |
1259 | ent->write_proc = proc_mf_change_cmdline; | 1258 | ent->write_proc = proc_mf_change_cmdline; |
@@ -1264,7 +1263,6 @@ static int __init mf_proc_init(void) | |||
1264 | ent = create_proc_entry("vmlinux", S_IFREG|S_IWUSR, mf); | 1263 | ent = create_proc_entry("vmlinux", S_IFREG|S_IWUSR, mf); |
1265 | if (!ent) | 1264 | if (!ent) |
1266 | return 1; | 1265 | return 1; |
1267 | ent->nlink = 1; | ||
1268 | ent->data = (void *)(long)i; | 1266 | ent->data = (void *)(long)i; |
1269 | ent->proc_fops = &proc_vmlinux_operations; | 1267 | ent->proc_fops = &proc_vmlinux_operations; |
1270 | } | 1268 | } |
@@ -1272,7 +1270,6 @@ static int __init mf_proc_init(void) | |||
1272 | ent = create_proc_entry("side", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root); | 1270 | ent = create_proc_entry("side", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root); |
1273 | if (!ent) | 1271 | if (!ent) |
1274 | return 1; | 1272 | return 1; |
1275 | ent->nlink = 1; | ||
1276 | ent->data = (void *)0; | 1273 | ent->data = (void *)0; |
1277 | ent->read_proc = proc_mf_dump_side; | 1274 | ent->read_proc = proc_mf_dump_side; |
1278 | ent->write_proc = proc_mf_change_side; | 1275 | ent->write_proc = proc_mf_change_side; |
@@ -1280,7 +1277,6 @@ static int __init mf_proc_init(void) | |||
1280 | ent = create_proc_entry("src", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root); | 1277 | ent = create_proc_entry("src", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root); |
1281 | if (!ent) | 1278 | if (!ent) |
1282 | return 1; | 1279 | return 1; |
1283 | ent->nlink = 1; | ||
1284 | ent->data = (void *)0; | 1280 | ent->data = (void *)0; |
1285 | ent->read_proc = proc_mf_dump_src; | 1281 | ent->read_proc = proc_mf_dump_src; |
1286 | ent->write_proc = proc_mf_change_src; | 1282 | ent->write_proc = proc_mf_change_src; |
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c index 4ad33e41b008..789a5e99aefd 100644 --- a/arch/powerpc/platforms/pseries/reconfig.c +++ b/arch/powerpc/platforms/pseries/reconfig.c | |||
@@ -513,7 +513,6 @@ static int proc_ppc64_create_ofdt(void) | |||
513 | 513 | ||
514 | ent = create_proc_entry("ppc64/ofdt", S_IWUSR, NULL); | 514 | ent = create_proc_entry("ppc64/ofdt", S_IWUSR, NULL); |
515 | if (ent) { | 515 | if (ent) { |
516 | ent->nlink = 1; | ||
517 | ent->data = NULL; | 516 | ent->data = NULL; |
518 | ent->size = 0; | 517 | ent->size = 0; |
519 | ent->proc_fops = &ofdt_fops; | 518 | ent->proc_fops = &ofdt_fops; |
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index da0badcd7551..f98d26e51381 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c | |||
@@ -235,7 +235,6 @@ static void make_ide_entries(char *dev_name) | |||
235 | 235 | ||
236 | ent = create_proc_entry("media", S_IFREG|S_IRUGO, dir); | 236 | ent = create_proc_entry("media", S_IFREG|S_IRUGO, dir); |
237 | if(!ent) return; | 237 | if(!ent) return; |
238 | ent->nlink = 1; | ||
239 | ent->data = NULL; | 238 | ent->data = NULL; |
240 | ent->read_proc = proc_ide_read_media; | 239 | ent->read_proc = proc_ide_read_media; |
241 | ent->write_proc = NULL; | 240 | ent->write_proc = NULL; |
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 230064ede08d..3aff5e99b674 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
@@ -1887,7 +1887,6 @@ int ipmi_smi_add_proc_entry(ipmi_smi_t smi, char *name, | |||
1887 | kfree(entry); | 1887 | kfree(entry); |
1888 | rv = -ENOMEM; | 1888 | rv = -ENOMEM; |
1889 | } else { | 1889 | } else { |
1890 | file->nlink = 1; | ||
1891 | file->data = data; | 1890 | file->data = data; |
1892 | file->read_proc = read_proc; | 1891 | file->read_proc = read_proc; |
1893 | file->write_proc = write_proc; | 1892 | file->write_proc = write_proc; |
diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c index aa049dab3d95..ad49bd823ebd 100644 --- a/drivers/ide/ide-proc.c +++ b/drivers/ide/ide-proc.c | |||
@@ -413,7 +413,6 @@ void ide_add_proc_entries(struct proc_dir_entry *dir, ide_proc_entry_t *p, void | |||
413 | while (p->name != NULL) { | 413 | while (p->name != NULL) { |
414 | ent = create_proc_entry(p->name, p->mode, dir); | 414 | ent = create_proc_entry(p->name, p->mode, dir); |
415 | if (!ent) return; | 415 | if (!ent) return; |
416 | ent->nlink = 1; | ||
417 | ent->data = data; | 416 | ent->data = data; |
418 | ent->read_proc = p->read_proc; | 417 | ent->read_proc = p->read_proc; |
419 | ent->write_proc = p->write_proc; | 418 | ent->write_proc = p->write_proc; |
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index 8ca75e52f637..eb6653f69ce4 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c | |||
@@ -516,7 +516,6 @@ static int __init via_pmu_dev_init(void) | |||
516 | proc_get_irqstats, NULL); | 516 | proc_get_irqstats, NULL); |
517 | proc_pmu_options = create_proc_entry("options", 0600, proc_pmu_root); | 517 | proc_pmu_options = create_proc_entry("options", 0600, proc_pmu_root); |
518 | if (proc_pmu_options) { | 518 | if (proc_pmu_options) { |
519 | proc_pmu_options->nlink = 1; | ||
520 | proc_pmu_options->read_proc = proc_read_options; | 519 | proc_pmu_options->read_proc = proc_read_options; |
521 | proc_pmu_options->write_proc = proc_write_options; | 520 | proc_pmu_options->write_proc = proc_write_options; |
522 | } | 521 | } |
diff --git a/drivers/misc/hdpuftrs/hdpu_nexus.c b/drivers/misc/hdpuftrs/hdpu_nexus.c index ea9d5f233c83..6a51e99a8079 100644 --- a/drivers/misc/hdpuftrs/hdpu_nexus.c +++ b/drivers/misc/hdpuftrs/hdpu_nexus.c | |||
@@ -72,11 +72,9 @@ static int hdpu_nexus_probe(struct platform_device *pdev) | |||
72 | printk("Could not map slot id\n"); | 72 | printk("Could not map slot id\n"); |
73 | hdpu_slot_id = create_proc_entry("sky_slot_id", 0666, &proc_root); | 73 | hdpu_slot_id = create_proc_entry("sky_slot_id", 0666, &proc_root); |
74 | hdpu_slot_id->read_proc = hdpu_slot_id_read; | 74 | hdpu_slot_id->read_proc = hdpu_slot_id_read; |
75 | hdpu_slot_id->nlink = 1; | ||
76 | 75 | ||
77 | hdpu_chassis_id = create_proc_entry("sky_chassis_id", 0666, &proc_root); | 76 | hdpu_chassis_id = create_proc_entry("sky_chassis_id", 0666, &proc_root); |
78 | hdpu_chassis_id->read_proc = hdpu_chassis_id_read; | 77 | hdpu_chassis_id->read_proc = hdpu_chassis_id_read; |
79 | hdpu_chassis_id->nlink = 1; | ||
80 | return 0; | 78 | return 0; |
81 | } | 79 | } |
82 | 80 | ||
diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c index 8dac2ba82bb9..9a731c101d10 100644 --- a/drivers/parisc/led.c +++ b/drivers/parisc/led.c | |||
@@ -252,7 +252,6 @@ static int __init led_create_procfs(void) | |||
252 | proc_pdc_root->owner = THIS_MODULE; | 252 | proc_pdc_root->owner = THIS_MODULE; |
253 | ent = create_proc_entry("led", S_IFREG|S_IRUGO|S_IWUSR, proc_pdc_root); | 253 | ent = create_proc_entry("led", S_IFREG|S_IRUGO|S_IWUSR, proc_pdc_root); |
254 | if (!ent) return -1; | 254 | if (!ent) return -1; |
255 | ent->nlink = 1; | ||
256 | ent->data = (void *)LED_NOLCD; /* LED */ | 255 | ent->data = (void *)LED_NOLCD; /* LED */ |
257 | ent->read_proc = led_proc_read; | 256 | ent->read_proc = led_proc_read; |
258 | ent->write_proc = led_proc_write; | 257 | ent->write_proc = led_proc_write; |
@@ -262,7 +261,6 @@ static int __init led_create_procfs(void) | |||
262 | { | 261 | { |
263 | ent = create_proc_entry("lcd", S_IFREG|S_IRUGO|S_IWUSR, proc_pdc_root); | 262 | ent = create_proc_entry("lcd", S_IFREG|S_IRUGO|S_IWUSR, proc_pdc_root); |
264 | if (!ent) return -1; | 263 | if (!ent) return -1; |
265 | ent->nlink = 1; | ||
266 | ent->data = (void *)LED_HASLCD; /* LCD */ | 264 | ent->data = (void *)LED_HASLCD; /* LCD */ |
267 | ent->read_proc = led_proc_read; | 265 | ent->read_proc = led_proc_read; |
268 | ent->write_proc = led_proc_write; | 266 | ent->write_proc = led_proc_write; |
diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c index b9e59bc9435a..2c785148d21e 100644 --- a/drivers/s390/crypto/zcrypt_api.c +++ b/drivers/s390/crypto/zcrypt_api.c | |||
@@ -1063,7 +1063,6 @@ int __init zcrypt_api_init(void) | |||
1063 | rc = -ENOMEM; | 1063 | rc = -ENOMEM; |
1064 | goto out_misc; | 1064 | goto out_misc; |
1065 | } | 1065 | } |
1066 | zcrypt_entry->nlink = 1; | ||
1067 | zcrypt_entry->data = NULL; | 1066 | zcrypt_entry->data = NULL; |
1068 | zcrypt_entry->read_proc = zcrypt_status_read; | 1067 | zcrypt_entry->read_proc = zcrypt_status_read; |
1069 | zcrypt_entry->write_proc = zcrypt_status_write; | 1068 | zcrypt_entry->write_proc = zcrypt_status_write; |
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c index 408c3380d602..6ec8cf1a3ccb 100644 --- a/drivers/usb/gadget/rndis.c +++ b/drivers/usb/gadget/rndis.c | |||
@@ -1419,7 +1419,6 @@ int __devinit rndis_init (void) | |||
1419 | return -EIO; | 1419 | return -EIO; |
1420 | } | 1420 | } |
1421 | 1421 | ||
1422 | rndis_connect_state [i]->nlink = 1; | ||
1423 | rndis_connect_state [i]->write_proc = rndis_proc_write; | 1422 | rndis_connect_state [i]->write_proc = rndis_proc_write; |
1424 | rndis_connect_state [i]->read_proc = rndis_proc_read; | 1423 | rndis_connect_state [i]->read_proc = rndis_proc_read; |
1425 | rndis_connect_state [i]->data = (void *) | 1424 | rndis_connect_state [i]->data = (void *) |
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index 61f5c717a8f5..6d3be06e8ce6 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c | |||
@@ -136,7 +136,6 @@ void register_irq_proc(unsigned int irq) | |||
136 | entry = create_proc_entry("smp_affinity", 0600, irq_desc[irq].dir); | 136 | entry = create_proc_entry("smp_affinity", 0600, irq_desc[irq].dir); |
137 | 137 | ||
138 | if (entry) { | 138 | if (entry) { |
139 | entry->nlink = 1; | ||
140 | entry->data = (void *)(long)irq; | 139 | entry->data = (void *)(long)irq; |
141 | entry->read_proc = irq_affinity_read_proc; | 140 | entry->read_proc = irq_affinity_read_proc; |
142 | entry->write_proc = irq_affinity_write_proc; | 141 | entry->write_proc = irq_affinity_write_proc; |
diff --git a/kernel/profile.c b/kernel/profile.c index d6579d511069..9bfadb248dd8 100644 --- a/kernel/profile.c +++ b/kernel/profile.c | |||
@@ -449,7 +449,6 @@ void create_prof_cpu_mask(struct proc_dir_entry *root_irq_dir) | |||
449 | /* create /proc/irq/prof_cpu_mask */ | 449 | /* create /proc/irq/prof_cpu_mask */ |
450 | if (!(entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir))) | 450 | if (!(entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir))) |
451 | return; | 451 | return; |
452 | entry->nlink = 1; | ||
453 | entry->data = (void *)&prof_cpu_mask; | 452 | entry->data = (void *)&prof_cpu_mask; |
454 | entry->read_proc = prof_cpu_mask_read_proc; | 453 | entry->read_proc = prof_cpu_mask_read_proc; |
455 | entry->write_proc = prof_cpu_mask_write_proc; | 454 | entry->write_proc = prof_cpu_mask_write_proc; |