diff --git a/[refs] b/[refs] index c2a415741018..58ec7ca11c3a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bed7a560333d40269a886c4421d4c8f964a32177 +refs/heads/master: 1498221d51a43d5fa1a580618591497d90f957d9 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/arm/mach-aaec2000/aaed2000.c b/trunk/arch/arm/mach-aaec2000/aaed2000.c index 83f57da3184c..dc5fa8e5ebef 100644 --- a/trunk/arch/arm/mach-aaec2000/aaed2000.c +++ b/trunk/arch/arm/mach-aaec2000/aaed2000.c @@ -79,12 +79,7 @@ static void __init aaed2000_init(void) } static struct map_desc aaed2000_io_desc[] __initdata = { - { - .virtual = EXT_GPIO_VBASE, - .pfn = __phys_to_pfn(EXT_GPIO_PBASE), - .length = EXT_GPIO_LENGTH, - .type = MT_DEVICE - }, + { EXT_GPIO_VBASE, EXT_GPIO_PBASE, EXT_GPIO_LENGTH, MT_DEVICE }, /* Ext GPIO */ }; static void __init aaed2000_map_io(void) diff --git a/trunk/arch/arm/mach-aaec2000/core.c b/trunk/arch/arm/mach-aaec2000/core.c index 65be5efd633c..dce4815cf53c 100644 --- a/trunk/arch/arm/mach-aaec2000/core.c +++ b/trunk/arch/arm/mach-aaec2000/core.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -49,12 +50,12 @@ static struct map_desc standard_io_desc[] __initdata = { { .virtual = VIO_APB_BASE, - .pfn = __phys_to_pfn(PIO_APB_BASE), + .physical = __phys_to_pfn(PIO_APB_BASE), .length = IO_APB_LENGTH, .type = MT_DEVICE }, { .virtual = VIO_AHB_BASE, - .pfn = __phys_to_pfn(PIO_AHB_BASE), + .physical = __phys_to_pfn(PIO_AHB_BASE), .length = IO_AHB_LENGTH, .type = MT_DEVICE } diff --git a/trunk/arch/arm/mach-aaec2000/core.h b/trunk/arch/arm/mach-aaec2000/core.h index 59501b573167..b6029a95f19c 100644 --- a/trunk/arch/arm/mach-aaec2000/core.h +++ b/trunk/arch/arm/mach-aaec2000/core.h @@ -9,7 +9,6 @@ * */ -#include #include struct sys_timer; diff --git a/trunk/arch/arm/mach-imx/mx1ads.c b/trunk/arch/arm/mach-imx/mx1ads.c index da893c80d471..e1f6c0bbe1e7 100644 --- a/trunk/arch/arm/mach-imx/mx1ads.c +++ b/trunk/arch/arm/mach-imx/mx1ads.c @@ -161,7 +161,7 @@ mx1ads_map_io(void) MACHINE_START(MX1ADS, "Motorola MX1ADS") /* Maintainer: Sascha Hauer, Pengutronix */ .phys_io = 0x00200000, - .io_pg_offst = ((0xe0000000) >> 18) & 0xfffc, + .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc, .boot_params = 0x08000100, .map_io = mx1ads_map_io, .init_irq = imx_init_irq, diff --git a/trunk/arch/arm/mach-sa1100/irq.c b/trunk/arch/arm/mach-sa1100/irq.c index b3a56024182e..c131a5201b5b 100644 --- a/trunk/arch/arm/mach-sa1100/irq.c +++ b/trunk/arch/arm/mach-sa1100/irq.c @@ -199,26 +199,10 @@ static void sa1100_unmask_irq(unsigned int irq) ICMR |= (1 << irq); } -/* - * Apart form GPIOs, only the RTC alarm can be a wakeup event. - */ -static int sa1100_set_wake(unsigned int irq, unsigned int on) -{ - if (irq == IRQ_RTCAlrm) { - if (on) - PWER |= PWER_RTC; - else - PWER &= ~PWER_RTC; - return 0; - } - return -EINVAL; -} - static struct irqchip sa1100_normal_chip = { .ack = sa1100_mask_irq, .mask = sa1100_mask_irq, .unmask = sa1100_unmask_irq, - .set_wake = sa1100_set_wake, }; static struct resource irq_resource = { diff --git a/trunk/drivers/base/class.c b/trunk/drivers/base/class.c index 0e71dff327cd..b1ea4df85c7d 100644 --- a/trunk/drivers/base/class.c +++ b/trunk/drivers/base/class.c @@ -456,6 +456,35 @@ 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); @@ -559,6 +588,8 @@ 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 */ @@ -672,6 +703,7 @@ 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/rtc/rtc-sa1100.c b/trunk/drivers/rtc/rtc-sa1100.c index 2bc8aad47219..a23ec54989f6 100644 --- a/trunk/drivers/rtc/rtc-sa1100.c +++ b/trunk/drivers/rtc/rtc-sa1100.c @@ -178,9 +178,9 @@ static int sa1100_rtc_open(struct device *dev) return 0; fail_pi: - free_irq(IRQ_RTCAlrm, dev); + free_irq(IRQ_RTCAlrm, NULL); fail_ai: - free_irq(IRQ_RTC1Hz, dev); + free_irq(IRQ_RTC1Hz, NULL); fail_ui: return ret; } @@ -295,7 +295,7 @@ static int sa1100_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) static int sa1100_rtc_proc(struct device *dev, struct seq_file *seq) { - seq_printf(seq, "trim/divider\t: 0x%08lx\n", RTTR); + seq_printf(seq, "trim/divider\t: 0x%08x\n", RTTR); seq_printf(seq, "alarm_IRQ\t: %s\n", (RTSR & RTSR_ALE) ? "yes" : "no" ); seq_printf(seq, "update_IRQ\t: %s\n", 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/include/asm-arm/arch-aaec2000/debug-macro.S b/trunk/include/asm-arm/arch-aaec2000/debug-macro.S index 7b1fce021d8a..e4f1fa539a74 100644 --- a/trunk/include/asm-arm/arch-aaec2000/debug-macro.S +++ b/trunk/include/asm-arm/arch-aaec2000/debug-macro.S @@ -9,7 +9,6 @@ * published by the Free Software Foundation. */ -#include "hardware.h" .macro addruart,rx mrc p15, 0, \rx, c1, c0 tst \rx, #1 @ MMU enabled? diff --git a/trunk/include/asm-arm/arch-aaec2000/entry-macro.S b/trunk/include/asm-arm/arch-aaec2000/entry-macro.S index 1eb3503bd16e..df31313ab07e 100644 --- a/trunk/include/asm-arm/arch-aaec2000/entry-macro.S +++ b/trunk/include/asm-arm/arch-aaec2000/entry-macro.S @@ -10,7 +10,6 @@ * published by the Free Software Foundation. * */ -#include .macro disable_fiq .endm diff --git a/trunk/include/asm-arm/arch-imx/debug-macro.S b/trunk/include/asm-arm/arch-imx/debug-macro.S index c611871643a2..83f552f7bcc1 100644 --- a/trunk/include/asm-arm/arch-imx/debug-macro.S +++ b/trunk/include/asm-arm/arch-imx/debug-macro.S @@ -16,7 +16,7 @@ tst \rx, #1 @ MMU enabled? moveq \rx, #0x00000000 @ physical movne \rx, #0xe0000000 @ virtual - orreq \rx, \rx, #0x00200000 @ physical + orr \rx, \rx, #0x00200000 orr \rx, \rx, #0x00006000 @ UART1 offset .endm diff --git a/trunk/include/linux/device.h b/trunk/include/linux/device.h index f6e72a65a3f2..e8e53b9accc6 100644 --- a/trunk/include/linux/device.h +++ b/trunk/include/linux/device.h @@ -200,6 +200,7 @@ 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 @@ -228,6 +229,7 @@ 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/kernel/ptrace.c b/trunk/kernel/ptrace.c index b0f8da80d7d4..4e0f0ec003f7 100644 --- a/trunk/kernel/ptrace.c +++ b/trunk/kernel/ptrace.c @@ -148,16 +148,12 @@ int ptrace_may_attach(struct task_struct *task) int ptrace_attach(struct task_struct *task) { int retval; - + task_lock(task); retval = -EPERM; if (task->pid <= 1) - goto out; + goto bad; if (task->tgid == current->tgid) - goto out; - - write_lock_irq(&tasklist_lock); - task_lock(task); - + goto bad; /* the same process cannot be attached many times */ if (task->ptrace & PT_PTRACED) goto bad; @@ -170,15 +166,17 @@ int ptrace_attach(struct task_struct *task) ? PT_ATTACHED : 0); if (capable(CAP_SYS_PTRACE)) task->ptrace |= PT_PTRACE_CAP; + task_unlock(task); + write_lock_irq(&tasklist_lock); __ptrace_link(task, current); + write_unlock_irq(&tasklist_lock); force_sig_specific(SIGSTOP, task); + return 0; bad: - write_unlock_irq(&tasklist_lock); task_unlock(task); -out: return retval; } @@ -419,22 +417,21 @@ int ptrace_request(struct task_struct *child, long request, */ int ptrace_traceme(void) { - int ret = -EPERM; + int ret; /* * Are we already being traced? */ - task_lock(current); - if (!(current->ptrace & PT_PTRACED)) { - ret = security_ptrace(current->parent, current); - /* - * Set the ptrace bit in the process ptrace flags. - */ - if (!ret) - current->ptrace |= PT_PTRACED; - } - task_unlock(current); - return ret; + if (current->ptrace & PT_PTRACED) + return -EPERM; + ret = security_ptrace(current->parent, current); + if (ret) + return -EPERM; + /* + * Set the ptrace bit in the process ptrace flags. + */ + current->ptrace |= PT_PTRACED; + return 0; } /** 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 b36e884f5f96..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", @@ -709,17 +709,10 @@ static void check_sec_ref(struct module *mod, const char *modname, for (rela = start; rela < stop; rela++) { Elf_Rela r; const char *secname; - unsigned int r_sym; r.r_offset = TO_NATIVE(rela->r_offset); - if (hdr->e_ident[EI_CLASS] == ELFCLASS64 && - hdr->e_machine == EM_MIPS) { - r_sym = ELF64_MIPS_R_SYM(rela->r_info); - r_sym = TO_NATIVE(r_sym); - } else { - r_sym = ELF_R_SYM(TO_NATIVE(rela->r_info)); - } + r.r_info = TO_NATIVE(rela->r_info); r.r_addend = TO_NATIVE(rela->r_addend); - sym = elf->symtab_start + r_sym; + sym = elf->symtab_start + ELF_R_SYM(r.r_info); /* Skip special sections */ if (sym->st_shndx >= SHN_LORESERVE) continue; diff --git a/trunk/scripts/mod/modpost.h b/trunk/scripts/mod/modpost.h index 89b96c6d8ef5..b14255c72a37 100644 --- a/trunk/scripts/mod/modpost.h +++ b/trunk/scripts/mod/modpost.h @@ -39,25 +39,6 @@ #define ELF_R_TYPE ELF64_R_TYPE #endif -/* The 64-bit MIPS ELF ABI uses an unusual reloc format. */ -typedef struct -{ - Elf32_Word r_sym; /* Symbol index */ - unsigned char r_ssym; /* Special symbol for 2nd relocation */ - unsigned char r_type3; /* 3rd relocation type */ - unsigned char r_type2; /* 2nd relocation type */ - unsigned char r_type1; /* 1st relocation type */ -} _Elf64_Mips_R_Info; - -typedef union -{ - Elf64_Xword r_info_number; - _Elf64_Mips_R_Info r_info_fields; -} _Elf64_Mips_R_Info_union; - -#define ELF64_MIPS_R_SYM(i) \ - ((__extension__ (_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_sym) - #if KERNEL_ELFDATA != HOST_ELFDATA static inline void __endian(const void *src, void *dest, unsigned int size)