From 73ea90db30dc8cc59e06537a03d4e700c9b77c25 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Mon, 8 May 2006 19:51:28 +1000 Subject: [PATCH] --- yaml --- r: 26564 b: refs/heads/master c: d08d389d5aef0509edba7ee42cd6c6a3998fee22 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/Makefile | 20 +++++----- trunk/arch/i386/kernel/io_apic.c | 5 --- trunk/arch/i386/kernel/mpparse.c | 12 +----- trunk/arch/ia64/lib/memcpy_mck.S | 9 ++--- trunk/arch/x86_64/kernel/e820.c | 6 --- trunk/arch/x86_64/kernel/io_apic.c | 5 --- trunk/arch/x86_64/kernel/mpparse.c | 12 +----- trunk/arch/x86_64/kernel/pci-gart.c | 8 ---- trunk/arch/x86_64/kernel/setup.c | 30 ++++----------- trunk/arch/x86_64/kernel/traps.c | 12 +----- trunk/drivers/base/class.c | 32 ---------------- trunk/drivers/cpufreq/cpufreq_ondemand.c | 28 ++++---------- trunk/drivers/net/irda/irda-usb.c | 2 +- trunk/drivers/video/logo/Makefile | 2 +- trunk/fs/locks.c | 21 +++++----- trunk/fs/xfs/xfs_vfsops.c | 27 +++++-------- trunk/include/asm-i386/io_apic.h | 1 - trunk/include/asm-ia64/bitops.h | 1 + trunk/include/asm-x86_64/e820.h | 2 - trunk/include/asm-x86_64/io_apic.h | 1 - trunk/include/linux/device.h | 2 - trunk/include/linux/netdevice.h | 2 - trunk/net/core/dev.c | 2 +- trunk/net/core/net-sysfs.c | 49 ++++++++++++++++++------ trunk/net/ipv4/ip_input.c | 2 +- trunk/scripts/gen_initramfs_list.sh | 6 +-- trunk/scripts/mkmakefile | 5 +-- trunk/scripts/mod/modpost.c | 6 +-- 29 files changed, 99 insertions(+), 213 deletions(-) diff --git a/[refs] b/[refs] index fc013303be45..8091d3f7f2e9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 601e7f024edbea8018de34c83a7398623214e636 +refs/heads/master: d08d389d5aef0509edba7ee42cd6c6a3998fee22 diff --git a/trunk/Makefile b/trunk/Makefile index 9e4c5692a32f..6bf99624bd4c 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -344,14 +344,16 @@ scripts_basic: scripts/basic/%: scripts_basic ; PHONY += outputmakefile -# outputmakefile generates a Makefile in the output directory, if using a -# separate output directory. This allows convenient use of make in the -# output directory. +# outputmakefile generate a Makefile to be placed in output directory, if +# using a seperate output directory. This allows convinient use +# of make in output directory outputmakefile: -ifneq ($(KBUILD_SRC),) - $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \ - $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) -endif + $(Q)if test ! $(srctree) -ef $(objtree); then \ + $(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \ + $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) \ + > $(objtree)/Makefile; \ + echo ' GEN $(objtree)/Makefile'; \ + fi # To make sure we do not include .config for any of the *config targets # catch them early, and hand them over to scripts/kconfig/Makefile @@ -794,8 +796,8 @@ prepare2: prepare3 outputmakefile prepare1: prepare2 include/linux/version.h include/asm \ include/config/MARKER ifneq ($(KBUILD_MODULES),) + $(Q)rm -rf $(MODVERDIR) $(Q)mkdir -p $(MODVERDIR) - $(Q)rm -f $(MODVERDIR)/* endif archprepare: prepare1 scripts_basic @@ -1084,8 +1086,8 @@ else # KBUILD_EXTMOD KBUILD_MODULES := 1 PHONY += crmodverdir crmodverdir: + $(Q)rm -rf $(MODVERDIR) $(Q)mkdir -p $(MODVERDIR) - $(Q)rm -f $(MODVERDIR)/* PHONY += $(objtree)/Module.symvers $(objtree)/Module.symvers: diff --git a/trunk/arch/i386/kernel/io_apic.c b/trunk/arch/i386/kernel/io_apic.c index d70f2ade5cde..f8f132aa5472 100644 --- a/trunk/arch/i386/kernel/io_apic.c +++ b/trunk/arch/i386/kernel/io_apic.c @@ -2238,8 +2238,6 @@ static inline void unlock_ExtINT_logic(void) spin_unlock_irqrestore(&ioapic_lock, flags); } -int timer_uses_ioapic_pin_0; - /* * This code may look a bit paranoid, but it's supposed to cooperate with * a wide range of boards and BIOS bugs. Fortunately only the timer IRQ @@ -2276,9 +2274,6 @@ static inline void check_timer(void) pin2 = ioapic_i8259.pin; apic2 = ioapic_i8259.apic; - if (pin1 == 0) - timer_uses_ioapic_pin_0 = 1; - printk(KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n", vector, apic1, pin1, apic2, pin2); diff --git a/trunk/arch/i386/kernel/mpparse.c b/trunk/arch/i386/kernel/mpparse.c index 6b1392d33ed5..34d21e21e012 100644 --- a/trunk/arch/i386/kernel/mpparse.c +++ b/trunk/arch/i386/kernel/mpparse.c @@ -1130,17 +1130,7 @@ int mp_register_gsi (u32 gsi, int triggering, int polarity) */ int irq = gsi; if (gsi < MAX_GSI_NUM) { - /* - * Retain the VIA chipset work-around (gsi > 15), but - * avoid a problem where the 8254 timer (IRQ0) is setup - * via an override (so it's not on pin 0 of the ioapic), - * and at the same time, the pin 0 interrupt is a PCI - * type. The gsi > 15 test could cause these two pins - * to be shared as IRQ0, and they are not shareable. - * So test for this condition, and if necessary, avoid - * the pin collision. - */ - if (gsi > 15 || (gsi == 0 && !timer_uses_ioapic_pin_0)) + if (gsi > 15) gsi = pci_irq++; /* * Don't assign IRQ used by ACPI SCI diff --git a/trunk/arch/ia64/lib/memcpy_mck.S b/trunk/arch/ia64/lib/memcpy_mck.S index 9e534d52b1d5..46c9331e7ab5 100644 --- a/trunk/arch/ia64/lib/memcpy_mck.S +++ b/trunk/arch/ia64/lib/memcpy_mck.S @@ -6,9 +6,7 @@ * in1: source address * in2: number of bytes to copy * Output: - * for memcpy: return dest - * for copy_user: return 0 if success, - * or number of byte NOT copied if error occurred. + * 0 if success, or number of byte NOT copied if error occurred. * * Copyright (C) 2002 Intel Corp. * Copyright (C) 2002 Ken Chen @@ -75,7 +73,6 @@ GLOBAL_ENTRY(memcpy) and r28=0x7,in0 and r29=0x7,in1 mov f6=f0 - mov retval=in0 br.cond.sptk .common_code ;; END(memcpy) @@ -87,7 +84,7 @@ GLOBAL_ENTRY(__copy_user) mov f6=f1 mov saved_in0=in0 // save dest pointer mov saved_in1=in1 // save src pointer - mov retval=r0 // initialize return value + mov saved_in2=in2 // save len ;; .common_code: cmp.gt p15,p0=8,in2 // check for small size @@ -95,7 +92,7 @@ GLOBAL_ENTRY(__copy_user) cmp.ne p14,p0=0,r29 // check src alignment add src0=0,in1 sub r30=8,r28 // for .align_dest - mov saved_in2=in2 // save len + mov retval=r0 // initialize return value ;; add dst0=0,in0 add dst1=1,in0 // dest odd index diff --git a/trunk/arch/x86_64/kernel/e820.c b/trunk/arch/x86_64/kernel/e820.c index 222b5b46d2b2..62776c07cff1 100644 --- a/trunk/arch/x86_64/kernel/e820.c +++ b/trunk/arch/x86_64/kernel/e820.c @@ -76,12 +76,6 @@ static inline int bad_addr(unsigned long *addrp, unsigned long size) *addrp = __pa_symbol(&_end); return 1; } - - if (last >= ebda_addr && addr < ebda_addr + ebda_size) { - *addrp = ebda_addr + ebda_size; - return 1; - } - /* XXX ramdisk image here? */ return 0; } diff --git a/trunk/arch/x86_64/kernel/io_apic.c b/trunk/arch/x86_64/kernel/io_apic.c index 0de3ea938830..77b4c608cca0 100644 --- a/trunk/arch/x86_64/kernel/io_apic.c +++ b/trunk/arch/x86_64/kernel/io_apic.c @@ -1777,8 +1777,6 @@ static inline void unlock_ExtINT_logic(void) spin_unlock_irqrestore(&ioapic_lock, flags); } -int timer_uses_ioapic_pin_0; - /* * This code may look a bit paranoid, but it's supposed to cooperate with * a wide range of boards and BIOS bugs. Fortunately only the timer IRQ @@ -1816,9 +1814,6 @@ static inline void check_timer(void) pin2 = ioapic_i8259.pin; apic2 = ioapic_i8259.apic; - if (pin1 == 0) - timer_uses_ioapic_pin_0 = 1; - apic_printk(APIC_VERBOSE,KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n", vector, apic1, pin1, apic2, pin2); diff --git a/trunk/arch/x86_64/kernel/mpparse.c b/trunk/arch/x86_64/kernel/mpparse.c index 083da7e606b1..b17cf3eba359 100644 --- a/trunk/arch/x86_64/kernel/mpparse.c +++ b/trunk/arch/x86_64/kernel/mpparse.c @@ -968,17 +968,7 @@ int mp_register_gsi(u32 gsi, int triggering, int polarity) */ int irq = gsi; if (gsi < MAX_GSI_NUM) { - /* - * Retain the VIA chipset work-around (gsi > 15), but - * avoid a problem where the 8254 timer (IRQ0) is setup - * via an override (so it's not on pin 0 of the ioapic), - * and at the same time, the pin 0 interrupt is a PCI - * type. The gsi > 15 test could cause these two pins - * to be shared as IRQ0, and they are not shareable. - * So test for this condition, and if necessary, avoid - * the pin collision. - */ - if (gsi > 15 || (gsi == 0 && !timer_uses_ioapic_pin_0)) + if (gsi > 15) gsi = pci_irq++; /* * Don't assign IRQ used by ACPI SCI diff --git a/trunk/arch/x86_64/kernel/pci-gart.c b/trunk/arch/x86_64/kernel/pci-gart.c index 2480d3f08a47..9d3d76c85ae7 100644 --- a/trunk/arch/x86_64/kernel/pci-gart.c +++ b/trunk/arch/x86_64/kernel/pci-gart.c @@ -639,14 +639,6 @@ static int __init pci_iommu_init(void) return -1; } - i = 0; - for_all_nb(dev) - i++; - if (i > MAX_NB) { - printk(KERN_ERR "PCI-GART: Too many northbridges (%ld). Disabled\n", i); - return -1; - } - printk(KERN_INFO "PCI-DMA: using GART IOMMU.\n"); aper_size = info.aper_size * 1024 * 1024; iommu_size = check_iommu_size(info.aper_base, aper_size); diff --git a/trunk/arch/x86_64/kernel/setup.c b/trunk/arch/x86_64/kernel/setup.c index f0870bef24d1..ebc3c33b1c6c 100644 --- a/trunk/arch/x86_64/kernel/setup.c +++ b/trunk/arch/x86_64/kernel/setup.c @@ -571,28 +571,17 @@ static inline void copy_edd(void) #endif #define EBDA_ADDR_POINTER 0x40E - -unsigned __initdata ebda_addr; -unsigned __initdata ebda_size; - -static void discover_ebda(void) +static void __init reserve_ebda_region(void) { - /* + unsigned int addr; + /** * there is a real-mode segmented pointer pointing to the * 4K EBDA area at 0x40E */ - ebda_addr = *(unsigned short *)EBDA_ADDR_POINTER; - ebda_addr <<= 4; - - ebda_size = *(unsigned short *)(unsigned long)ebda_addr; - - /* Round EBDA up to pages */ - if (ebda_size == 0) - ebda_size = 1; - ebda_size <<= 10; - ebda_size = round_up(ebda_size + (ebda_addr & ~PAGE_MASK), PAGE_SIZE); - if (ebda_size > 64*1024) - ebda_size = 64*1024; + addr = *(unsigned short *)phys_to_virt(EBDA_ADDR_POINTER); + addr <<= 4; + if (addr) + reserve_bootmem_generic(addr, PAGE_SIZE); } void __init setup_arch(char **cmdline_p) @@ -638,8 +627,6 @@ void __init setup_arch(char **cmdline_p) check_efer(); - discover_ebda(); - init_memory_mapping(0, (end_pfn_map << PAGE_SHIFT)); dmi_scan_machine(); @@ -682,8 +669,7 @@ void __init setup_arch(char **cmdline_p) reserve_bootmem_generic(0, PAGE_SIZE); /* reserve ebda region */ - if (ebda_addr) - reserve_bootmem_generic(ebda_addr, ebda_size); + reserve_ebda_region(); #ifdef CONFIG_SMP /* diff --git a/trunk/arch/x86_64/kernel/traps.c b/trunk/arch/x86_64/kernel/traps.c index 6b87268c5c2e..2700b1375c1f 100644 --- a/trunk/arch/x86_64/kernel/traps.c +++ b/trunk/arch/x86_64/kernel/traps.c @@ -385,7 +385,6 @@ void out_of_line_bug(void) static DEFINE_SPINLOCK(die_lock); static int die_owner = -1; -static unsigned int die_nest_count; unsigned __kprobes long oops_begin(void) { @@ -400,7 +399,6 @@ unsigned __kprobes long oops_begin(void) else spin_lock(&die_lock); } - die_nest_count++; die_owner = cpu; console_verbose(); bust_spinlocks(1); @@ -411,13 +409,7 @@ void __kprobes oops_end(unsigned long flags) { die_owner = -1; bust_spinlocks(0); - die_nest_count--; - if (die_nest_count) - /* We still own the lock */ - local_irq_restore(flags); - else - /* Nest count reaches zero, release the lock. */ - spin_unlock_irqrestore(&die_lock, flags); + spin_unlock_irqrestore(&die_lock, flags); if (panic_on_oops) panic("Oops"); } @@ -472,8 +464,6 @@ void __kprobes die_nmi(char *str, struct pt_regs *regs) panic("nmi watchdog"); printk("console shuts up ...\n"); oops_end(flags); - nmi_exit(); - local_irq_enable(); do_exit(SIGSEGV); } diff --git a/trunk/drivers/base/class.c b/trunk/drivers/base/class.c index b1ea4df85c7d..0e71dff327cd 100644 --- a/trunk/drivers/base/class.c +++ b/trunk/drivers/base/class.c @@ -456,35 +456,6 @@ static void class_device_remove_attrs(struct class_device * cd) } } -static int class_device_add_groups(struct class_device * cd) -{ - int i; - int error = 0; - - if (cd->groups) { - for (i = 0; cd->groups[i]; i++) { - error = sysfs_create_group(&cd->kobj, cd->groups[i]); - if (error) { - while (--i >= 0) - sysfs_remove_group(&cd->kobj, cd->groups[i]); - goto out; - } - } - } -out: - return error; -} - -static void class_device_remove_groups(struct class_device * cd) -{ - int i; - if (cd->groups) { - for (i = 0; cd->groups[i]; i++) { - sysfs_remove_group(&cd->kobj, cd->groups[i]); - } - } -} - static ssize_t show_dev(struct class_device *class_dev, char *buf) { return print_dev_t(buf, class_dev->devt); @@ -588,8 +559,6 @@ int class_device_add(struct class_device *class_dev) class_name); } - class_device_add_groups(class_dev); - kobject_uevent(&class_dev->kobj, KOBJ_ADD); /* notify any interfaces this device is now here */ @@ -703,7 +672,6 @@ void class_device_del(struct class_device *class_dev) if (class_dev->devt_attr) class_device_remove_file(class_dev, class_dev->devt_attr); class_device_remove_attrs(class_dev); - class_device_remove_groups(class_dev); kobject_uevent(&class_dev->kobj, KOBJ_REMOVE); kobject_del(&class_dev->kobj); diff --git a/trunk/drivers/cpufreq/cpufreq_ondemand.c b/trunk/drivers/cpufreq/cpufreq_ondemand.c index 3e6ffcaa5af4..956d121cb161 100644 --- a/trunk/drivers/cpufreq/cpufreq_ondemand.c +++ b/trunk/drivers/cpufreq/cpufreq_ondemand.c @@ -74,8 +74,6 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */ static DEFINE_MUTEX (dbs_mutex); static DECLARE_WORK (dbs_work, do_dbs_timer, NULL); -static struct workqueue_struct *dbs_workq; - struct dbs_tuners { unsigned int sampling_rate; unsigned int sampling_down_factor; @@ -366,29 +364,23 @@ static void do_dbs_timer(void *data) mutex_lock(&dbs_mutex); for_each_online_cpu(i) dbs_check_cpu(i); - queue_delayed_work(dbs_workq, &dbs_work, - usecs_to_jiffies(dbs_tuners_ins.sampling_rate)); + schedule_delayed_work(&dbs_work, + usecs_to_jiffies(dbs_tuners_ins.sampling_rate)); mutex_unlock(&dbs_mutex); } static inline void dbs_timer_init(void) { INIT_WORK(&dbs_work, do_dbs_timer, NULL); - if (!dbs_workq) - dbs_workq = create_singlethread_workqueue("ondemand"); - if (!dbs_workq) { - printk(KERN_ERR "ondemand: Cannot initialize kernel thread\n"); - return; - } - queue_delayed_work(dbs_workq, &dbs_work, - usecs_to_jiffies(dbs_tuners_ins.sampling_rate)); + schedule_delayed_work(&dbs_work, + usecs_to_jiffies(dbs_tuners_ins.sampling_rate)); return; } static inline void dbs_timer_exit(void) { - if (dbs_workq) - cancel_rearming_delayed_workqueue(dbs_workq, &dbs_work); + cancel_delayed_work(&dbs_work); + return; } static int cpufreq_governor_dbs(struct cpufreq_policy *policy, @@ -497,12 +489,8 @@ static int __init cpufreq_gov_dbs_init(void) static void __exit cpufreq_gov_dbs_exit(void) { - /* Make sure that the scheduled work is indeed not running. - Assumes the timer has been cancelled first. */ - if (dbs_workq) { - flush_workqueue(dbs_workq); - destroy_workqueue(dbs_workq); - } + /* Make sure that the scheduled work is indeed not running */ + flush_scheduled_work(); cpufreq_unregister_governor(&cpufreq_gov_dbs); } diff --git a/trunk/drivers/net/irda/irda-usb.c b/trunk/drivers/net/irda/irda-usb.c index cd87593e4e8a..96bdb73c2283 100644 --- a/trunk/drivers/net/irda/irda-usb.c +++ b/trunk/drivers/net/irda/irda-usb.c @@ -1778,7 +1778,7 @@ static int irda_usb_probe(struct usb_interface *intf, if (self->needspatch) { ret = usb_control_msg (self->usbdev, usb_sndctrlpipe (self->usbdev, 0), - 0x02, 0x40, 0, 0, NULL, 0, 500); + 0x02, 0x40, 0, 0, 0, 0, msecs_to_jiffies(500)); if (ret < 0) { IRDA_DEBUG (0, "usb_control_msg failed %d\n", ret); goto err_out_3; diff --git a/trunk/drivers/video/logo/Makefile b/trunk/drivers/video/logo/Makefile index b985dfad6c63..4ef5cd19609d 100644 --- a/trunk/drivers/video/logo/Makefile +++ b/trunk/drivers/video/logo/Makefile @@ -34,7 +34,7 @@ extra-y += $(call logo-cfiles,_clut224,ppm) extra-y += $(call logo-cfiles,_gray256,pgm) # Create commands like "pnmtologo -t mono -n logo_mac_mono -o ..." -quiet_cmd_logo = LOGO $@ +quiet_cmd_logo = LOGO $@ cmd_logo = scripts/pnmtologo \ -t $(patsubst $*_%,%,$(notdir $(basename $<))) \ -n $(notdir $(basename $<)) -o $@ $< diff --git a/trunk/fs/locks.c b/trunk/fs/locks.c index 6f99c0a6f836..efad798824dc 100644 --- a/trunk/fs/locks.c +++ b/trunk/fs/locks.c @@ -446,14 +446,15 @@ static struct lock_manager_operations lease_manager_ops = { */ static int lease_init(struct file *filp, int type, struct file_lock *fl) { - if (assign_type(fl, type) != 0) - return -EINVAL; - fl->fl_owner = current->files; fl->fl_pid = current->tgid; fl->fl_file = filp; fl->fl_flags = FL_LEASE; + if (assign_type(fl, type) != 0) { + locks_free_lock(fl); + return -EINVAL; + } fl->fl_start = 0; fl->fl_end = OFFSET_MAX; fl->fl_ops = NULL; @@ -465,19 +466,16 @@ static int lease_init(struct file *filp, int type, struct file_lock *fl) static int lease_alloc(struct file *filp, int type, struct file_lock **flp) { struct file_lock *fl = locks_alloc_lock(); - int error = -ENOMEM; + int error; if (fl == NULL) - goto out; + return -ENOMEM; error = lease_init(filp, type, fl); - if (error) { - locks_free_lock(fl); - fl = NULL; - } -out: + if (error) + return error; *flp = fl; - return error; + return 0; } /* Check if two locks overlap each other. @@ -1374,7 +1372,6 @@ static int __setlease(struct file *filp, long arg, struct file_lock **flp) goto out; if (my_before != NULL) { - *flp = *my_before; error = lease->fl_lmops->fl_change(my_before, arg); goto out; } diff --git a/trunk/fs/xfs/xfs_vfsops.c b/trunk/fs/xfs/xfs_vfsops.c index f0e09ca14139..36ea1b2094f2 100644 --- a/trunk/fs/xfs/xfs_vfsops.c +++ b/trunk/fs/xfs/xfs_vfsops.c @@ -669,31 +669,22 @@ xfs_mntupdate( xfs_mount_t *mp = XFS_BHVTOM(bdp); int error; - if (args->flags & XFSMNT_BARRIER) - mp->m_flags |= XFS_MOUNT_BARRIER; - else - mp->m_flags &= ~XFS_MOUNT_BARRIER; - - if ((vfsp->vfs_flag & VFS_RDONLY) && - !(*flags & MS_RDONLY)) { - vfsp->vfs_flag &= ~VFS_RDONLY; - - if (args->flags & XFSMNT_BARRIER) + if (!(*flags & MS_RDONLY)) { /* rw/ro -> rw */ + if (vfsp->vfs_flag & VFS_RDONLY) + vfsp->vfs_flag &= ~VFS_RDONLY; + if (args->flags & XFSMNT_BARRIER) { + mp->m_flags |= XFS_MOUNT_BARRIER; xfs_mountfs_check_barriers(mp); - } - - if (!(vfsp->vfs_flag & VFS_RDONLY) && - (*flags & MS_RDONLY)) { + } else { + mp->m_flags &= ~XFS_MOUNT_BARRIER; + } + } else if (!(vfsp->vfs_flag & VFS_RDONLY)) { /* rw -> ro */ VFS_SYNC(vfsp, SYNC_FSDATA|SYNC_BDFLUSH|SYNC_ATTR, NULL, error); - xfs_quiesce_fs(mp); - - /* Ok now write out an unmount record */ xfs_log_unmount_write(mp); xfs_unmountfs_writesb(mp); vfsp->vfs_flag |= VFS_RDONLY; } - return 0; } diff --git a/trunk/include/asm-i386/io_apic.h b/trunk/include/asm-i386/io_apic.h index d92e253f7f6f..51c4e5fe6062 100644 --- a/trunk/include/asm-i386/io_apic.h +++ b/trunk/include/asm-i386/io_apic.h @@ -200,7 +200,6 @@ extern int io_apic_get_unique_id (int ioapic, int apic_id); extern int io_apic_get_version (int ioapic); extern int io_apic_get_redir_entries (int ioapic); extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low); -extern int timer_uses_ioapic_pin_0; #endif /* CONFIG_ACPI */ extern int (*ioapic_renumber_irq)(int ioapic, int irq); diff --git a/trunk/include/asm-ia64/bitops.h b/trunk/include/asm-ia64/bitops.h index 6cc517e212a9..90921e162793 100644 --- a/trunk/include/asm-ia64/bitops.h +++ b/trunk/include/asm-ia64/bitops.h @@ -11,6 +11,7 @@ #include #include +#include #include /** diff --git a/trunk/include/asm-x86_64/e820.h b/trunk/include/asm-x86_64/e820.h index 670a3388e70a..93b51df51687 100644 --- a/trunk/include/asm-x86_64/e820.h +++ b/trunk/include/asm-x86_64/e820.h @@ -59,8 +59,6 @@ extern void __init parse_memopt(char *p, char **end); extern void __init parse_memmapopt(char *p, char **end); extern struct e820map e820; - -extern unsigned ebda_addr, ebda_size; #endif/*!__ASSEMBLY__*/ #endif/*__E820_HEADER*/ diff --git a/trunk/include/asm-x86_64/io_apic.h b/trunk/include/asm-x86_64/io_apic.h index 52484e82c641..ee1bc69aec9c 100644 --- a/trunk/include/asm-x86_64/io_apic.h +++ b/trunk/include/asm-x86_64/io_apic.h @@ -205,7 +205,6 @@ extern int skip_ioapic_setup; extern int io_apic_get_version (int ioapic); extern int io_apic_get_redir_entries (int ioapic); extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int); -extern int timer_uses_ioapic_pin_0; #endif extern int sis_apic_bug; /* dummy */ diff --git a/trunk/include/linux/device.h b/trunk/include/linux/device.h index e8e53b9accc6..f6e72a65a3f2 100644 --- a/trunk/include/linux/device.h +++ b/trunk/include/linux/device.h @@ -200,7 +200,6 @@ extern int class_device_create_file(struct class_device *, * @node: for internal use by the driver core only. * @kobj: for internal use by the driver core only. * @devt_attr: for internal use by the driver core only. - * @groups: optional additional groups to be created * @dev: if set, a symlink to the struct device is created in the sysfs * directory for this struct class device. * @class_data: pointer to whatever you want to store here for this struct @@ -229,7 +228,6 @@ struct class_device { struct device * dev; /* not necessary, but nice to have */ void * class_data; /* class-specific data */ struct class_device *parent; /* parent of this child device, if there is one */ - struct attribute_group ** groups; /* optional groups */ void (*release)(struct class_device *dev); int (*uevent)(struct class_device *dev, char **envp, diff --git a/trunk/include/linux/netdevice.h b/trunk/include/linux/netdevice.h index 309f9190a922..01db7b88a2b1 100644 --- a/trunk/include/linux/netdevice.h +++ b/trunk/include/linux/netdevice.h @@ -506,8 +506,6 @@ struct net_device /* class/net/name entry */ struct class_device class_dev; - /* space for optional statistics and wireless sysfs groups */ - struct attribute_group *sysfs_groups[3]; }; #define NETDEV_ALIGN 32 diff --git a/trunk/net/core/dev.c b/trunk/net/core/dev.c index 9ab3cfa58466..3bad1afc89fa 100644 --- a/trunk/net/core/dev.c +++ b/trunk/net/core/dev.c @@ -3043,11 +3043,11 @@ void netdev_run_todo(void) switch(dev->reg_state) { case NETREG_REGISTERING: + dev->reg_state = NETREG_REGISTERED; err = netdev_register_sysfs(dev); if (err) printk(KERN_ERR "%s: failed sysfs registration (%d)\n", dev->name, err); - dev->reg_state = NETREG_REGISTERED; break; case NETREG_UNREGISTERING: diff --git a/trunk/net/core/net-sysfs.c b/trunk/net/core/net-sysfs.c index 47a6fceb6771..c12990c9c603 100644 --- a/trunk/net/core/net-sysfs.c +++ b/trunk/net/core/net-sysfs.c @@ -29,7 +29,7 @@ static const char fmt_ulong[] = "%lu\n"; static inline int dev_isalive(const struct net_device *dev) { - return dev->reg_state <= NETREG_REGISTERED; + return dev->reg_state == NETREG_REGISTERED; } /* use same locking rules as GIF* ioctl's */ @@ -445,33 +445,58 @@ static struct class net_class = { void netdev_unregister_sysfs(struct net_device * net) { - class_device_del(&(net->class_dev)); + struct class_device * class_dev = &(net->class_dev); + + if (net->get_stats) + sysfs_remove_group(&class_dev->kobj, &netstat_group); + +#ifdef WIRELESS_EXT + if (net->get_wireless_stats || (net->wireless_handlers && + net->wireless_handlers->get_wireless_stats)) + sysfs_remove_group(&class_dev->kobj, &wireless_group); +#endif + class_device_del(class_dev); + } /* Create sysfs entries for network device. */ int netdev_register_sysfs(struct net_device *net) { struct class_device *class_dev = &(net->class_dev); - struct attribute_group **groups = net->sysfs_groups; + int ret; - class_device_initialize(class_dev); class_dev->class = &net_class; class_dev->class_data = net; - class_dev->groups = groups; - BUILD_BUG_ON(BUS_ID_SIZE < IFNAMSIZ); strlcpy(class_dev->class_id, net->name, BUS_ID_SIZE); + if ((ret = class_device_register(class_dev))) + goto out; - if (net->get_stats) - *groups++ = &netstat_group; + if (net->get_stats && + (ret = sysfs_create_group(&class_dev->kobj, &netstat_group))) + goto out_unreg; #ifdef WIRELESS_EXT - if (net->get_wireless_stats - || (net->wireless_handlers && net->wireless_handlers->get_wireless_stats)) - *groups++ = &wireless_group; + if (net->get_wireless_stats || (net->wireless_handlers && + net->wireless_handlers->get_wireless_stats)) { + ret = sysfs_create_group(&class_dev->kobj, &wireless_group); + if (ret) + goto out_cleanup; + } + return 0; +out_cleanup: + if (net->get_stats) + sysfs_remove_group(&class_dev->kobj, &netstat_group); +#else + return 0; #endif - return class_device_add(class_dev); +out_unreg: + printk(KERN_WARNING "%s: sysfs attribute registration failed %d\n", + net->name, ret); + class_device_unregister(class_dev); +out: + return ret; } int netdev_sysfs_init(void) diff --git a/trunk/net/ipv4/ip_input.c b/trunk/net/ipv4/ip_input.c index c9026dbf4c93..18d7fad474d7 100644 --- a/trunk/net/ipv4/ip_input.c +++ b/trunk/net/ipv4/ip_input.c @@ -337,7 +337,7 @@ static inline int ip_rcv_finish(struct sk_buff *skb) * Initialise the virtual path cache for the packet. It describes * how the packet travels inside Linux networking. */ - if (skb->dst == NULL) { + if (likely(skb->dst == NULL)) { int err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, skb->dev); if (unlikely(err)) { diff --git a/trunk/scripts/gen_initramfs_list.sh b/trunk/scripts/gen_initramfs_list.sh index 331c079f029b..56b3bed1108f 100644 --- a/trunk/scripts/gen_initramfs_list.sh +++ b/trunk/scripts/gen_initramfs_list.sh @@ -200,11 +200,7 @@ input_file() { print_mtime "$1" >> ${output} cat "$1" >> ${output} else - cat "$1" | while read type dir file perm ; do - if [ "$type" == "file" ]; then - echo "$file \\"; - fi - done + grep ^file "$1" | cut -d ' ' -f 3 fi elif [ -d "$1" ]; then dir_filelist "$1" diff --git a/trunk/scripts/mkmakefile b/trunk/scripts/mkmakefile index 7f9d544f9b6c..a22cbedd3b3e 100644 --- a/trunk/scripts/mkmakefile +++ b/trunk/scripts/mkmakefile @@ -10,10 +10,7 @@ # $4 - patchlevel -test ! -r $2/Makefile -o -O $2/Makefile || exit 0 -echo " GEN $2/Makefile" - -cat << EOF > $2/Makefile +cat << EOF # Automatically generated by $0: don't edit VERSION = $3 diff --git a/trunk/scripts/mod/modpost.c b/trunk/scripts/mod/modpost.c index 6d04504b2fc1..cd00e9f07589 100644 --- a/trunk/scripts/mod/modpost.c +++ b/trunk/scripts/mod/modpost.c @@ -487,14 +487,14 @@ static int strrcmp(const char *s, const char *sub) * atsym =__param* * * Pattern 2: - * Many drivers utilise a *driver container with references to + * Many drivers utilise a *_driver container with references to * add, remove, probe functions etc. * These functions may often be marked __init and we do not want to * warn here. * the pattern is identified by: * tosec = .init.text | .exit.text | .init.data * fromsec = .data - * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one + * atsym = *_driver, *_template, *_sht, *_ops, *_probe, *probe_one **/ static int secref_whitelist(const char *tosec, const char *fromsec, const char *atsym) @@ -502,7 +502,7 @@ static int secref_whitelist(const char *tosec, const char *fromsec, int f1 = 1, f2 = 1; const char **s; const char *pat2sym[] = { - "driver", + "_driver", "_template", /* scsi uses *_template a lot */ "_sht", /* scsi also used *_sht to some extent */ "_ops",