aboutsummaryrefslogtreecommitdiff
path: root/scripts
AgeCommit message (Collapse)AuthorFilesLines
2011-05-16ftrace/recordmcount: Modify only executable sectionsSteven Rostedt1-0/+1
PROGBITS is not enough to determine if the section should be modified or not. Only process sections that are marked as executable. Cc: John Reiser <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Steven Rostedt <[email protected]>
2011-05-16ftrace: Add .kprobe.text section to whitelist for recordmcount.cSteven Rostedt2-0/+2
The .kprobe.text section is safe to modify mcount to nop and tracing. Add it to the whitelist in recordmcount.c and recordmcount.pl. Cc: John Reiser <[email protected]> Cc: Masami Hiramatsu <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Steven Rostedt <[email protected]>
2011-05-16ftrace/trivial: Clean up record mcount to use Linux switch styleSteven Rostedt1-21/+22
The Linux style for switch statements is: switch (var) { case x: [...] break; } Not: switch (var) { case x: { [...] } break; Cc: John Reiser <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Steven Rostedt <[email protected]>
2011-05-16ftrace/trivial: Clean up recordmcount.c to use Linux style comparisonsSteven Rostedt2-32/+32
The Linux ftrace subsystem style for comparing is: var == 1 var > 0 and not: 1 == var 0 < var It is considered that Linux developers are smart enough not to do the if (var = 1) mistake. Cc: John Reiser <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Steven Rostedt <[email protected]>
2011-05-16kbuild: make KBUILD_NOCMDDEP=1 handle empty built-in.oMichal Marek1-0/+2
Based on a patch by Rabin Vincent. Fix building with KBUILD_NOCMDDEP=1, which currently does not work because it does not build built-in.o with no dependencies: LD fs/notify/built-in.o ld: cannot find fs/notify/dnotify/built-in.o: No such file or directory ld: cannot find fs/notify/inotify/built-in.o: No such file or directory ld: cannot find fs/notify/fanotify/built-in.o: No such file or directory Reported-and-tested-by: Rabin Vincent <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2011-05-12scripts/kallsyms.c: fix potential segfaultXiaochen Wang1-0/+2
Description: This bug hardly appears during real kernel compiling, because the vmlinux symbols table is huge. But we can still catch it under strict condition , as follows. $ echo "c101b97b T do_fork" | ./scripts/kallsyms --all-symbols #include <asm/types.h> ...... ...... .globl kallsyms_token_table ALGN kallsyms_token_table: Segmentation fault (core dumped) $ If symbols table is small, all entries in token_profit[0x10000] may decrease to 0 after several calls of compress_symbols() in optimize_result(). In that case, find_best_token() always return 0 and best_table[i] is set to "\0\0" and best_table_len[i] is set to 2. As a result, expand_symbol(best_table[0]="\0\0", best_table_len[0]=2, buf) in write_src() will run in infinite recursion until stack overflows, causing segfault. This patch checks the find_best_token() return value. If all entries in token_profit[0x10000] become 0 according to return value, it breaks the loop in optimize_result(). And expand_symbol() works well when best_table_len[i] is 0. Signed-off-by: Xiaochen Wang <[email protected]> Acked-by: Paulo Marques <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2011-05-12scripts/gen_initramfs_list.sh: Convert to a /bin/sh scriptJamey Sharp1-7/+7
Replace bashisms with POSIX-compatible shell scripting. Notably, de-duplicate '/' using a sed command from elsewhere in the same script rather than "${name//\/\///}". Commit by Jamey Sharp and Josh Triplett. Signed-off-by: Jamey Sharp <[email protected]> Signed-off-by: Josh Triplett <[email protected]> Cc: Andrew Morton <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2011-05-10bcma: add Broadcom specific AMBA bus driverRafał Miłecki1-0/+22
Broadcom has released cards based on a new AMBA-based bus type. From a programming point of view, this new bus type differs from AMBA and does not use AMBA common registers. It also differs enough from SSB. We decided that a new bus driver is needed to keep the code clean. In its current form, the driver detects devices present on the bus and registers them in the system. It allows registering BCMA drivers for specified bus devices and provides them basic operations. The bus driver itself includes two important bus managing drivers: ChipCommon core driver and PCI(c) core driver. They are early used to allow correct initialization. Currently code is limited to supporting buses on PCI(e) devices, however the driver is designed to be used also on other hosts. The host abstraction layer is implemented and already used for PCI(e). Support for PCI(e) hosts is working and seems to be stable (access to 80211 core was tested successfully on a few devices). We can still optimize it by using some fixed windows, but this can be done later without affecting any external code. Windows are just ranges in MMIO used for accessing cores on the bus. Cc: Greg KH <[email protected]> Cc: Michael Büsch <[email protected]> Cc: Larry Finger <[email protected]> Cc: George Kashperko <[email protected]> Cc: Arend van Spriel <[email protected]> Cc: [email protected] Cc: Russell King <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Andy Botting <[email protected]> Cc: linuxdriverproject <[email protected]> Cc: [email protected] <[email protected]> Signed-off-by: Rafał Miłecki <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2011-05-04Replace '-' in kernel version with '_'Arun Sharma2-2/+2
Removing the '-' results in hard to read filenames such as: kernel-2.6.35.2000042g76e4caf-28.x86_64.rpm kernel-2.6.35.2_000042_g76e4caf-28.x86_64.rpm is easier to read. Signed-off-by: Arun Sharma <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2011-05-03kbuild: Fix passing -Wno-* options to gcc 4.4+Michal Marek1-0/+5
Starting with 4.4, gcc will happily accept -Wno-<anything> in the cc-option test and complain later when compiling a file that has some other warning. This rather unexpected behavior is intentional as per http://gcc.gnu.org/PR28322, so work around it by testing for support of the opposite option (without the no-). Introduce a new Makefile function cc-disable-warning that does this and update two uses of cc-option in the toplevel Makefile. Reported-and-tested-by: Stephen Rothwell <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2011-05-02kbuild: move scripts/basic/docproc.c to scripts/docproc.cPeter Foley5-6/+7
Move docproc from scripts/basic to scripts so it is only built for *doc targets instead of every time the kernel is built.
2011-05-02kbuild: Fix Makefile.asm-generic for umMichal Marek1-1/+1
Do nothing if arch/$(SRCARCH)/include/asm/Kbuild does not exist, which is the case of um. Reported-by: Randy Dunlap <[email protected]> Signed-off-by: Michal Marek <[email protected]> Acked-by: Randy Dunlap <[email protected]> Acked-by: Sam Ravnborg <[email protected]>
2011-05-02kbuild: Allow to combine multiple W= levelsMichal Marek1-2/+6
Add support for make W=12, make W=123 and so on, to enable warnings from multiple W= levels. Normally, make W=<level> does not include warnings from the previous level. Signed-off-by: Michal Marek <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Reviewed-By: Valdis Kletnieks <[email protected]>
2011-04-29kbuild: Disable -Wunused-but-set-variable for gcc 4.6.0Dave Jones1-0/+1
Disable the new -Wunused-but-set-variable that was added in gcc 4.6.0 It produces more false positives than useful warnings. This can still be enabled using W=1 Signed-off-by: Dave Jones <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Tested-by: Sam Ravnborg <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2011-04-29Fix handling of backlash character in LINUX_COMPILE_BY nameMarcin Nowakowski1-1/+1
When using a domain login, `whoami` returns the login in user\domain format. This leads to either warnings on unrecognised escape sequences or escaped characters being generated for the user. This patch ensures that any backslash is escaped to a double-backslash to make sure the name is preserved correctly. This patch does not enforce escaping on the KBUILD_BUILD_USER variable, as this is something the user has control of and can escape if required. Signed-off-by: Marcin Nowakowski <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2011-04-29kbuild: don't warn about include/linux/version.h not including itselfPeter Foley1-0/+1
This patch makes checkversion.pl not warn that include/linux/version.h dosen't include itself. Signed-off-by: Peter Foley <[email protected]> [mmarek: simplified to use 'next if' syntax] Signed-off-by: Michal Marek <[email protected]>
2011-04-29kconfig: quiet commands when V=0Peter Foley1-2/+2
Signed-off-by: Peter Foley <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2011-04-29kconfig: change update-po-config to reflect new layout of arch/umPeter Foley1-2/+2
Signed-off-by: Peter Foley <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2011-04-29kconfig: make update-po-config work in KBUILD_OUTPUTPeter Foley1-7/+9
Signed-off-by: Peter Foley <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2011-04-29kconfig: rearrange clean-filesPeter Foley1-2/+2
Signed-off-by: Peter Foley <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2011-04-29kconfig: change gconf to modify hostprogs-y like nconf and mconfPeter Foley1-2/+3
Signed-off-by: Peter Foley <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2011-04-29kconfig: change qconf to modify hostprogs-y like nconf and mconfPeter Foley1-3/+4
Signed-off-by: Peter Foley <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2011-04-29kconfig: only build kxgettext when neededPeter Foley1-1/+5
Signed-off-by: Peter Foley <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2011-04-28kbuild: asm-generic supportSam Ravnborg2-1/+32
There is an increasing amount of header files shared between individual architectures in asm-generic. To avoid a lot of dummy wrapper files that just include the corresponding file in asm-generic provide some basic support in kbuild for this. With the following patch an architecture can maintain a list of files in the file arch/$(ARCH)/include/asm/Kbuild To use a generic file just add: generic-y += <name-of-header-file.h> For each file listed kbuild will generate the necessary wrapper in arch/$(ARCH)/include/generated/asm. When installing userspace headers a wrapper is likewise created. The original inspiration for this came from the unicore32 patchset - although a different method is used. The patch includes several improvements from Arnd Bergmann. Michael Marek contributed Makefile.asm-generic. Remis Baima did an intial implementation along to achive the same - see https://patchwork.kernel.org/patch/13352/ Signed-off-by: Sam Ravnborg <[email protected]> Acked-by: Guan Xuetao <[email protected]> Tested-by: Guan Xuetao <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Cc: Remis Lima Baima <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2011-04-28kbuild: implement several W= levelsSam Ravnborg1-27/+38
Building a kernel with "make W=1" produces far too much noise to be useful. Divide the warning options in three groups: W=1 - warnings that may be relevant and does not occur too often W=2 - warnings that occur quite often but may still be relevant W=3 - the more obscure warnings, can most likely be ignored When building the whole kernel, those levels produce: W=1 - 4859 warnings W=2 - 1394 warnings W=3 - 86666 warnings respectively. Warnings have been counted with Geert's script at http://www.kernel.org/pub/linux/kernel/people/geert/linux-log/linux-log-summary.pl Many warnings occur from .h files so fixing one file may have a nice effect on the total number of warnings. With these changes I am actually tempted to try W=1 now and then. Previously there was just too much noise. Borislav: - make the W= levels exclusive - move very noisy and making little sense for the kernel warnings to W=3 - drop -Woverlength-strings due to useless warning message - copy explanatory text for the different warning levels to 'make help' - recount warnings per level Signed-off-by: Sam Ravnborg <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Cc: Dave Jones <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2011-04-24kconfig: Avoid buffer underrun in choice inputBen Hutchings1-1/+1
Commit 40aee729b350 ('kconfig: fix default value for choice input') fixed some cases where kconfig would select the wrong option from a choice with a single valid option and thus enter an infinite loop. However, this broke the test for user input of the form 'N?', because when kconfig selects the single valid option the input is zero-length and the test will read the byte before the input buffer. If this happens to contain '?' (as it will in a mips build on Debian unstable today) then kconfig again enters an infinite loop. Signed-off-by: Ben Hutchings <[email protected]> Cc: [email protected] [2.6.17+] Signed-off-by: Linus Torvalds <[email protected]>
2011-04-20kbuild: Fix build with binutils <= 2.19Michal Marek2-2/+7
The D option of ar is only available in newer versions. Signed-off-by: Michal Marek <[email protected]>
2011-04-19nconfig: Silence unused return values from wattrsetStephen Boyd1-7/+7
Ignore the return value from wattrset since we ignore the return value in nconf.gui.c as well. scripts/kconfig/nconf.c: In function 'print_function_line': scripts/kconfig/nconf.c:376: warning: value computed is not used scripts/kconfig/nconf.c:380: warning: value computed is not used scripts/kconfig/nconf.c:387: warning: value computed is not used scripts/kconfig/nconf.c: In function 'show_menu': scripts/kconfig/nconf.c:956: warning: value computed is not used scripts/kconfig/nconf.c:961: warning: value computed is not used scripts/kconfig/nconf.c:963: warning: value computed is not used scripts/kconfig/nconf.c:965: warning: value computed is not used Cc: Nir Tzachar <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2011-04-18initramfs: Use KBUILD_BUILD_TIMESTAMP for generated entriesMichal Marek1-1/+8
gen_init_cpio gets the current time and uses it for each symlink, special file, and directory. Grab the current time once and make it possible to override it with the KBUILD_BUILD_TIMESTAMP variable for reproducible builds. Signed-off-by: Michal Marek <[email protected]>
2011-04-18kbuild: Allow to override LINUX_COMPILE_BY and LINUX_COMPILE_HOST macrosMichal Marek1-2/+12
Make it possible to override the user@host string displayed during boot and in /proc/version by the environment variables KBUILD_BUILD_USER and KBUILD_BUILD_HOST. Several distributions patch scripts/mkcompile_h to achieve this, so let's provide an official way. Also, document the KBUILD_BUILD_TIMESTAMP variable while at it. Signed-off-by: Michal Marek <[email protected]>
2011-04-18kbuild: Drop unused LINUX_COMPILE_TIME and LINUX_COMPILE_DOMAIN macrosMichal Marek1-14/+2
Signed-off-by: Michal Marek <[email protected]>
2011-04-18kbuild: Use the deterministic mode of arMichal Marek1-2/+2
Signed-off-by: Michal Marek <[email protected]>
2011-04-18kbuild: Call gzip with -nMichal Marek2-3/+3
The timestamps recorded in the .gz files add no value. Signed-off-by: Michal Marek <[email protected]>
2011-04-18kconfig: Do not record timestamp in auto.conf and autoconf.hMichal Marek1-6/+2
Timestamps in file data are useless and there is already one in .config Signed-off-by: Michal Marek <[email protected]>
2011-04-15kconfig: get rid of unused flagsYann E. MORIN3-12/+0
Now that we detect recusrion of sourced files, get rid of now unused flags. Regenerate lex.zconf.c_shipped file. Signed-off-by: "Yann E. MORIN" <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2011-04-15kconfig: allow multiple inclusion of the same fileYann E. MORIN2-20/+38
Allow 'source'ing the same file from multiple places (eg. from different files, and/or under different conditions). To avoid circular inclusion, scan the source-ancestry of the current file, and abort if already sourced in this branch. Regenerate the pre-parsed lex.zconf.c_shipped file. Signed-off-by: "Yann E. MORIN" <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2011-04-08kconfig: Avoid buffer underrun in choice inputBen Hutchings1-1/+1
commit 40aee729b350672c2550640622416a855e27938f ('kconfig: fix default value for choice input') fixed some cases where kconfig would select the wrong option from a choice with a single valid option and thus enter an infinite loop. However, this broke the test for user input of the form 'N?', because when kconfig selects the single valid option the input is zero-length and the test will read the byte before the input buffer. If this happens to contain '?' (as it will in a mips build on Debian unstable today) then kconfig again enters an infinite loop. Signed-off-by: Ben Hutchings <[email protected]> Cc: [email protected] [2.6.17+] Signed-off-by: Michal Marek <[email protected]>
2011-04-04eradicate bashisms in scripts/patch-kernelAndreas Mohr1-1/+1
Silence a remaining annoying (or worse, irritating - "is my entire patched tree broken now!?") bashism-related message that occurs when /bin/sh is configured to instead deploy dash, a POSIX-compliant shell, as is the pretty much standard case on e.g. Debian. Current kernel version is 2.6.38 ( Flesh-Eating Bats with Fangs) ===> linux-2.6.38.patch-kernel_test/scripts/patch-kernel: line 253: [: =: unary operator expected <=== cannot find patch file: patch-2.6.39 Signed-off-by: Andreas Mohr <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2011-03-31Fix common misspellingsLucas De Marchi8-11/+11
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <[email protected]>
2011-03-22bloat-o-meter: include read-only data section in reportJean Delvare1-1/+3
I'm not sure why the read-only data section is excluded from the report, it seems as relevant as the other data sections (b and d). I've stripped the symbols starting with __mod_ as they can have their names dynamically generated and thus comparison between binaries is not possible. Signed-off-by: Jean Delvare <[email protected]> Cc: Andi Kleen <[email protected]> Acked-by: Nathan Lynch <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22checkpatch: warn about memset with swapped argumentsDave Jones1-0/+5
Because the second and third arguments of memset have the same type, it turns out to be really easy to mix them up. This bug comes up time after time, so checkpatch should really be checking for it at patch submission time. Signed-off-by: Dave Jones <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Andy Whitcroft <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22scripts/checkpatch.pl: reset rpt_cleaners warningsMike Frysinger1-0/+1
If you run checkpatch against multiple patches, and one of them has a whitespace issue which can be helped via a script (rpt_cleaners), you will see the same NOTE over and over for all subsequent patches. It makes it seem like those patches also have whitespace problems when in reality, there's only one or two bad apples. So reset rpt_cleaners back to 0 after we've issued the note so that it only shows up near the patch with the actual problems. Signed-off-by: Mike Frysinger <[email protected]> Cc: Andy Whitcroft <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22kstrto*: converting strings to integers done (hopefully) rightAlexey Dobriyan1-2/+2
1. simple_strto*() do not contain overflow checks and crufty, libc way to indicate failure. 2. strict_strto*() also do not have overflow checks but the name and comments pretend they do. 3. Both families have only "long long" and "long" variants, but users want strtou8() 4. Both "simple" and "strict" prefixes are wrong: Simple doesn't exactly say what's so simple, strict should not exist because conversion should be strict by default. The solution is to use "k" prefix and add convertors for more types. Enter kstrtoull() kstrtoll() kstrtoul() kstrtol() kstrtouint() kstrtoint() kstrtou64() kstrtos64() kstrtou32() kstrtos32() kstrtou16() kstrtos16() kstrtou8() kstrtos8() Include runtime testsuite (somewhat incomplete) as well. strict_strto*() become deprecated, stubbed to kstrto*() and eventually will be removed altogether. Use kstrto*() in code today! Note: on some archs _kstrtoul() and _kstrtol() are left in tree, even if they'll be unused at runtime. This is temporarily solution, because I don't want to hardcode list of archs where these functions aren't needed. Current solution with sizeof() and __alignof__ at least always works. Signed-off-by: Alexey Dobriyan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22get_maintainer.pl: allow "K:" pattern tests to match non-patch textJoe Perches1-1/+10
Extend the usage of the K section in the MAINTAINERS file to support matching regular expressions to any arbitrary text that may precede the patch itself. For example, the commit message or mail headers generated by git-format-patch. Signed-off-by: Joe Perches <[email protected]> Original-patch-by: L. Alberto Giménez <[email protected]> Acked-by: L. Alberto Giménez <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-21Merge branch 'kbuild' of ↵Linus Torvalds12-935/+1226
git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: kbuild: Make DEBUG_SECTION_MISMATCH selectable, but not on by default genksyms: Regenerate lexer and parser genksyms: Track changes to enum constants genksyms: simplify usage of find_symbol() genksyms: Add helpers for building string lists genksyms: Simplify printing of symbol types genksyms: Simplify lexer genksyms: Do not paste the bison header file to lex.c modpost: fix trailing comma KBuild: silence "'scripts/unifdef' is up to date." kbuild: Add extra gcc checks kbuild: reenable section mismatch analysis unifdef: update to upstream version 2.5
2011-03-20Merge branch 'misc' of ↵Linus Torvalds3-9/+23
git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: scripts/extract-ikconfig: add xz compression support kbuild: add GNU GLOBAL tags generation setlocalversion: update mercurial tag parsing
2011-03-20Merge branch 'packaging' of ↵Linus Torvalds2-1/+8
git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6 * 'packaging' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: kbuild: Add make tarxz-pkg build option
2011-03-17Merge branch 'genksyms-enum' into kbuild/kbuildMichal Marek8-863/+988
2011-03-17genksyms: Regenerate lexer and parserMichal Marek3-512/+661
Regenerated the parser after "genksyms: Track changes to enum constants". Signed-off-by: Michal Marek <[email protected]> Acked-by: Sam Ravnborg <[email protected]>
2011-03-17genksyms: Track changes to enum constantsMichal Marek4-13/+127
Enum constants can be used as array sizes; if the enum itself does not appear in the symbol expansion, a change in the enum constant will go unnoticed. Example patch that changes the ABI but does not change the checksum with current genksyms: | enum e { | E1, | E2, |+ E3, | E_MAX | }; | | struct s { | int a[E_MAX]; | } | | int f(struct s *s) { ... } | EXPORT_SYMBOL(f) Therefore, remember the value of each enum constant and expand each occurence to <constant> <value>. The value is not actually computed, but instead an expression in the form (last explicitly assigned value) + N is used. This avoids having to parse and semantically understand whole of C. Note: The changes won't take effect until the lexer and parser are rebuilt by the next patch. Signed-off-by: Michal Marek <[email protected]> Acked-by: Sam Ravnborg <[email protected]>