diff --git a/[refs] b/[refs] index 5f949ec5c1bd..0ea5971d5d0c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 923f79743c76583ed4684e2c80c8da51a7268af3 +refs/heads/master: bde4d8b205bc3ccdf7f5a841bfbfa9896b44b1ce diff --git a/trunk/Documentation/feature-removal-schedule.txt b/trunk/Documentation/feature-removal-schedule.txt index c1be8066ea59..0cad4803ffac 100644 --- a/trunk/Documentation/feature-removal-schedule.txt +++ b/trunk/Documentation/feature-removal-schedule.txt @@ -529,13 +529,3 @@ When: 3.5 Why: The old kmap_atomic() with two arguments is deprecated, we only keep it for backward compatibility for few cycles and then drop it. Who: Cong Wang - ----------------------------- - -What: get_robust_list syscall -When: 2013 -Why: There appear to be no production users of the get_robust_list syscall, - and it runs the risk of leaking address locations, allowing the bypass - of ASLR. It was only ever intended for debugging, so it should be - removed. -Who: Kees Cook diff --git a/trunk/Makefile b/trunk/Makefile index fd4b3d038d75..1932984478c1 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -1170,7 +1170,7 @@ MRPROPER_FILES += .config .config.old .version .old_version \ # clean: rm-dirs := $(CLEAN_DIRS) clean: rm-files := $(CLEAN_FILES) -clean-dirs := $(addprefix _clean_, . $(vmlinux-alldirs) Documentation samples) +clean-dirs := $(addprefix _clean_, . $(vmlinux-alldirs) Documentation) PHONY += $(clean-dirs) clean archclean $(clean-dirs): diff --git a/trunk/arch/arm/boot/Makefile b/trunk/arch/arm/boot/Makefile index c877087d2000..fc871e719aae 100644 --- a/trunk/arch/arm/boot/Makefile +++ b/trunk/arch/arm/boot/Makefile @@ -11,6 +11,8 @@ # Copyright (C) 1995-2002 Russell King # +MKIMAGE := $(srctree)/scripts/mkuboot.sh + ifneq ($(MACHINE),) include $(srctree)/$(MACHINE)/Makefile.boot endif @@ -67,19 +69,22 @@ $(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y)) clean-files := *.dtb -ifneq ($(LOADADDR),) - UIMAGE_LOADADDR=$(LOADADDR) +quiet_cmd_uimage = UIMAGE $@ + cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \ + -C none -a $(LOADADDR) -e $(STARTADDR) \ + -n 'Linux-$(KERNELRELEASE)' -d $< $@ + +ifeq ($(CONFIG_ZBOOT_ROM),y) +$(obj)/uImage: LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT) else - ifeq ($(CONFIG_ZBOOT_ROM),y) - UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT) - else - UIMAGE_LOADADDR=$(ZRELADDR) - endif +$(obj)/uImage: LOADADDR=$(ZRELADDR) endif +$(obj)/uImage: STARTADDR=$(LOADADDR) + check_for_multiple_loadaddr = \ -if [ $(words $(UIMAGE_LOADADDR)) -gt 1 ]; then \ - echo 'multiple load addresses: $(UIMAGE_LOADADDR)'; \ +if [ $(words $(LOADADDR)) -gt 1 ]; then \ + echo 'multiple load addresses: $(LOADADDR)'; \ echo 'This is incompatible with uImages'; \ echo 'Specify LOADADDR on the commandline to build an uImage'; \ false; \ diff --git a/trunk/arch/avr32/boot/images/Makefile b/trunk/arch/avr32/boot/images/Makefile index 2a3b53978a3b..1848bf0d7f62 100644 --- a/trunk/arch/avr32/boot/images/Makefile +++ b/trunk/arch/avr32/boot/images/Makefile @@ -6,6 +6,8 @@ # for more details. # +MKIMAGE := $(srctree)/scripts/mkuboot.sh + extra-y := vmlinux.bin vmlinux.gz OBJCOPYFLAGS_vmlinux.bin := -O binary -R .note.gnu.build-id @@ -15,9 +17,10 @@ $(obj)/vmlinux.bin: vmlinux FORCE $(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE $(call if_changed,gzip) -UIMAGE_LOADADDR = $(CONFIG_LOAD_ADDRESS) -UIMAGE_ENTRYADDR = $(CONFIG_ENTRY_ADDRESS) -UIMAGE_COMPRESSION = gzip +quiet_cmd_uimage = UIMAGE $@ + cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A avr32 -O linux -T kernel \ + -C gzip -a $(CONFIG_LOAD_ADDRESS) -e $(CONFIG_ENTRY_ADDRESS) \ + -n 'Linux-$(KERNELRELEASE)' -d $< $@ targets += uImage uImage.srec $(obj)/uImage: $(obj)/vmlinux.gz diff --git a/trunk/arch/blackfin/boot/Makefile b/trunk/arch/blackfin/boot/Makefile index f7d27d50d02c..0a49279e3428 100644 --- a/trunk/arch/blackfin/boot/Makefile +++ b/trunk/arch/blackfin/boot/Makefile @@ -6,17 +6,20 @@ # for more details. # +MKIMAGE := $(srctree)/scripts/mkuboot.sh + targets := vmImage vmImage.bin vmImage.bz2 vmImage.gz vmImage.lzma vmImage.lzo vmImage.xip extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.xip -ifeq ($(CONFIG_RAMKERNEL),y) -UIMAGE_LOADADDR = $(CONFIG_BOOT_LOAD) -else # CONFIG_ROMKERNEL must be set -UIMAGE_LOADADDR = $(CONFIG_ROM_BASE) -endif -UIMAGE_ENTRYADDR = $(shell $(NM) vmlinux | awk '$$NF == "__start" {print $$1}') -UIMAGE_NAME = '$(CPU_REV)-$(KERNELRELEASE)' -UIMAGE_OPTS-$(CONFIG_ROMKERNEL) += -x +UIMAGE_OPTS-y := +UIMAGE_OPTS-$(CONFIG_RAMKERNEL) += -a $(CONFIG_BOOT_LOAD) +UIMAGE_OPTS-$(CONFIG_ROMKERNEL) += -a $(CONFIG_ROM_BASE) -x + +quiet_cmd_uimage = UIMAGE $@ + cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A $(ARCH) -O linux -T kernel \ + -C $(2) -n '$(CPU_REV)-$(KERNELRELEASE)' \ + -e $(shell $(NM) vmlinux | awk '$$NF == "__start" {print $$1}') \ + $(UIMAGE_OPTS-y) -d $< $@ $(obj)/vmlinux.bin: vmlinux FORCE $(call if_changed,objcopy) diff --git a/trunk/arch/microblaze/boot/Makefile b/trunk/arch/microblaze/boot/Makefile index fa83ea497db7..34940c828def 100644 --- a/trunk/arch/microblaze/boot/Makefile +++ b/trunk/arch/microblaze/boot/Makefile @@ -2,6 +2,8 @@ # arch/microblaze/boot/Makefile # +MKIMAGE := $(srctree)/scripts/mkuboot.sh + obj-y += linked_dtb.o targets := linux.bin linux.bin.gz simpleImage.% @@ -33,9 +35,11 @@ quiet_cmd_strip = STRIP $@ cmd_strip = $(STRIP) -K microblaze_start -K _end -K __log_buf \ -K _fdt_start vmlinux -o $@ -UIMAGE_IN = $@ -UIMAGE_OUT = $@.ub -UIMAGE_LOADADDR = $(CONFIG_KERNEL_BASE_ADDR) +quiet_cmd_uimage = UIMAGE $@.ub + cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A microblaze -O linux -T kernel \ + -C none -n 'Linux-$(KERNELRELEASE)' \ + -a $(CONFIG_KERNEL_BASE_ADDR) -e $(CONFIG_KERNEL_BASE_ADDR) \ + -d $@ $@.ub $(obj)/simpleImage.%: vmlinux FORCE $(call if_changed,cp,.unstrip) diff --git a/trunk/arch/sh/boot/Makefile b/trunk/arch/sh/boot/Makefile index 58592dfa5cb6..e4ea31a62c55 100644 --- a/trunk/arch/sh/boot/Makefile +++ b/trunk/arch/sh/boot/Makefile @@ -8,6 +8,8 @@ # Copyright (C) 1999 Stuart Menefy # +MKIMAGE := $(srctree)/scripts/mkuboot.sh + # # Assign safe dummy values if these variables are not defined, # in order to suppress error message. @@ -59,8 +61,10 @@ KERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%08x" \ $(KERNEL_MEMORY) + \ $(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]') -UIMAGE_LOADADDR = $(KERNEL_LOAD) -UIMAGE_ENTRYADDR = $(KERNEL_ENTRY) +quiet_cmd_uimage = UIMAGE $@ + cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \ + -C $(2) -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \ + -n 'Linux-$(KERNELRELEASE)' -d $< $@ $(obj)/vmlinux.bin: vmlinux FORCE $(call if_changed,objcopy) diff --git a/trunk/arch/sparc/boot/Makefile b/trunk/arch/sparc/boot/Makefile index d56d199c1aa8..9205416b1e67 100644 --- a/trunk/arch/sparc/boot/Makefile +++ b/trunk/arch/sparc/boot/Makefile @@ -5,6 +5,7 @@ ROOT_IMG := /usr/src/root.img ELFTOAOUT := elftoaout +MKIMAGE := $(srctree)/scripts/mkuboot.sh hostprogs-y := piggyback btfixupprep targets := tftpboot.img btfix.o btfix.S image zImage vmlinux.aout @@ -91,9 +92,11 @@ $(obj)/image.bin: $(obj)/image FORCE $(obj)/image.gz: $(obj)/image.bin $(call if_changed,gzip) -UIMAGE_LOADADDR = $(CONFIG_UBOOT_LOAD_ADDR) -UIMAGE_ENTRYADDR = $(CONFIG_UBOOT_ENTRY_ADDR) -UIMAGE_COMPRESSION = gzip +quiet_cmd_uimage = UIMAGE $@ + cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sparc -O linux -T kernel \ + -C gzip -a $(CONFIG_UBOOT_LOAD_ADDR) \ + -e $(CONFIG_UBOOT_ENTRY_ADDR) -n 'Linux-$(KERNELRELEASE)' \ + -d $< $@ quiet_cmd_uimage.o = UIMAGE.O $@ cmd_uimage.o = $(LD) -Tdata $(CONFIG_UBOOT_FLASH_ADDR) \ diff --git a/trunk/arch/sparc/include/asm/ptrace.h b/trunk/arch/sparc/include/asm/ptrace.h index 9835adc163fd..fd9c3f21cbf0 100644 --- a/trunk/arch/sparc/include/asm/ptrace.h +++ b/trunk/arch/sparc/include/asm/ptrace.h @@ -241,6 +241,7 @@ extern unsigned long profile_pc(struct pt_regs *); #ifndef __ASSEMBLY__ #ifdef __KERNEL__ +#include static inline bool pt_regs_is_syscall(struct pt_regs *regs) { diff --git a/trunk/arch/sparc/kernel/sun4d_smp.c b/trunk/arch/sparc/kernel/sun4d_smp.c index 133387980b56..540b2fec09f0 100644 --- a/trunk/arch/sparc/kernel/sun4d_smp.c +++ b/trunk/arch/sparc/kernel/sun4d_smp.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "kernel.h" diff --git a/trunk/arch/sparc/kernel/sun4m_smp.c b/trunk/arch/sparc/kernel/sun4m_smp.c index 594768686525..02db9a0412ce 100644 --- a/trunk/arch/sparc/kernel/sun4m_smp.c +++ b/trunk/arch/sparc/kernel/sun4m_smp.c @@ -10,6 +10,7 @@ #include #include +#include #include #include "irq.h" diff --git a/trunk/arch/unicore32/boot/Makefile b/trunk/arch/unicore32/boot/Makefile index ec7fb70b412b..79e5f88845d9 100644 --- a/trunk/arch/unicore32/boot/Makefile +++ b/trunk/arch/unicore32/boot/Makefile @@ -11,6 +11,8 @@ # Copyright (C) 2001~2010 GUAN Xue-tao # +MKIMAGE := $(srctree)/scripts/mkuboot.sh + targets := Image zImage uImage $(obj)/Image: vmlinux FORCE @@ -24,8 +26,14 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE $(call if_changed,objcopy) @echo ' Kernel: $@ is ready' -UIMAGE_ARCH = unicore -UIMAGE_LOADADDR = 0x0 +quiet_cmd_uimage = UIMAGE $@ + cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A unicore -O linux -T kernel \ + -C none -a $(LOADADDR) -e $(STARTADDR) \ + -n 'Linux-$(KERNELRELEASE)' -d $< $@ + +$(obj)/uImage: LOADADDR=0x0 + +$(obj)/uImage: STARTADDR=$(LOADADDR) $(obj)/uImage: $(obj)/zImage FORCE $(call if_changed,uimage) diff --git a/trunk/kernel/futex.c b/trunk/kernel/futex.c index e2b0fb9a0b3b..72efa1e4359a 100644 --- a/trunk/kernel/futex.c +++ b/trunk/kernel/futex.c @@ -59,7 +59,6 @@ #include #include #include -#include #include @@ -2444,31 +2443,40 @@ SYSCALL_DEFINE3(get_robust_list, int, pid, { struct robust_list_head __user *head; unsigned long ret; - struct task_struct *p; + const struct cred *cred = current_cred(), *pcred; if (!futex_cmpxchg_enabled) return -ENOSYS; - WARN_ONCE(1, "deprecated: get_robust_list will be deleted in 2013.\n"); - - rcu_read_lock(); - - ret = -ESRCH; if (!pid) - p = current; + head = current->robust_list; else { + struct task_struct *p; + + ret = -ESRCH; + rcu_read_lock(); p = find_task_by_vpid(pid); if (!p) goto err_unlock; + ret = -EPERM; + pcred = __task_cred(p); + /* If victim is in different user_ns, then uids are not + comparable, so we must have CAP_SYS_PTRACE */ + if (cred->user->user_ns != pcred->user->user_ns) { + if (!ns_capable(pcred->user->user_ns, CAP_SYS_PTRACE)) + goto err_unlock; + goto ok; + } + /* If victim is in same user_ns, then uids are comparable */ + if (cred->euid != pcred->euid && + cred->euid != pcred->uid && + !ns_capable(pcred->user->user_ns, CAP_SYS_PTRACE)) + goto err_unlock; +ok: + head = p->robust_list; + rcu_read_unlock(); } - ret = -EPERM; - if (!ptrace_may_access(p, PTRACE_MODE_READ)) - goto err_unlock; - - head = p->robust_list; - rcu_read_unlock(); - if (put_user(sizeof(*head), len_ptr)) return -EFAULT; return put_user(head, head_ptr); diff --git a/trunk/kernel/futex_compat.c b/trunk/kernel/futex_compat.c index 83e368b005fc..5f9e689dc8f0 100644 --- a/trunk/kernel/futex_compat.c +++ b/trunk/kernel/futex_compat.c @@ -10,7 +10,6 @@ #include #include #include -#include #include @@ -137,31 +136,40 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr, { struct compat_robust_list_head __user *head; unsigned long ret; - struct task_struct *p; + const struct cred *cred = current_cred(), *pcred; if (!futex_cmpxchg_enabled) return -ENOSYS; - WARN_ONCE(1, "deprecated: get_robust_list will be deleted in 2013.\n"); - - rcu_read_lock(); - - ret = -ESRCH; if (!pid) - p = current; + head = current->compat_robust_list; else { + struct task_struct *p; + + ret = -ESRCH; + rcu_read_lock(); p = find_task_by_vpid(pid); if (!p) goto err_unlock; + ret = -EPERM; + pcred = __task_cred(p); + /* If victim is in different user_ns, then uids are not + comparable, so we must have CAP_SYS_PTRACE */ + if (cred->user->user_ns != pcred->user->user_ns) { + if (!ns_capable(pcred->user->user_ns, CAP_SYS_PTRACE)) + goto err_unlock; + goto ok; + } + /* If victim is in same user_ns, then uids are comparable */ + if (cred->euid != pcred->euid && + cred->euid != pcred->uid && + !ns_capable(pcred->user->user_ns, CAP_SYS_PTRACE)) + goto err_unlock; +ok: + head = p->compat_robust_list; + rcu_read_unlock(); } - ret = -EPERM; - if (!ptrace_may_access(p, PTRACE_MODE_READ)) - goto err_unlock; - - head = p->compat_robust_list; - rcu_read_unlock(); - if (put_user(sizeof(*head), len_ptr)) return -EFAULT; return put_user(ptr_to_compat(head), head_ptr); diff --git a/trunk/kernel/irq/handle.c b/trunk/kernel/irq/handle.c index bdb180325551..6ff84e6a954c 100644 --- a/trunk/kernel/irq/handle.c +++ b/trunk/kernel/irq/handle.c @@ -54,18 +54,14 @@ static void warn_no_thread(unsigned int irq, struct irqaction *action) static void irq_wake_thread(struct irq_desc *desc, struct irqaction *action) { /* - * In case the thread crashed and was killed we just pretend that - * we handled the interrupt. The hardirq handler has disabled the - * device interrupt, so no irq storm is lurking. - */ - if (action->thread->flags & PF_EXITING) - return; - - /* - * Wake up the handler thread for this action. If the + * Wake up the handler thread for this action. In case the + * thread crashed and was killed we just pretend that we + * handled the interrupt. The hardirq handler has disabled the + * device interrupt, so no irq storm is lurking. If the * RUNTHREAD bit is already set, nothing to do. */ - if (test_and_set_bit(IRQTF_RUNTHREAD, &action->thread_flags)) + if ((action->thread->flags & PF_EXITING) || + test_and_set_bit(IRQTF_RUNTHREAD, &action->thread_flags)) return; /* diff --git a/trunk/kernel/irq/manage.c b/trunk/kernel/irq/manage.c index 89a3ea82569b..b0ccd1ac2d6a 100644 --- a/trunk/kernel/irq/manage.c +++ b/trunk/kernel/irq/manage.c @@ -282,7 +282,7 @@ setup_affinity(unsigned int irq, struct irq_desc *desc, struct cpumask *mask) { struct irq_chip *chip = irq_desc_get_chip(desc); struct cpumask *set = irq_default_affinity; - int ret, node = desc->irq_data.node; + int ret; /* Excludes PER_CPU and NO_BALANCE interrupts */ if (!irq_can_set_affinity(irq)) @@ -301,13 +301,6 @@ setup_affinity(unsigned int irq, struct irq_desc *desc, struct cpumask *mask) } cpumask_and(mask, cpu_online_mask, set); - if (node != NUMA_NO_NODE) { - const struct cpumask *nodemask = cpumask_of_node(node); - - /* make sure at least one of the cpus in nodemask is online */ - if (cpumask_intersects(mask, nodemask)) - cpumask_and(mask, mask, nodemask); - } ret = chip->irq_set_affinity(&desc->irq_data, mask, false); switch (ret) { case IRQ_SET_MASK_OK: @@ -652,7 +645,7 @@ static int irq_wait_for_interrupt(struct irqaction *action) * is marked MASKED. */ static void irq_finalize_oneshot(struct irq_desc *desc, - struct irqaction *action) + struct irqaction *action, bool force) { if (!(desc->istate & IRQS_ONESHOT)) return; @@ -686,7 +679,7 @@ static void irq_finalize_oneshot(struct irq_desc *desc, * we would clear the threads_oneshot bit of this thread which * was just set. */ - if (test_bit(IRQTF_RUNTHREAD, &action->thread_flags)) + if (!force && test_bit(IRQTF_RUNTHREAD, &action->thread_flags)) goto out_unlock; desc->threads_oneshot &= ~action->thread_mask; @@ -746,7 +739,7 @@ irq_forced_thread_fn(struct irq_desc *desc, struct irqaction *action) local_bh_disable(); ret = action->thread_fn(action->irq, action->dev_id); - irq_finalize_oneshot(desc, action); + irq_finalize_oneshot(desc, action, false); local_bh_enable(); return ret; } @@ -762,7 +755,7 @@ static irqreturn_t irq_thread_fn(struct irq_desc *desc, irqreturn_t ret; ret = action->thread_fn(action->irq, action->dev_id); - irq_finalize_oneshot(desc, action); + irq_finalize_oneshot(desc, action, false); return ret; } @@ -851,7 +844,7 @@ void exit_irq_thread(void) wake_threads_waitq(desc); /* Prevent a stale desc->threads_oneshot */ - irq_finalize_oneshot(desc, action); + irq_finalize_oneshot(desc, action, true); } static void irq_setup_forced_threading(struct irqaction *new) diff --git a/trunk/kernel/irq/migration.c b/trunk/kernel/irq/migration.c index c3c89751b327..47420908fba0 100644 --- a/trunk/kernel/irq/migration.c +++ b/trunk/kernel/irq/migration.c @@ -43,16 +43,12 @@ void irq_move_masked_irq(struct irq_data *idata) * masking the irqs. */ if (likely(cpumask_any_and(desc->pending_mask, cpu_online_mask) - < nr_cpu_ids)) { - int ret = chip->irq_set_affinity(&desc->irq_data, - desc->pending_mask, false); - switch (ret) { - case IRQ_SET_MASK_OK: + < nr_cpu_ids)) + if (!chip->irq_set_affinity(&desc->irq_data, + desc->pending_mask, false)) { cpumask_copy(desc->irq_data.affinity, desc->pending_mask); - case IRQ_SET_MASK_OK_NOCOPY: irq_set_thread_affinity(desc); } - } cpumask_clear(desc->pending_mask); } diff --git a/trunk/scripts/Kbuild.include b/trunk/scripts/Kbuild.include index 6a3ee981931d..d897278b1f97 100644 --- a/trunk/scripts/Kbuild.include +++ b/trunk/scripts/Kbuild.include @@ -104,7 +104,7 @@ as-option = $(call try-run,\ # Usage: cflags-y += $(call as-instr,instr,option1,option2) as-instr = $(call try-run,\ - printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3)) + /bin/echo -e "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3)) # cc-option # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586) diff --git a/trunk/scripts/Makefile.build b/trunk/scripts/Makefile.build index ff1720d28d0c..d2b366c16b64 100644 --- a/trunk/scripts/Makefile.build +++ b/trunk/scripts/Makefile.build @@ -69,7 +69,6 @@ warning-1 += -Wmissing-prototypes warning-1 += -Wold-style-definition warning-1 += $(call cc-option, -Wmissing-include-dirs) warning-1 += $(call cc-option, -Wunused-but-set-variable) -warning-1 += $(call cc-disable-warning, missing-field-initializers) warning-2 := -Waggregate-return warning-2 += -Wcast-align @@ -77,7 +76,6 @@ warning-2 += -Wdisabled-optimization warning-2 += -Wnested-externs warning-2 += -Wshadow warning-2 += $(call cc-option, -Wlogical-op) -warning-2 += $(call cc-option, -Wmissing-field-initializers) warning-3 := -Wbad-function-cast warning-3 += -Wcast-qual diff --git a/trunk/scripts/Makefile.lib b/trunk/scripts/Makefile.lib index 0be6f110cce7..00c368c6e996 100644 --- a/trunk/scripts/Makefile.lib +++ b/trunk/scripts/Makefile.lib @@ -304,30 +304,6 @@ cmd_lzo = (cat $(filter-out FORCE,$^) | \ lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ (rm -f $@ ; false) -# U-Boot mkimage -# --------------------------------------------------------------------------- - -MKIMAGE := $(srctree)/scripts/mkuboot.sh - -# SRCARCH just happens to match slightly more than ARCH (on sparc), so reduces -# the number of overrides in arch makefiles -UIMAGE_ARCH ?= $(SRCARCH) -UIMAGE_COMPRESSION ?= $(if $(2),$(2),none) -UIMAGE_OPTS-y ?= -UIMAGE_TYPE ?= kernel -UIMAGE_LOADADDR ?= arch_must_set_this -UIMAGE_ENTRYADDR ?= $(UIMAGE_LOADADDR) -UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)' -UIMAGE_IN ?= $< -UIMAGE_OUT ?= $@ - -quiet_cmd_uimage = UIMAGE $(UIMAGE_OUT) - cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A $(UIMAGE_ARCH) -O linux \ - -C $(UIMAGE_COMPRESSION) $(UIMAGE_OPTS-y) \ - -T $(UIMAGE_TYPE) \ - -a $(UIMAGE_LOADADDR) -e $(UIMAGE_ENTRYADDR) \ - -n $(UIMAGE_NAME) -d $(UIMAGE_IN) $(UIMAGE_OUT) - # XZ # --------------------------------------------------------------------------- # Use xzkern to compress the kernel image and xzmisc to compress other things. diff --git a/trunk/scripts/coccinelle/api/ptr_ret.cocci b/trunk/scripts/coccinelle/api/ptr_ret.cocci deleted file mode 100644 index cbfd08c7d8c7..000000000000 --- a/trunk/scripts/coccinelle/api/ptr_ret.cocci +++ /dev/null @@ -1,70 +0,0 @@ -/// -/// Use PTR_RET rather than if(IS_ERR(...)) + PTR_ERR -/// -// Confidence: High -// Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2. -// Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. GPLv2. -// URL: http://coccinelle.lip6.fr/ -// Options: -no_includes -include_headers -// -// Keywords: ERR_PTR, PTR_ERR, PTR_RET -// Version min: 2.6.39 -// - -virtual context -virtual patch -virtual org -virtual report - -@depends on patch@ -expression ptr; -@@ - -- if (IS_ERR(ptr)) return PTR_ERR(ptr); else return 0; -+ return PTR_RET(ptr); - -@depends on patch@ -expression ptr; -@@ - -- if (IS_ERR(ptr)) return PTR_ERR(ptr); return 0; -+ return PTR_RET(ptr); - -@r1 depends on !patch@ -expression ptr; -position p1; -@@ - -* if@p1 (IS_ERR(ptr)) return PTR_ERR(ptr); else return 0; - -@r2 depends on !patch@ -expression ptr; -position p2; -@@ - -* if@p2 (IS_ERR(ptr)) return PTR_ERR(ptr); return 0; - -@script:python depends on org@ -p << r1.p1; -@@ - -coccilib.org.print_todo(p[0], "WARNING: PTR_RET can be used") - - -@script:python depends on org@ -p << r2.p2; -@@ - -coccilib.org.print_todo(p[0], "WARNING: PTR_RET can be used") - -@script:python depends on report@ -p << r1.p1; -@@ - -coccilib.report.print_report(p[0], "WARNING: PTR_RET can be used") - -@script:python depends on report@ -p << r2.p2; -@@ - -coccilib.report.print_report(p[0], "WARNING: PTR_RET can be used") diff --git a/trunk/scripts/coccinelle/free/clk_put.cocci b/trunk/scripts/coccinelle/free/clk_put.cocci deleted file mode 100644 index 46747adfd20a..000000000000 --- a/trunk/scripts/coccinelle/free/clk_put.cocci +++ /dev/null @@ -1,67 +0,0 @@ -/// Find missing clk_puts. -/// -//# This only signals a missing clk_put when there is a clk_put later -//# in the same function. -//# False positives can be due to loops. -// -// Confidence: Moderate -// Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2. -// Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. GPLv2. -// URL: http://coccinelle.lip6.fr/ -// Comments: -// Options: - -virtual context -virtual org -virtual report - -@clk@ -expression e; -statement S,S1; -int ret; -position p1,p2,p3; -@@ - -e = clk_get@p1(...) -... when != clk_put(e) -if (<+...e...+>) S -... when any - when != clk_put(e) - when != if (...) { ... clk_put(e); ... } -( - if (ret == 0) S1 -| -if (...) - { ... - return 0; } -| -if (...) - { ... - return <+...e...+>; } -| -*if@p2 (...) - { ... when != clk_put(e) - when forall - return@p3 ...; } -) -... when any -clk_put(e); - -@script:python depends on org@ -p1 << clk.p1; -p2 << clk.p2; -p3 << clk.p3; -@@ - -cocci.print_main("clk_get",p1) -cocci.print_secs("if",p2) -cocci.print_secs("needed clk_put",p3) - -@script:python depends on report@ -p1 << clk.p1; -p2 << clk.p2; -p3 << clk.p3; -@@ - -msg = "ERROR: missing clk_put; clk_get on line %s and execution via conditional on line %s" % (p1[0].line,p2[0].line) -coccilib.report.print_report(p3[0],msg) diff --git a/trunk/scripts/coccinelle/free/iounmap.cocci b/trunk/scripts/coccinelle/free/iounmap.cocci deleted file mode 100644 index 5384f4ba1192..000000000000 --- a/trunk/scripts/coccinelle/free/iounmap.cocci +++ /dev/null @@ -1,67 +0,0 @@ -/// Find missing iounmaps. -/// -//# This only signals a missing iounmap when there is an iounmap later -//# in the same function. -//# False positives can be due to loops. -// -// Confidence: Moderate -// Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2. -// Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. GPLv2. -// URL: http://coccinelle.lip6.fr/ -// Comments: -// Options: - -virtual context -virtual org -virtual report - -@iom@ -expression e; -statement S,S1; -int ret; -position p1,p2,p3; -@@ - -e = \(ioremap@p1\|ioremap_nocache@p1\)(...) -... when != iounmap(e) -if (<+...e...+>) S -... when any - when != iounmap(e) - when != if (...) { ... iounmap(e); ... } -( - if (ret == 0) S1 -| -if (...) - { ... - return 0; } -| -if (...) - { ... - return <+...e...+>; } -| -*if@p2 (...) - { ... when != iounmap(e) - when forall - return@p3 ...; } -) -... when any -iounmap(e); - -@script:python depends on org@ -p1 << iom.p1; -p2 << iom.p2; -p3 << iom.p3; -@@ - -cocci.print_main("ioremap",p1) -cocci.print_secs("if",p2) -cocci.print_secs("needed iounmap",p3) - -@script:python depends on report@ -p1 << iom.p1; -p2 << iom.p2; -p3 << iom.p3; -@@ - -msg = "ERROR: missing iounmap; ioremap on line %s and execution via conditional on line %s" % (p1[0].line,p2[0].line) -coccilib.report.print_report(p3[0],msg) diff --git a/trunk/scripts/coccinelle/misc/boolinit.cocci b/trunk/scripts/coccinelle/misc/boolinit.cocci deleted file mode 100644 index 97ce41ce8135..000000000000 --- a/trunk/scripts/coccinelle/misc/boolinit.cocci +++ /dev/null @@ -1,178 +0,0 @@ -/// Bool initializations should use true and false. Bool tests don't need -/// comparisons. Based on contributions from Joe Perches, Rusty Russell -/// and Bruce W Allan. -/// -// Confidence: High -// Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2. -// Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. GPLv2. -// URL: http://coccinelle.lip6.fr/ -// Options: -include_headers - -virtual patch -virtual context -virtual org -virtual report - -@depends on patch@ -bool t; -symbol true; -symbol false; -@@ - -( -- t == true -+ t -| -- true == t -+ t -| -- t != true -+ !t -| -- true != t -+ !t -| -- t == false -+ !t -| -- false == t -+ !t -| -- t != false -+ t -| -- false != t -+ t -) - -@depends on patch disable is_zero, isnt_zero@ -bool t; -@@ - -( -- t == 1 -+ t -| -- t != 1 -+ !t -| -- t == 0 -+ !t -| -- t != 0 -+ t -) - -@depends on patch@ -bool b; -@@ -( - b = -- 0 -+ false -| - b = -- 1 -+ true -) - -// --------------------------------------------------------------------- - -@r1 depends on !patch@ -bool t; -position p; -@@ - -( -* t@p == true -| -* true == t@p -| -* t@p != true -| -* true != t@p -| -* t@p == false -| -* false == t@p -| -* t@p != false -| -* false != t@p -) - -@r2 depends on !patch disable is_zero, isnt_zero@ -bool t; -position p; -@@ - -( -* t@p == 1 -| -* t@p != 1 -| -* t@p == 0 -| -* t@p != 0 -) - -@r3 depends on !patch@ -bool b; -position p1,p2; -constant c; -@@ -( -*b@p1 = 0 -| -*b@p1 = 1 -| -*b@p2 = c -) - -@script:python depends on org@ -p << r1.p; -@@ - -cocci.print_main("WARNING: Comparison to bool",p) - -@script:python depends on org@ -p << r2.p; -@@ - -cocci.print_main("WARNING: Comparison of bool to 0/1",p) - -@script:python depends on org@ -p1 << r3.p1; -@@ - -cocci.print_main("WARNING: Assignment of bool to 0/1",p1) - -@script:python depends on org@ -p2 << r3.p2; -@@ - -cocci.print_main("ERROR: Assignment of bool to non-0/1 constant",p2) - -@script:python depends on report@ -p << r1.p; -@@ - -coccilib.report.print_report(p[0],"WARNING: Comparison to bool") - -@script:python depends on report@ -p << r2.p; -@@ - -coccilib.report.print_report(p[0],"WARNING: Comparison of bool to 0/1") - -@script:python depends on report@ -p1 << r3.p1; -@@ - -coccilib.report.print_report(p1[0],"WARNING: Assignment of bool to 0/1") - -@script:python depends on report@ -p2 << r3.p2; -@@ - -coccilib.report.print_report(p2[0],"ERROR: Assignment of bool to non-0/1 constant") diff --git a/trunk/scripts/coccinelle/misc/cstptr.cocci b/trunk/scripts/coccinelle/misc/cstptr.cocci deleted file mode 100644 index d42564484528..000000000000 --- a/trunk/scripts/coccinelle/misc/cstptr.cocci +++ /dev/null @@ -1,41 +0,0 @@ -/// PTR_ERR should be applied before its argument is reassigned, typically -/// to NULL -/// -// Confidence: High -// Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2. -// Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. GPLv2. -// URL: http://coccinelle.lip6.fr/ -// Comments: -// Options: -no_includes -include_headers - -virtual org -virtual report -virtual context - -@r exists@ -expression e,e1; -constant c; -position p1,p2; -@@ - -*e@p1 = c -... when != e = e1 - when != &e - when != true IS_ERR(e) -*PTR_ERR@p2(e) - -@script:python depends on org@ -p1 << r.p1; -p2 << r.p2; -@@ - -cocci.print_main("PTR_ERR",p2) -cocci.print_secs("assignment",p1) - -@script:python depends on report@ -p1 << r.p1; -p2 << r.p2; -@@ - -msg = "ERROR: PTR_ERR applied after initialization to constant on line %s" % (p1[0].line) -coccilib.report.print_report(p2[0],msg) diff --git a/trunk/scripts/coccinelle/null/badzero.cocci b/trunk/scripts/coccinelle/null/badzero.cocci deleted file mode 100644 index d79baf7220e7..000000000000 --- a/trunk/scripts/coccinelle/null/badzero.cocci +++ /dev/null @@ -1,237 +0,0 @@ -/// Compare pointer-typed values to NULL rather than 0 -/// -//# This makes an effort to choose between !x and x == NULL. !x is used -//# if it has previously been used with the function used to initialize x. -//# This relies on type information. More type information can be obtained -//# using the option -all_includes and the option -I to specify an -//# include path. -// -// Confidence: High -// Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2. -// Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. GPLv2. -// URL: http://coccinelle.lip6.fr/ -// Comments: -// Options: - -virtual patch -virtual context -virtual org -virtual report - -@initialize:ocaml@ -let negtable = Hashtbl.create 101 - -@depends on patch@ -expression *E; -identifier f; -@@ - -( - (E = f(...)) == -- 0 -+ NULL -| - (E = f(...)) != -- 0 -+ NULL -| -- 0 -+ NULL - == (E = f(...)) -| -- 0 -+ NULL - != (E = f(...)) -) - - -@t1 depends on !patch@ -expression *E; -identifier f; -position p; -@@ - -( - (E = f(...)) == -* 0@p -| - (E = f(...)) != -* 0@p -| -* 0@p - == (E = f(...)) -| -* 0@p - != (E = f(...)) -) - -@script:python depends on org@ -p << t1.p; -@@ - -coccilib.org.print_todo(p[0], "WARNING comparing pointer to 0") - -@script:python depends on report@ -p << t1.p; -@@ - -coccilib.report.print_report(p[0], "WARNING comparing pointer to 0") - -// Tests of returned values - -@s@ -identifier f; -expression E,E1; -@@ - - E = f(...) - ... when != E = E1 - !E - -@script:ocaml depends on s@ -f << s.f; -@@ - -try let _ = Hashtbl.find negtable f in () -with Not_found -> Hashtbl.add negtable f () - -@ r disable is_zero,isnt_zero exists @ -expression *E; -identifier f; -@@ - -E = f(...) -... -(E == 0 -|E != 0 -|0 == E -|0 != E -) - -@script:ocaml@ -f << r.f; -@@ - -try let _ = Hashtbl.find negtable f in () -with Not_found -> include_match false - -// This rule may lead to inconsistent path problems, if E is defined in two -// places -@ depends on patch disable is_zero,isnt_zero @ -expression *E; -expression E1; -identifier r.f; -@@ - -E = f(...) -<... -( -- E == 0 -+ !E -| -- E != 0 -+ E -| -- 0 == E -+ !E -| -- 0 != E -+ E -) -...> -?E = E1 - -@t2 depends on !patch disable is_zero,isnt_zero @ -expression *E; -expression E1; -identifier r.f; -position p1; -position p2; -@@ - -E = f(...) -<... -( -* E == 0@p1 -| -* E != 0@p2 -| -* 0@p1 == E -| -* 0@p1 != E -) -...> -?E = E1 - -@script:python depends on org@ -p << t2.p1; -@@ - -coccilib.org.print_todo(p[0], "WARNING comparing pointer to 0, suggest !E") - -@script:python depends on org@ -p << t2.p2; -@@ - -coccilib.org.print_todo(p[0], "WARNING comparing pointer to 0") - -@script:python depends on report@ -p << t2.p1; -@@ - -coccilib.report.print_report(p[0], "WARNING comparing pointer to 0, suggest !E") - -@script:python depends on report@ -p << t2.p2; -@@ - -coccilib.report.print_report(p[0], "WARNING comparing pointer to 0") - -@ depends on patch disable is_zero,isnt_zero @ -expression *E; -@@ - -( - E == -- 0 -+ NULL -| - E != -- 0 -+ NULL -| -- 0 -+ NULL - == E -| -- 0 -+ NULL - != E -) - -@ t3 depends on !patch disable is_zero,isnt_zero @ -expression *E; -position p; -@@ - -( -* E == 0@p -| -* E != 0@p -| -* 0@p == E -| -* 0@p != E -) - -@script:python depends on org@ -p << t3.p; -@@ - -coccilib.org.print_todo(p[0], "WARNING comparing pointer to 0") - -@script:python depends on report@ -p << t3.p; -@@ - -coccilib.report.print_report(p[0], "WARNING comparing pointer to 0") diff --git a/trunk/scripts/dtc/dtc.c b/trunk/scripts/dtc/dtc.c index 2ef5e2e3dd38..451c92d31b19 100644 --- a/trunk/scripts/dtc/dtc.c +++ b/trunk/scripts/dtc/dtc.c @@ -101,7 +101,7 @@ int main(int argc, char *argv[]) const char *outform = "dts"; const char *outname = "-"; const char *depname = NULL; - int force = 0, sort = 0; + int force = 0, check = 0, sort = 0; const char *arg; int opt; FILE *outf = NULL; @@ -143,6 +143,9 @@ int main(int argc, char *argv[]) case 'f': force = 1; break; + case 'c': + check = 1; + break; case 'q': quiet++; break; diff --git a/trunk/scripts/dtc/flattree.c b/trunk/scripts/dtc/flattree.c index 28d0b2381df6..ead0332c87e1 100644 --- a/trunk/scripts/dtc/flattree.c +++ b/trunk/scripts/dtc/flattree.c @@ -697,6 +697,7 @@ static struct reserve_info *flat_read_mem_reserve(struct inbuf *inb) { struct reserve_info *reservelist = NULL; struct reserve_info *new; + const char *p; struct fdt_reserve_entry re; /* @@ -705,6 +706,7 @@ static struct reserve_info *flat_read_mem_reserve(struct inbuf *inb) * * First pass, count entries. */ + p = inb->ptr; while (1) { flat_read_chunk(inb, &re, sizeof(re)); re.address = fdt64_to_cpu(re.address); diff --git a/trunk/scripts/headers_check.pl b/trunk/scripts/headers_check.pl index 64ac2380e4d5..7957e7a5166a 100644 --- a/trunk/scripts/headers_check.pl +++ b/trunk/scripts/headers_check.pl @@ -19,7 +19,6 @@ # 3) Check for leaked CONFIG_ symbols use strict; -use File::Basename; my ($dir, $arch, @files) = @ARGV; @@ -100,39 +99,6 @@ sub check_asm_types } my $linux_types; -my %import_stack = (); -sub check_include_typesh -{ - my $path = $_[0]; - my $import_path; - - my $fh; - my @file_paths = ($path, $dir . "/" . $path, dirname($filename) . "/" . $path); - for my $possible ( @file_paths ) { - if (not $import_stack{$possible} and open($fh, '<', $possible)) { - $import_path = $possible; - $import_stack{$import_path} = 1; - last; - } - } - if (eof $fh) { - return; - } - - my $line; - while ($line = <$fh>) { - if ($line =~ m/^\s*#\s*include\s+/) { - $linux_types = 1; - last; - } - if (my $included = ($line =~ /^\s*#\s*include\s+[<"](\S+)[>"]/)[0]) { - check_include_typesh($included); - } - } - close $fh; - delete $import_stack{$import_path}; -} - sub check_sizetypes { if ($filename =~ /types.h|int-l64.h|int-ll64.h/o) { @@ -147,9 +113,6 @@ sub check_sizetypes $linux_types = 1; return; } - if (my $included = ($line =~ /^\s*#\s*include\s+[<"](\S+)[>"]/)[0]) { - check_include_typesh($included); - } if ($line =~ m/__[us](8|16|32|64)\b/) { printf STDERR "$filename:$lineno: " . "found __[us]{8,16,32,64} type " . @@ -159,3 +122,4 @@ sub check_sizetypes #$ret = 1; } } + diff --git a/trunk/scripts/kconfig/confdata.c b/trunk/scripts/kconfig/confdata.c index 0586085136d1..7c7a5a6cc3f5 100644 --- a/trunk/scripts/kconfig/confdata.c +++ b/trunk/scripts/kconfig/confdata.c @@ -344,8 +344,10 @@ int conf_read_simple(const char *name, int def) int conf_read(const char *name) { - struct symbol *sym; - int i; + struct symbol *sym, *choice_sym; + struct property *prop; + struct expr *e; + int i, flags; sym_set_change_count(0); @@ -355,7 +357,7 @@ int conf_read(const char *name) for_all_symbols(i, sym) { sym_calc_value(sym); if (sym_is_choice(sym) || (sym->flags & SYMBOL_AUTO)) - continue; + goto sym_ok; if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) { /* check that calculated value agrees with saved value */ switch (sym->type) { @@ -364,18 +366,30 @@ int conf_read(const char *name) if (sym->def[S_DEF_USER].tri != sym_get_tristate_value(sym)) break; if (!sym_is_choice(sym)) - continue; + goto sym_ok; /* fall through */ default: if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val)) - continue; + goto sym_ok; break; } } else if (!sym_has_value(sym) && !(sym->flags & SYMBOL_WRITE)) /* no previous value and not saved */ - continue; + goto sym_ok; conf_unsaved++; /* maybe print value in verbose mode... */ + sym_ok: + if (!sym_is_choice(sym)) + continue; + /* The choice symbol only has a set value (and thus is not new) + * if all its visible childs have values. + */ + prop = sym_get_choice_prop(sym); + flags = sym->flags; + expr_list_for_each_sym(prop->expr, e, choice_sym) + if (choice_sym->visible != no) + flags &= choice_sym->flags; + sym->flags &= flags | ~SYMBOL_DEF_USER; } for_all_symbols(i, sym) { diff --git a/trunk/scripts/kconfig/merge_config.sh b/trunk/scripts/kconfig/merge_config.sh old mode 100755 new mode 100644 index 974d5cb7e30a..ceadf0e150cf --- a/trunk/scripts/kconfig/merge_config.sh +++ b/trunk/scripts/kconfig/merge_config.sh @@ -31,12 +31,10 @@ usage() { echo " -h display this help text" echo " -m only merge the fragments, do not execute the make command" echo " -n use allnoconfig instead of alldefconfig" - echo " -r list redundant entries when merging fragments" } MAKE=true ALLTARGET=alldefconfig -WARNREDUN=false while true; do case $1 in @@ -54,27 +52,18 @@ while true; do usage exit ;; - "-r") - WARNREDUN=true - shift - continue - ;; *) break ;; esac done -INITFILE=$1 -shift; + MERGE_LIST=$* SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p" TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX) -echo "Using $INITFILE as base" -cat $INITFILE > $TMP_FILE - # Merge files, printing warnings on overrided values for MERGE_FILE in $MERGE_LIST ; do echo "Merging $MERGE_FILE" @@ -90,8 +79,6 @@ for MERGE_FILE in $MERGE_LIST ; do echo Previous value: $PREV_VAL echo New value: $NEW_VAL echo - elif [ "$WARNREDUN" = "true" ]; then - echo Value of $CFG is redundant by fragment $MERGE_FILE: fi sed -i "/$CFG[ =]/d" $TMP_FILE fi diff --git a/trunk/scripts/kconfig/symbol.c b/trunk/scripts/kconfig/symbol.c index 22a3c400fc41..071f00c3046e 100644 --- a/trunk/scripts/kconfig/symbol.c +++ b/trunk/scripts/kconfig/symbol.c @@ -262,18 +262,11 @@ static struct symbol *sym_calc_choice(struct symbol *sym) struct symbol *def_sym; struct property *prop; struct expr *e; - int flags; /* first calculate all choice values' visibilities */ - flags = sym->flags; prop = sym_get_choice_prop(sym); - expr_list_for_each_sym(prop->expr, e, def_sym) { + expr_list_for_each_sym(prop->expr, e, def_sym) sym_calc_visibility(def_sym); - if (def_sym->visible != no) - flags &= def_sym->flags; - } - - sym->flags &= flags | ~SYMBOL_DEF_USER; /* is the user choice visible? */ def_sym = sym->def[S_DEF_USER].val; diff --git a/trunk/scripts/mod/modpost.c b/trunk/scripts/mod/modpost.c index 3f01fd908730..9adb667dd31a 100644 --- a/trunk/scripts/mod/modpost.c +++ b/trunk/scripts/mod/modpost.c @@ -849,7 +849,7 @@ static void check_section(const char *modname, struct elf_info *elf, #define ALL_INIT_DATA_SECTIONS \ ".init.setup$", ".init.rodata$", \ - ".devinit.rodata$", ".cpuinit.rodata$", ".meminit.rodata$", \ + ".devinit.rodata$", ".cpuinit.rodata$", ".meminit.rodata$" \ ".init.data$", ".devinit.data$", ".cpuinit.data$", ".meminit.data$" #define ALL_EXIT_DATA_SECTIONS \ ".exit.data$", ".devexit.data$", ".cpuexit.data$", ".memexit.data$" diff --git a/trunk/scripts/package/builddeb b/trunk/scripts/package/builddeb index eee5f8ed2493..3c6c0b14c807 100644 --- a/trunk/scripts/package/builddeb +++ b/trunk/scripts/package/builddeb @@ -97,7 +97,6 @@ mkdir -m 755 -p "$libc_headers_dir/DEBIAN" mkdir -p "$libc_headers_dir/usr/share/doc/$libc_headers_packagename" mkdir -m 755 -p "$kernel_headers_dir/DEBIAN" mkdir -p "$kernel_headers_dir/usr/share/doc/$kernel_headers_packagename" -mkdir -p "$kernel_headers_dir/lib/modules/$version/" if [ "$ARCH" = "um" ] ; then mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/bin" fi @@ -121,19 +120,15 @@ else fi if grep -q '^CONFIG_MODULES=y' .config ; then - INSTALL_MOD_PATH="$tmpdir" $MAKE KBUILD_SRC= modules_install - rm -f "$tmpdir/lib/modules/$version/build" - rm -f "$tmpdir/lib/modules/$version/source" + INSTALL_MOD_PATH="$tmpdir" make KBUILD_SRC= modules_install if [ "$ARCH" = "um" ] ; then mv "$tmpdir/lib/modules/$version"/* "$tmpdir/usr/lib/uml/modules/$version/" rmdir "$tmpdir/lib/modules/$version" fi fi -if [ "$ARCH" != "um" ]; then - $MAKE headers_check KBUILD_SRC= - $MAKE headers_install KBUILD_SRC= INSTALL_HDR_PATH="$libc_headers_dir/usr" -fi +make headers_check +make headers_install INSTALL_HDR_PATH="$libc_headers_dir/usr" # Install the maintainer scripts # Note: hook scripts under /etc/kernel are also executed by official Debian @@ -250,7 +245,6 @@ destdir=$kernel_headers_dir/usr/src/linux-headers-$version mkdir -p "$destdir" (cd $srctree; tar -c -f - -T "$objtree/debian/hdrsrcfiles") | (cd $destdir; tar -xf -) (cd $objtree; tar -c -f - -T "$objtree/debian/hdrobjfiles") | (cd $destdir; tar -xf -) -ln -sf "/usr/src/linux-headers-$version" "$kernel_headers_dir/lib/modules/$version/build" rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles" arch=$(dpkg --print-architecture) @@ -265,6 +259,8 @@ Description: Linux kernel headers for $KERNELRELEASE on $arch This is useful for people who need to build external modules EOF +create_package "$kernel_headers_packagename" "$kernel_headers_dir" + # Do we have firmware? Move it out of the way and build it into a package. if [ -e "$tmpdir/lib/firmware" ]; then mv "$tmpdir/lib/firmware" "$fwdir/lib/" @@ -291,11 +287,7 @@ Description: Linux support headers for userspace development are used by the installed headers for GNU glibc and other system libraries. EOF -if [ "$ARCH" != "um" ]; then - create_package "$kernel_headers_packagename" "$kernel_headers_dir" - create_package "$libc_headers_packagename" "$libc_headers_dir" -fi - +create_package "$libc_headers_packagename" "$libc_headers_dir" create_package "$packagename" "$tmpdir" exit 0 diff --git a/trunk/scripts/patch-kernel b/trunk/scripts/patch-kernel index d000ea3a41fd..20fb25c23382 100755 --- a/trunk/scripts/patch-kernel +++ b/trunk/scripts/patch-kernel @@ -116,10 +116,6 @@ findFile () { ext=".bz2" name="bzip2" uncomp="bunzip2 -dc" - elif [ -r ${filebase}.xz ]; then - ext=".xz" - name="xz" - uncomp="xz -dc" elif [ -r ${filebase}.zip ]; then ext=".zip" name="zip" diff --git a/trunk/scripts/setlocalversion b/trunk/scripts/setlocalversion index bd6dca8a0ab2..4d403844e137 100755 --- a/trunk/scripts/setlocalversion +++ b/trunk/scripts/setlocalversion @@ -75,7 +75,8 @@ scm_version() [ -w . ] && git update-index --refresh --unmerged > /dev/null # Check for uncommitted changes - if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then + if git diff-index --name-only HEAD | grep -v "^scripts/package" \ + | read dummy; then printf '%s' -dirty fi diff --git a/trunk/scripts/tags.sh b/trunk/scripts/tags.sh index 0d6004e20658..833813a99e7c 100755 --- a/trunk/scripts/tags.sh +++ b/trunk/scripts/tags.sh @@ -116,7 +116,7 @@ docscope() dogtags() { - all_sources | gtags -i -f - + all_sources | gtags -f - } exuberant() @@ -166,6 +166,9 @@ exuberant() all_defconfigs | xargs -r $1 -a \ --langdef=dotconfig --language-force=dotconfig \ --regex-dotconfig='/^#?[[:blank:]]*(CONFIG_[[:alnum:]_]+)/\1/' + + # Remove structure forward declarations. + LANG=C sed -i -e '/^\([a-zA-Z_][a-zA-Z0-9_]*\)\t.*\t\/\^struct \1;.*\$\/;"\tx$/d' tags } emacs() @@ -230,7 +233,6 @@ if [ "${ARCH}" = "um" ]; then fi fi -remove_structs= case "$1" in "cscope") docscope @@ -243,17 +245,10 @@ case "$1" in "tags") rm -f tags xtags ctags - remove_structs=y ;; "TAGS") rm -f TAGS xtags etags - remove_structs=y ;; esac - -# Remove structure forward declarations. -if [ -n $remove_structs ]; then - LANG=C sed -i -e '/^\([a-zA-Z_][a-zA-Z0-9_]*\)\t.*\t\/\^struct \1;.*\$\/;"\tx$/d' $1 -fi