aboutsummaryrefslogtreecommitdiffstats
path: root/scripts (follow)
AgeCommit message (Collapse)AuthorFilesLines
2011-01-07mkuboot.sh: Fail if mkimage is missingRoland Stigge1-1/+1
on building an uImage, I get: $ make uImage CHK include/linux/version.h CHK include/generated/utsrelease.h make[1]: `include/generated/mach-types.h' is up to date. CALL scripts/checksyscalls.sh CHK include/generated/compile.h Kernel: arch/arm/boot/Image is ready SHIPPED arch/arm/boot/compressed/lib1funcs.S AS arch/arm/boot/compressed/lib1funcs.o LD arch/arm/boot/compressed/vmlinux OBJCOPY arch/arm/boot/zImage Kernel: arch/arm/boot/zImage is ready UIMAGE arch/arm/boot/uImage "mkimage" command not found - U-Boot images will not be built Image arch/arm/boot/uImage is ready $ I.e. it says: "uImage is ready" even though the uImage file doesn't exist because mkimage is missing. I propose the attached patch. Signed-off-by: Roland Stigge <stigge@antcom.de> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-12-28modpost: Fix address calculation in reloc_location()Olof Johansson1-1/+1
This patch fixes a segfault in modpost that is observed when the gold linker is used to link the input objects. The problem is that reloc_location (modpost.c) is computing the address of the relocation target incorrectly. Here, elf->hdr points to the beginning of the ELF file in memory, sechdr points to the relocation section header, section is the index of the section being relocated, and sechdrs[section].sh_offset would be the offset of that section, relative to the beginning of the ELF file. Adding elf->hdr + sechdrs[section].sh_offset gives you the address of the beginning of the section, and adding r->r_offset to that gives you the address of the location to be relocated. You do not need to subtract sechdrs[section].sh_addr from that -- the result of this is an address outside the file, and causes the segfault when addend_386_rel tries to dereference it. This bug is not observed when GNU ld is used to link the inputs. The object file ubuntu/omnibook/omnibook.o is the result of an ld -r of several other files. When GNU ld does an ld -r, it sets the vaddr field for each section to 0, but gold lays out the section addresses sequentially instead: Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .text PROGBITS 00000000 000034 004794 00 AX 0 0 4 [ 2] .data PROGBITS 0000b9d0 0047c8 0009c0 00 WA 0 0 4 [ 3] .bss NOBITS 000162f8 005188 00013c 00 WA 0 0 4 [ 4] .rodata.str1.1 PROGBITS 00004f2d 0052c4 001b1a 01 AMS 0 0 1 [ 5] .init.text PROGBITS 00004794 006dde 0005fa 00 AX 0 0 1 [ 6] .exit.text PROGBITS 00004d8e 0073d8 00018a 00 AX 0 0 1 ... So the bug in the tool remained undiscovered because the section's vaddr always happened to be 0. Signed-off-by: Raymes Khoury <raymes@google.com> Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-12-22Make fixdep error handling more explicitBen Gamari1-3/+7
Also add missing error handling to fstat call Signed-off-by: Ben Gamari <bgamari.foss@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-12-20checksyscalls: Fix stand-alone usageGeert Uytterhoeven1-2/+2
The usage help in the comments - refers to the wrong script name, - doesn't mention that $srctree must be set. Hence correct the script name, and derive the source tree path from the script path, so we no longer need to rely on $srctree being set by the caller. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-12-16modpost: Put .zdebug* section on white listH.J. Lu1-0/+1
"as --compress-debug-sections" will generate compressed debug sections with section names ".zdebug*". This patch puts .zdebug* section on white list. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-12-14kbuild: introduce HDR_ARCH_LIST for headers_install_allKirill A. Shutemov1-1/+1
Using HDR_ARCH_LIST you can specify subset of architectures you want to get headers for. Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-12-14Merge commit 'v2.6.37-rc1' into kbuild/kbuildMichal Marek77-1575/+5850
2010-12-14headers_install: check exit status of unifdefMike Frysinger1-0/+7
If unifdef fails for any reason (like segfaulting), we should be aborting the install steps. So check its exit status in this unlikely scenario. Reported-by: Diego Elio Pettenò <flameeyes@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-11-25scripts/genksyms: fix header usageArnaud Lacombe2-2/+2
FreeBSD does not like <malloc.h> when __STDC__ is defined, use the standard <stdlib.h> instead. Signed-off-by: Arnaud Lacombe <lacombar@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-11-11fixdep: use hash table instead of a single arrayEric Dumazet1-48/+61
I noticed fixdep uses ~2% of cpu time in kernel build, in function use_config() fixdep spends a lot of cpu cycles in linear searches in its internal string array. With about 400 stored strings per dep file, this begins to be noticeable. Convert fixdep to use a hash table. kbuild results on my x86_64 allmodconfig Before patch : real 10m30.414s user 61m51.456s sys 8m28.200s real 10m12.334s user 61m50.236s sys 8m30.448s real 10m42.947s user 61m50.028s sys 8m32.380s After: real 10m8.180s user 61m22.506s sys 8m32.384s real 10m35.039s user 61m21.654s sys 8m32.212s real 10m14.487s user 61m23.498s sys 8m32.312s Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-10-31Merge branches 'irq-core-for-linus' and 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tipLinus Torvalds1-6/+2
* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: genirq: Fix up irq_node() for irq_data changes. genirq: Add single IRQ reservation helper genirq: Warn if enable_irq is called before irq is set up * 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: semaphore: Remove mutex emulation staging: Final semaphore cleanup jbd2: Convert jbd2_slab_create_sem to mutex hpfs: Convert sbi->hpfs_creation_de to mutex Fix up trivial change/delete conflicts with deleted 'dream' drivers (drivers/staging/dream/camera/{mt9d112.c,mt9p012_fox.c,mt9t013.c,s5k3e2fx.c})
2010-10-30semaphore: Remove mutex emulationThomas Gleixner1-6/+2
Semaphores used as mutexes have been deprecated for years. Now that all users are either converted to real semaphores or to mutexes remove the cruft. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Christoph Hellwig <hch@infradead.org> LKML-Reference: <20100907125057.562399240@linutronix.de>
2010-10-29Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-kconfigLinus Torvalds1-7/+36
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-kconfig: kconfig: Have streamline_config process menuconfigs too kconfig: Fix streamline_config to read multi line deps in Kconfig files kconfig: Fix missing declaration of variable $dir in streamline_config.pl kconfig: Fix variable name typo %prompts in streamline_config.pl kconfig: Make localmodconfig handle environment variables
2010-10-29ftrace/MIPS: Add module support for C version of recordmcountWu Zhangjin2-4/+57
Since MIPS modules' address space differs from the core kernel space, to access the _mcount in the core kernel, the kernel functions in modules must use long call (-mlong-calls): load the _mcount address into one register and jump to the address stored by the register: c: 3c030000 lui v1,0x0 <--------> b label c: R_MIPS_HI16 _mcount c: R_MIPS_NONE *ABS* c: R_MIPS_NONE *ABS* 10: 64630000 daddiu v1,v1,0 10: R_MIPS_LO16 _mcount 10: R_MIPS_NONE *ABS* 10: R_MIPS_NONE *ABS* 14: 03e0082d move at,ra 18: 0060f809 jalr v1 label: In the old Perl version of recordmcount, we only need to record the position of the 1st R_MIPS_HI16 type of _mcount, and later, in ftrace_make_nop(), replace the instruction in this position by a "b label" and in ftrace_make_call(), replace it back. But, the default C version of recordmcount records all of the _mcount symbols, so, we must filter the 2nd _mcount like the Perl version of recordmcount does. The C version of recordmcount copes with the symbols before they are linked, So It doesn't know the type of the symbols and therefore can not filter the symbols as the Perl version of recordmcount does. But as we can see above, the 2nd _mcount symbols of the long call alawys follows the 1st _mcount symbol of the same long call, which means the offset from the 1st to the 2nd is fixed, it is 0x10-0xc = 4 here, 4 is the length of the 1st load instruciton, for MIPS has fixed length of instructions, this offset is always 4. And as we know, the _mcount is inserted into the entry of every kernel function, the offset between the other _mcount's is expected to be always bigger than 4. So, to filter the 2ns _mcount symbol of the long call, we can simply check the offset between two _mcount symbols, If it is 4, then, filter the 2nd _mcount symbol. To avoid touching too much code, an 'empty' function fn_is_fake_mcount() is added for all of the archs, and the specific archs can override it via chaning the function pointer: is_fake_mcount in do_file() with the e_machine. e.g. This patch adds MIPS_is_fake_mcount() to override the default fn_is_fake_mcount() pointed by is_fake_mcount. This fn_is_fake_mcount() checks if the _mcount symbol is fake, e.g. the 2nd _mcount symbol of the long call is fake, for there are 2 _mcount symbols mapped to one real mcount call, so, one of them is fake and must be filtered. This fn_is_fake_mcount() is called in sift_rel_mcount() after finding the _mcount symbols and before adding the _mcount symbol into mrelp, so, it can prevent the fake mcount symbol going into the last __mcount_loc table. Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> LKML-Reference: <b866f0138224340a132d31861fa3f9300dee30ac.1288176026.git.wuzhangjin@gmail.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-10-29ftrace/MIPS: Add MIPS64 support for C version of recordmcountJohn Reiser2-4/+71
MIPS64 has 'weird' Elf64_Rel.r_info[1,2], which must be used instead of the generic Elf64_Rel.r_info, otherwise, the C version of recordmcount will not work for "segmentation fault". Usage of "union mips_r_info" and the functions MIPS64_r_sym() and MIPS64_r_info() written by Maciej W. Rozycki <macro@linux-mips.org> ---- [1] http://techpubs.sgi.com/library/manuals/4000/007-4658-001/pdf/007-4658-001.pdf [2] arch/mips/include/asm/module.h Tested-by: Wu Zhangjin <wuzhangjin@gmail.com> Signed-off-by: John Reiser <jreiser@BitWagon.com> Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org> LKML-Reference: <AANLkTinwXjLAYACUfhLYaocHD_vBbiErLN3NjwN8JqSy@mail.gmail.com> LKML-Reference: <910dc2d5ae1ed042df4f96815fe4a433078d1c2a.1288176026.git.wuzhangjin@gmail.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2010-10-29kconfig: Have streamline_config process menuconfigs tooSteven Rostedt1-2/+2
Some menuconfigs in the Kconfig files have prompts and dependencies. Currently, streamline_config misses these, and this can cause streamline_config to keep modules enabled that should not be, and even worse, not enable those that should. This patch makes streamline_config process menuconfigs just like it would process a config. Reported-by: member graysky <graysky@archlinux.us> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-10-29kconfig: Fix streamline_config to read multi line deps in Kconfig filesSteven Rostedt1-1/+18
I noticed that some Kconfig files have multi line dependencies that continue with a backslash. Those dependencies on the next line will be missed by streamline_config. For example: config CS89x0 tristate "CS89x0 support" depends on NET_ETHERNET && (ISA || EISA || MACH_IXDP2351 \ || ARCH_IXDP2X01 || MACH_MX31ADS) The "|| ARCH_IXDP2X01 || MACH_MX31ADS)" will not be processed. This patch adds code to handle this case. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-10-29kconfig: Fix missing declaration of variable $dir in streamline_config.plhiromu1-1/+3
On Fri, Aug 17, 2010 at 01:43PM +0800, Américo Wang wrote: > Acked-by: WANG Cong <xiyou.wangcong@gmail.com> > > BTW, I think we should add "use strict;" too. Then I added "use strict;" to streamline_config.pl, I saw another warning. > Global symbol "$dir" requires explicit package name at scripts/kconfig/streamline_config.pl line 286. > Global symbol "$dir" requires explicit package name at scripts/kconfig/streamline_config.pl line 287. > Global symbol "$dir" requires explicit package name at scripts/kconfig/streamline_config.pl line 288. Then I added "my $dir;" to line 285. Cc: Américo Wang <xiyou.wangcong@gmail.com> Cc: Toralf Foerster <toralf.foerster@gmx.de> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: Hiromu Yakura <hiromu1996@gmail.com> LKML-Reference: <1282042158.7160.9.camel@hiromu-Macbook> [ changed to just add my in front of $dir instead of new line ] Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-10-29kconfig: Fix variable name typo %prompts in streamline_config.plhiromu yagura1-2/+2
When I added "use strict;" to streamline_config.pl, I saw the following warnings: > Global symbol "%prompt" requires explicit package name at scripts/kconfig/streamline_config.pl line 183. > Global symbol "%prompt" requires explicit package name at scripts/kconfig/streamline_config.pl line 368. The declaration of %prompt was incorrect, and should have been %prompts. Cc: Toralf Foerster <toralf.foerster@gmx.de> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: Hiromu Yakura <hiromu1996@gmail.com> LKML-Reference: <1281845597.11566.5.camel@camp10-laptop> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-10-29kconfig: Make localmodconfig handle environment variablesSteven Rostedt1-1/+11
The commit 838a2e55e6a4e9e8a10451ed2ef0f7a08dabdb04 kbuild: migrate all arch to the kconfig mainmenu upgrade Broke make localmodconfig. The reason was that it added a environment variable to the kconfig source, which the streamline_config.pl could not handle. This patch changes streamline_config.pl to handle kconfig sources using environment variables in their names. Cc: Arnaud Lacombe <lacombar@gmail.com> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Michal Marek <mmarek@suse.cz> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2010-10-28Merge branch 'packaging' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6Linus Torvalds2-2/+4
* 'packaging' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: scripts/package: don't break if %{_smp_mflags} isn't set kbuild, deb-pkg: Check if KBUILD_IMAGE exists before copying it
2010-10-28Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6Linus Torvalds26-92/+1196
* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: (39 commits) Revert "namespace: add source file location exceptions" Coccinelle: Add contextual message Coccinelle: Fix documentation Coccinelle: Find doubled arguments to boolean or bit operators. Coccinelle: Find nested lock+irqsave functions that use the same flags variables. namespace: add source file location exceptions scripts/extract-ikconfig: add support for bzip2, lzma and lzo kbuild: check return value of asprintf() scripts/namespace.pl: improve to get more correct results scripts/namespace.pl: some bug fixes scripts/namespace.pl: update file exclusion list scripts/namespace.pl: fix wrong source path Coccinelle: Use the -no_show_diff option for org and report mode Coccinelle: Add a new mode named 'chain' Coccinelle: Use new comment format to explain kfree.cocci Coccinelle: Improve user information with a new kind of comment Coccinelle: Update documentation MAINTAINERS: Coccinelle: Update email address Documentation/kbuild: modules.txt cleanup Documentation/kbuild: major edit of modules.txt sections 5-8 ...
2010-10-28Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6Linus Torvalds23-816/+932
* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: (38 commits) kbuild: convert `arch/tile' to the kconfig mainmenu upgrade README: cite nconfig Revert "kconfig: Temporarily disable dependency warnings" kconfig: Use PATH_MAX instead of 128 for path buffer sizes. kconfig: Fix realloc usage() kconfig: Propagate const kconfig: Don't go out from read config loop when you read new symbol kconfig: fix menuconfig on debian lenny kbuild: migrate all arch to the kconfig mainmenu upgrade kconfig: expand file names kconfig: use the file's name of sourced file kconfig: constify file name kconfig: don't emit warning upon rootmenu's prompt redefinition kconfig: replace KERNELVERSION usage by the mainmenu's prompt kconfig: delay gconf window initialization kconfig: expand by default the rootmenu's prompt kconfig: add a symbol string expansion helper kconfig: regen parser kconfig: implement the `mainmenu' directive kconfig: allow PACKAGE to be defined on the compiler's command-line ... Fix up trivial conflict in arch/mn10300/Kconfig
2010-10-28Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6Linus Torvalds5-10/+15
* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: initramfs: Fix build break on symbol-prefixed archs initramfs: fix initramfs size calculation initramfs: generalize initramfs_data.xxx.S variants scripts/kallsyms: Enable error messages while hush up unnecessary warnings scripts/setlocalversion: update comment kbuild: Use a single clean rule for kernel and external modules kbuild: Do not run make clean in $(srctree) scripts/mod/modpost.c: fix commentary accordingly to last changes kbuild: Really don't clean bounds.h and asm-offsets.h
2010-10-28initramfs: Fix build break on symbol-prefixed archsMike Frysinger1-1/+3
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-10-28Revert "namespace: add source file location exceptions"Michal Marek1-24/+0
This reverts commit 24a54f7974a616385b96cd939e004592e2cea484. Stephen Hemminger <shemminger@vyatta.com> writes: > That patch should not be included. It causes more problems than it > solves, since then there are duplicate file locations which causes > false duplicate symbol reports. Reported-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-10-28Merge branch 'message-callback' into kbuild/kconfigMichal Marek3-48/+40
Conflicts: scripts/kconfig/nconf.c
2010-10-28Coccinelle: Add contextual messageNicolas Palix1-3/+13
Change the message displayed to the user according to the current mode used. Fix trailing white-space and spelling Signed-off-by: Nicolas Palix <npalix.work@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-10-28Coccinelle: Find doubled arguments to boolean or bit operators.Julia Lawall2-0/+94
Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Nicolas Palix <npalix.work@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-10-28Coccinelle: Find nested lock+irqsave functions that use the same flags variables.Julia Lawall1-0/+80
Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Nicolas Palix <npalix.work@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-10-28namespace: add source file location exceptionsStephen Hemminger1-0/+24
Teach namespace checker about some special case files where the source is in unusual location. This fixes many of the source file not found errors (more can be added), and also prevents false positives for functions not being used. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-10-28scripts/extract-ikconfig: add support for bzip2, lzma and lzoDick Streefland1-14/+27
Add support for kernels compressed with bzip2, lzma or lzo to the extract-ikconfig script. Fixes kernel bugzilla #19852: https://bugzilla.kernel.org/show_bug.cgi?id=19852 Signed-off-by: Dick Streefland <dick@streefland.net> Tested-by: Justin <jlec@gentoo.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-10-28kbuild: check return value of asprintf()Namhyung Kim1-1/+4
Check return value of asprintf() in docsect() and exit if error occurs. This removes following warning: HOSTCC scripts/basic/docproc scripts/basic/docproc.c: In function ‘docsect’: scripts/basic/docproc.c:336: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result Signed-off-by: Namhyung Kim <namhyung@gmail.com> Acked-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-10-28Merge commit 'v2.6.36' into kbuild/miscMichal Marek44-807/+1893
Update to be able to fix a recent change to scripts/basic/docproc.c (commit eda603f).
2010-10-28scripts/namespace.pl: improve to get more correct resultsAmerigo Wang1-9/+12
Exclude more symbols from arch/x86/vdso/ and arch/x86/boot/; add some more linker-defined symbols into exception list; add other cond_syscalls besides "sys_*". Signed-off-by: Amerigo Wang <amwang@redhat.com> Cc: Stephen Hemminger <shemminger@vyatta.com> Cc: Michal Marek <mmarek@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-10-28scripts/namespace.pl: some bug fixesAmerigo Wang1-7/+10
1. Teach namespace.pl to understand "V" and "v" 2. cond_syscalls are moved into kernel/sys_ni.c Signed-off-by: Amerigo Wang <amwang@redhat.com> Cc: Stephen Hemminger <shemminger@vyatta.com> Cc: Michal Marek <mmarek@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-10-28scripts/namespace.pl: update file exclusion listStephen Hemminger1-47/+56
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Amerigo Wang <amwang@redhat.com> Cc: Michal Marek <mmarek@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-10-28scripts/namespace.pl: fix wrong source pathAmerigo Wang1-4/+4
File::Find will do chdir automatically, so we need to get the absolute patch with $File::Find::dir. Reported-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Amerigo Wang <amwang@redhat.com> Cc: Michal Marek <mmarek@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
2010-10-26scripts/checkpatch.pl: add check for declaration of pci_device_idJoe Perches1-0/+5
Signed-off-by: Joe Perches <joe@perches.com> Cc: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-26scripts/checkpatch.pl: add warnings for static char that could be static const charJoe Perches1-0/+12
Add warnings for possible missing const uses of static char foo[] = "bar" that could be static const char foo[] = "bar" and static const char *foo[] = {"bar", "baz"} that could be static const char * const foo[] = {"bar", "baz"} Signed-off-by: Joe Perches <joe@perches.com> Cc: Mike Frysinger <vapier.adi@gmail.com> Cc: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-26checkpatch: version 0.31Andy Whitcroft1-1/+1
Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-26checkpatch: statement/block context analyser should look at sanitised linesAndy Whitcroft1-6/+6
When tracking context to find a block or statement we need to use the sanitised lines, else perentheses '(' & ')' and braces '{' & '}' can throw the scanner out. Also fix up a couple of error outputs which include those sanitised lines incorrectly. Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-26checkpatch: handle EXPORT_SYMBOL for DEVICE_ATTR and similarAndy Whitcroft1-1/+10
Handly definitions similar to below. The definition macro spits out a symbol with a prefix. Add matching of any identifier prefix: DEVICE_ATTR(link_power_management_policy, S_IRUGO | S_IWUSR, ata_scsi_lpm_show, ata_scsi_lpm_put); EXPORT_SYMBOL_GPL(dev_attr_link_power_management_policy); Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-26checkpatch: clean up structure definition macro handlineAndy Whitcroft1-2/+2
Handle definitions such as the following correctly, it is not a complex statement: #define PREALLOC(NAME, START, END, FLAGS) { \ .name = (NAME), \ .start = (START), \ .end = (END), \ .flags = (FLAGS) \ }, Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-26checkpatch: update copyright datesAndy Whitcroft1-1/+1
Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-26checkpatch: Add additional attribute #definesJoe Perches1-0/+14
On Wed, 2010-08-11 at 12:35 -0400, Dave Jones wrote: > I just got this from a patch I merged.. > > ERROR: need consistent spacing around '*' (ctx:WxV) > #121: FILE: arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c:113: > +static struct pcc_cpu __percpu *pcc_cpu_info; > ^ > which doesn't seem right. Perhaps these need to be added to checkpatch. [apw@canonical.com: added tests] Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andy Whitcroft <apw@canonical.com> Cc: Dave Jones <davej@codemonkey.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-26checkpatch: check for incorrect permissionsRabin Vincent1-1/+13
Throw an error when a source file has been given execute permissions using the mode change line present in git diffs. Also alow the filename matching to use the "diff" line in addition to the "+++" line, since the mode change lines appear before any "+++" lines. [apw@canonical.com: simplified filename logic slightly, added tests] Cc: Andy Whitcroft <apw@canonical.com> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-26checkpatch: ensure kconfig help checks only apply when we are adding helpAndy Whitcroft1-5/+21
When checking the length of the help we need to be sure we are seeing the whole story before erroring. Firstly we only want to check when adding the help in the first place. Second we need to be sure that we are seeing the end of the entry, nominally when there is no context below or that context shows the start of the next entry. Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-26checkpatch: simplify and consolidate "missing space after" checksAndy Whitcroft1-10/+5
Commonise the code for missing spaces after struct, union, and enum such that they share the same code. Ensure we cover all the common cases in each case. Check against the sanitised line to ensure we do not report on comments and strings. Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-26checkpatch: add check for space after struct, union, and enumAndy Whitcroft1-0/+10
Add spacing checks for struct, union, and enum definitions. Check the spacing after type and before the equals (=) and open brace ({). Based on a patch by Joe Perches. Cc: Joe Perches <joe@perches.com> Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>