Messages in this thread Patch in this message |  | | | Date | Fri, 6 Nov 1998 22:38:07 +0100 (CET) | | From | Andrea Arcangeli <> | | Subject | [proc] sysctl/proc compile fix |
| |
This patch extracted by my arca-10 allow a clean compile if CONFIG_PROC_FS and/or CONFIG_SYSCTL are not set.
Patch against pre-2.1.127-7:
Index: linux/drivers/misc/parport_arc.c diff -u linux/drivers/misc/parport_arc.c:1.1.1.2 linux/drivers/misc/parport_arc.c:1.1.1.1.12.2 --- linux/drivers/misc/parport_arc.c:1.1.1.2 Sat Oct 24 15:40:02 1998 +++ linux/drivers/misc/parport_arc.c Tue Oct 20 01:13:28 1998 @@ -141,7 +141,9 @@ printk(KERN_INFO "%s: Archimedes on-board port, using irq %d\n", p->irq); +#ifdef CONFIG_PROC_FS parport_proc_register(p); +#endif p->flags |= PARPORT_FLAG_COMA; if (parport_probe_hook) Index: linux/drivers/misc/parport_ax.c diff -u linux/drivers/misc/parport_ax.c:1.1.1.2 linux/drivers/misc/parport_ax.c:1.1.1.1.12.2 --- linux/drivers/misc/parport_ax.c:1.1.1.2 Sat Oct 24 15:40:02 1998 +++ linux/drivers/misc/parport_ax.c Tue Oct 20 01:13:28 1998 @@ -585,7 +585,9 @@ printmode(ECPPS2); } printk("]\n"); +#ifdef CONFIG_PROC_FS parport_proc_register(p); +#endif p->flags |= PARPORT_FLAG_COMA; p->ops->write_control(p, 0x0c); @@ -628,7 +630,9 @@ if (p->modes & PARPORT_MODE_PCSPP) { if (!(p->flags & PARPORT_FLAG_COMA)) parport_quiesce(p); +#ifdef CONFIG_PROC_FS parport_proc_unregister(p); +#endif parport_unregister_port(p); } p = tmp; Index: linux/drivers/misc/parport_init.c diff -u linux/drivers/misc/parport_init.c:1.1.1.1 linux/drivers/misc/parport_init.c:1.1.1.1.14.1 --- linux/drivers/misc/parport_init.c:1.1.1.1 Fri Oct 2 19:23:33 1998 +++ linux/drivers/misc/parport_init.c Tue Oct 20 01:13:28 1998 @@ -98,13 +98,17 @@ #ifdef MODULE int init_module(void) { +#ifdef CONFIG_PROC_FS (void)parport_proc_init(); /* We can go on without it. */ +#endif return 0; } void cleanup_module(void) { +#ifdef CONFIG_PROC_FS parport_proc_cleanup(); +#endif } #else __initfunc(int parport_init(void)) @@ -115,7 +119,9 @@ #ifdef CONFIG_PNP_PARPORT parport_probe_hook = &parport_probe_one; #endif +#ifdef CONFIG_PROC_FS parport_proc_init(); +#endif #ifdef CONFIG_PARPORT_PC parport_pc_init(io, irq, dma); #endif @@ -139,8 +145,10 @@ EXPORT_SYMBOL(parport_enumerate); EXPORT_SYMBOL(parport_ieee1284_nibble_mode_ok); EXPORT_SYMBOL(parport_wait_peripheral); +#ifdef CONFIG_PROC_FS EXPORT_SYMBOL(parport_proc_register); EXPORT_SYMBOL(parport_proc_unregister); +#endif EXPORT_SYMBOL(parport_probe_hook); EXPORT_SYMBOL(parport_parse_irqs); Index: linux/drivers/misc/parport_pc.c diff -u linux/drivers/misc/parport_pc.c:1.1.1.3 linux/drivers/misc/parport_pc.c:1.1.1.1.12.3 --- linux/drivers/misc/parport_pc.c:1.1.1.3 Tue Oct 27 08:40:16 1998 +++ linux/drivers/misc/parport_pc.c Tue Oct 27 15:15:11 1998 @@ -755,9 +755,11 @@ } #undef printmode printk("]\n"); +#ifdef CONFIG_PROC_FS if (probedirq != PARPORT_IRQ_NONE) printk("%s: detected irq %d; use procfs to enable interrupt-driven operation.\n", p->name, probedirq); parport_proc_register(p); +#endif p->flags |= PARPORT_FLAG_COMA; /* Done probing. Now put the port into a sensible start-up state. */ @@ -821,7 +823,9 @@ if (p->modes & PARPORT_MODE_PCSPP) { if (!(p->flags & PARPORT_FLAG_COMA)) parport_quiesce(p); +#ifdef CONFIG_PROC_FS parport_proc_unregister(p); +#endif parport_unregister_port(p); } p = tmp; Index: linux/drivers/pci/pcisyms.c diff -u linux/drivers/pci/pcisyms.c:1.1.1.1 linux/drivers/pci/pcisyms.c:1.1.1.1.14.1 --- linux/drivers/pci/pcisyms.c:1.1.1.1 Fri Oct 2 19:23:27 1998 +++ linux/drivers/pci/pcisyms.c Tue Oct 20 01:13:31 1998 @@ -28,8 +28,10 @@ EXPORT_SYMBOL(pci_find_device); EXPORT_SYMBOL(pci_find_slot); EXPORT_SYMBOL(pci_set_master); +#ifdef CONFIG_PROC_FS EXPORT_SYMBOL(pci_proc_attach_device); EXPORT_SYMBOL(pci_proc_detach_device); +#endif /* Backward compatibility */ Index: linux/kernel/sysctl.c diff -u linux/kernel/sysctl.c:1.1.1.2 linux/kernel/sysctl.c:1.1.1.2.4.2 --- linux/kernel/sysctl.c:1.1.1.2 Fri Oct 9 17:44:10 1998 +++ linux/kernel/sysctl.c Fri Oct 30 19:11:17 1998 @@ -34,11 +34,11 @@ #include <linux/nfs_fs.h> #endif -#if defined(CONFIG_SYSCTL) && defined(CONFIG_PROC_FS) +#if defined(CONFIG_SYSCTL) /* External variables not in a header file. */ extern int panic_timeout; -extern int console_loglevel, C_A_D, swapout_interval; +extern int console_loglevel, C_A_D; extern int bdf_prm[], bdflush_min[], bdflush_max[]; extern char binfmt_java_interpreter[], binfmt_java_appletviewer[]; extern int sysctl_overcommit_memory; @@ -125,11 +125,11 @@ extern struct proc_dir_entry proc_sys_root; -extern int inodes_stat[]; -extern int dentry_stat[]; static void register_proc_table(ctl_table *, struct proc_dir_entry *); static void unregister_proc_table(ctl_table *, struct proc_dir_entry *); #endif +extern int inodes_stat[]; +extern int dentry_stat[]; /* The default sysctl tables: */ @@ -199,8 +199,6 @@ static ctl_table vm_table[] = { {VM_SWAPCTL, "swapctl", &swap_control, sizeof(swap_control_t), 0644, NULL, &proc_dointvec}, - {VM_SWAPOUT, "swapout_interval", - &swapout_interval, sizeof(int), 0644, NULL, &proc_dointvec}, {VM_FREEPG, "freepages", &freepages, sizeof(freepages_t), 0644, NULL, &proc_dointvec}, {VM_BDFLUSH, "bdflush", &bdf_prm, 9*sizeof(int), 0600, NULL, @@ -866,14 +864,14 @@ #else /* CONFIG_PROC_FS */ -int proc_dointvec_jiffies(ctl_table *table, int write, struct file *filp, - void *buffer, size_t *lenp) +int proc_dostring(ctl_table *table, int write, struct file *filp, + void *buffer, size_t *lenp) { - return -ENOSYS; + return -ENOSYS; } -int proc_dostring(ctl_table *table, int write, struct file *filp, - void *buffer, size_t *lenp) +static int proc_doutsstring(ctl_table *table, int write, struct file *filp, + void *buffer, size_t *lenp) { return -ENOSYS; } @@ -1053,7 +1051,7 @@ } -#else /* CONFIG_PROC_FS && CONFIG_SYSCTL */ +#else /* CONFIG_SYSCTL */ extern asmlinkage int sys_sysctl(struct __sysctl_args *args) @@ -1108,8 +1106,5 @@ void unregister_sysctl_table(struct ctl_table_header * table) { } - -#endif /* CONFIG_PROC_FS && CONFIG_SYSCTL */ - - +#endif /* CONFIG_SYSCTL */ Index: linux/net/ipv4/ip_masq.c diff -u linux/net/ipv4/ip_masq.c:1.1.1.2 linux/net/ipv4/ip_masq.c:1.1.1.2.4.1 --- linux/net/ipv4/ip_masq.c:1.1.1.2 Fri Oct 9 17:44:21 1998 +++ linux/net/ipv4/ip_masq.c Tue Oct 20 01:13:32 1998 @@ -2149,6 +2149,14 @@ return ret; } +/* + * Wrapper over inet_select_addr() + */ +u32 ip_masq_select_addr(struct device *dev, u32 dst, int scope) +{ + return inet_select_addr(dev, dst, scope); +} + #ifdef CONFIG_PROC_FS static struct proc_dir_entry *proc_net_ip_masq = NULL; @@ -2175,14 +2183,6 @@ IP_MASQ_DEBUG(1, "unregistering \"/proc/net/ip_masq/%s\" entry\n", ent->name); proc_unregister(proc_net_ip_masq, ent->low_ino); -} - -/* - * Wrapper over inet_select_addr() - */ -u32 ip_masq_select_addr(struct device *dev, u32 dst, int scope) -{ - return inet_select_addr(dev, dst, scope); } __initfunc(static void masq_proc_init(void))
Andrea Arcangeli
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
|  |