path: root/scripts
AgeCommit message (Collapse)Author
2013-06-13dtc: ensure #line directives don't consume data from the next lineGrant Likely
Previously, the #line parsing regex ended with ({WS}+[0-9]+)?. The {WS} could match line-break characters. If the #line directive did not contain the optional flags field at the end, this could cause any integer data on the next line to be consumed as part of the #line directive parsing. This could cause syntax errors (i.e. #line parsing consuming the leading 0 from a hex literal 0x1234, leaving x1234 to be parsed as cell data, which is a syntax error), or invalid compilation results (i.e. simply consuming literal 1234 as part of the #line processing, thus removing it from the cell data). Fix this by replacing {WS} with [ \t] so that it can't match line-breaks. Convert all instances of {WS}, even though the other instances should be irrelevant for any well-formed #line directive. This is done for consistency and ultimate safety. [Cherry picked from DTC commit a1ee6f068e1c8dbc62873645037a353d7852d5cc] Reported-by: Ian Campbell <> Signed-off-by: Stephen Warren <> Acked-by: David Gibson <> Signed-off-by: Grant Likely <>
2013-06-13dtc: Update generated files to output from Bison 2.5Grant Likely
This patch merely updates the generated dtc parser and lexer files to the output generated by Bison 2.5. The previous versions were generated from version 2.4.1. The only reason for this commit is to minimize the diff on the next commit which fixes a bug in the DTC #line directive parsing. Otherwise the Bison changes would be intermingled with the functional changes. Signed-off-by: Grant Likely <>
2013-06-13kbuild: make sure we clean up DTB temporary filesIan Campbell
Various temporary files used when building DTB files were not suffixed with .tmp and therefore were not cleaned up by "make clean". Signed-off-by: Ian Campbell <> Reviewed-by: Stephen Warren <> Tested-by: Stephen Warren <> Signed-off-by: Grant Likely <>
2013-05-30Merge branch 'yem-kconfig-rc-fixes' of ↵Michal Marek
git:// into kbuild/rc-fixes
2013-05-30kconfig/menu.c: fix multiple references to expressions in menu_add_prop()Dirk Gouders
menu_add_prop() applies upper menus' visibilities to actual prompts by AND-ing the prompts visibilities with the upper menus ones. This creates a further reference to the menu's visibilities and when the expression reduction functions do their work, they may remove or modify expressions that have multiple references, thus causing unpredictable side-effects. The following example Kconfig constructs a case where this causes problems: a menu and a prompt which's visibilities depend on the same symbol. When invoking mconf with this Kconfig and pressing "Z" we see a problem caused by a free'd expression still referenced by the menu's visibility: ------------------------------------------------------------------------ mainmenu "Kconfig Testing Configuration" config VISIBLE def_bool n config Placeholder bool "Place holder" menu "Invisible" visible if VISIBLE config TEST_VAR bool "Test option" if VISIBLE endmenu ------------------------------------------------------------------------ This patch fixes this problem by creating copies of the menu's visibility expressions before AND-ing them with the prompt's one. Signed-off-by: Dirk Gouders <> [ move variable into its block-scope, keep lines <80 chars, typo] Tested-by: "Yann E. MORIN" <> Reviewed-by: "Yann E. MORIN" <> Signed-off-by: "Yann E. MORIN" <>
2013-05-30mconf: handle keys in empty dialogsDirk Gouders
When entering an empty dialog, using the movement keys resulted in unexpected characters beeing displayed, other keys like "z" and "h" did not work as expected. This patch handles the movement keys as well as other keys, especially "z", "h" and "/". Signed-off-by: Dirk Gouders <> [ keep lines <80 chars, so reorder test] Tested-by: "Yann E. MORIN" <> Reviewed-by: "Yann E. MORIN" <> Signed-off-by: "Yann E. MORIN" <>
2013-05-23kbuild: Don't assume dts files live in arch/*/boot/dtsMatthijs Kooijman
In commit b40b25ff (kbuild: always run gcc -E on *.dts, remove cmd_dtc_cpp), dts building was changed to always use the C preprocessor. This meant that the .dts file passed to dtc is not the original, but the preprocessed one. When compiling with a separate build directory (i.e., with O=), this preprocessed file will not live in the same directory as the original. When the .dts file includes .dtsi files, dtc will look for them in the build directory, not in the source directory and compilation will fail. The commit referenced above tried to fix this by passing arch/*/boot/dts as an include path to dtc. However, for mips, the .dts files are not in this directory, so dts compilation on mips breaks for some targets. Instead of hardcoding this particular include path, this commit just uses the directory of the .dts file that is being compiled, which effectively restores the previous behaviour wrt includes. For most .dts files, this path is just the same as the previous hardcoded arch/*/boot/dts path. This was tested on a mips (rt3052) and an arm (bcm2835) target. Signed-off-by: Matthijs Kooijman <> Reviewed-by: Stephen Warren <> Signed-off-by: Michal Marek <>
2013-05-20scripts/config: fix assignment of parameters for short version of --*-after ↵Clement Chauplannaz
options When --*-after options are used, two parameters are parsed from the command-line before the adequate function is called: - the `before' option, after which the new option will be inserted, - the name of the option to enable/disable/modularise. With the short version of --*-after options (namely -E, -D, -M), the parsing step is not performed which leads to processing unset variables. Add options -E, -D, -M to the test that triggers assignment of parameters for --*-after options. Signed-off-by: Clement Chauplannaz <> Acked-by: Andi Kleen <> Signed-off-by: Yann E. MORIN <>
2013-05-16package: Makefile: unbreak binrpm-pkg targetLuiz Capitulino
Commit 6501320311664e11ad5489fedb17ea1f817c2617 dropped the rpm spec as a prerequisite for the binrpm-pkg target but forgot to update $< usage, which causes the rule to break. This commit fixes that by replacing $< with the spec name. Signed-off-by: Luiz Capitulino <> Signed-off-by: Michal Marek <>
2013-05-07Merge branch 'misc' of ↵Linus Torvalds
git:// Pull misc kbuild updates from Michal Marek: "Non-critical kbuild changes: - make coccicheck improvements, but no new semantic patches this time - make rpm improvements - make tar-pkg change to include the architecture in the filename. This is a deliberate incompatibility, but nobody has complained so far and it is useful if you build for different architectures. It also matches what the deb-pkg and rpm-pkg targets produce. - kbuild documentation fix" * 'misc' of git:// rpm-pkg: Remove pointless set -e statements rpm-pkg: Always regenerate the specfile rpm-pkg: Do not write to the parent directory rpm-pkg: Do not package the whole source directory buildtar: Add ARCH to the archive name Coccinelle: Fix patch output when coccicheck is used with M= and C= Coccinelle: Add support to the SPFLAGS variable Coccinelle: Cleanup the setting of the FLAGS and OPTIONS variables Coccinelle: Restore coccicheck verbosity in ONLINE mode (C=1 or C=2) scripts/package/Makefile: compare objtree with srctree instead of test KBUILD_OUTPUT doc: change example to existing Makefile fragment scripts/ Add magic for OFFSET and DEFINE
2013-05-07Merge branch 'kconfig' of ↵Linus Torvalds
git:// Pull kconfig updates from Michal Marek: - use pkg-config to detect curses libraries - clean up the way curses headers are searched - Some randconfig fixes, of which one had to be reverted - KCONFIG_SEED for randconfig debugging - memuconfig memory leak plugged - menuconfig > breadcrumbs > navigation - xconfig compilation fix - Other minor fixes * 'kconfig' of git:// kconfig: fix lists definition for C++ Revert "kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG" kconfig: implement KCONFIG_PROBABILITY for randconfig kconfig: allow specifying the seed for randconfig kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG kconfig: do not override symbols already set kconfig: fix randconfig tristate detection kconfig/lxdialog: rationalise the include paths where to find {.n}curses{,w}.h menuconfig: Add "breadcrumbs" navigation aid menuconfig: Fix memory leak introduced by jump keys feature Avoid creating unnessary source softlinks kconfig: optionally use pkg-config to detect ncurses libs menuconfig: optionally use pkg-config to detect ncurses libs
2013-05-07Merge branch 'kbuild' of ↵Linus Torvalds
git:// Pull kbuild changes from Michal Marek: "Kbuild commits for v3.10-rc1: - Fix make mrproper after mod/file2alias rework - Fix ld-option Makefile function - Rewrite headers_install to shell to drop Perl dependency. There are some more patches I have to look at, so I might send another pull request later. Or just queue them for 3.11." * 'kbuild' of git:// Fix cleaning in scripts/mod convert to kbuild: fix ld-option function
2013-05-07menuconfig: fix NULL pointer dereference when searching a symbolLi Zefan
Searching for PPC_EFIKA results in a segmentation fault, and it's because get_symbol_prop() returns NULL. In this case CONFIG_PPC_EFIKA is defined in arch/powerpc/platforms/ 52xx/Kconfig, so it won't be parsed if ARCH!=PPC, but menuconfig knows this symbol when it parses sound/soc/fsl/Kconfig: config SND_MPC52xx_SOC_EFIKA tristate "SoC AC97 Audio support for bbplan Efika and STAC9766" depends on PPC_EFIKA This bug was introduced by commit bcdedcc1afd6 ("menuconfig: print more info for symbol without prompts"). Reported-and-tested-by: Borislav Petkov <> Signed-off-by: Li Zefan <> Tested-by: Libo Chen <> Reviewed-by: "Yann E. MORIN" <> Signed-off-by: Michal Marek <> Signed-off-by: Linus Torvalds <>
2013-05-06Fix cleaning in scripts/modAndreas Schwab
Make sure devicetable-offsets.h is cleaned in the scripts/mod directory Signed-off-by: Andreas Schwab <> Tested-by: Geert Uytterhoeven <> Signed-off-by: Michal Marek <>
2013-05-05Merge tag 'modules-next-for-linus' of ↵Linus Torvalds
git:// Pull mudule updates from Rusty Russell: "We get rid of the general module prefix confusion with a binary config option, fix a remove/insert race which Never Happens, and (my favorite) handle the case when we have too many modules for a single commandline. Seriously, the kernel is full, please go away!" * tag 'modules-next-for-linus' of git:// modpost: fix unwanted VMLINUX_SYMBOL_STR expansion X.509: Support parse long form of length octets in Authority Key Identifier module: don't unlink the module until we've removed all exposure. kernel: kallsyms: memory override issue, need check destination buffer length MODSIGN: do not send garbage to stderr when enabling modules signature modpost: handle huge numbers of modules. modpost: add -T option to read module names from file/stdin. modpost: minor cleanup. genksyms: pass symbol-prefix instead of arch module: fix symbol versioning with symbol prefixes CONFIG_SYMBOL_PREFIX: cleanup.
2013-05-02Merge tag 'dt-for-linus' of ↵Linus Torvalds
git:// Pull ARM SoC device-tree updates from Olof Johansson: "Part 1 of device-tree updates for 3.10. The bulk of the churn in this branch is due to i.MX moving from C-defined pin control over to device tree, which is a one-time conversion that will allow greater flexibility down the road. Besides that, there's PCI-e bindings for Marvell mvebu platforms and a handful of cleanups to tegra due to the new include file functionality of the device tree compiler" * tag 'dt-for-linus' of git:// (113 commits) arm: mvebu: PCIe Device Tree informations for Armada XP GP arm: mvebu: PCIe Device Tree informations for Armada 370 DB arm: mvebu: PCIe Device Tree informations for Armada 370 Mirabox arm: mvebu: PCIe Device Tree informations for Armada XP DB arm: mvebu: PCIe Device Tree informations for OpenBlocks AX3-4 arm: mvebu: add PCIe Device Tree informations for Armada XP arm: mvebu: add PCIe Device Tree informations for Armada 370 ARM: sunxi: unify osc24M_fixed and osc24M arm: vt8500: Add SDHC support to WM8505 DT ARM: dts: Add a 64 bits version of the skeleton device tree ARM: mvebu: Add Device Bus and CFI flash memory support to defconfig ARM: mvebu: Add support for NOR flash device on Openblocks AX3 board ARM: mvebu: Add support for NOR flash device on Armada XP-GP board ARM: mvebu: Add Device Bus support for Armada 370/XP SoC ARM: dts: imx6dl-wandboard: Add USB Host support ARM: dts: imx51 cpu node ARM: dts: Add missing imx27-phytec-phycore dtb target ARM: dts: Add NFC support for i.MX27 Phytec PCM038 module ARM: i.MX51: Add PATA support ARM: dts: Add initial support for Wandboard Dual-Lite ...
2013-04-30menuconfig: print more info for symbol without promptsWengmeiling
When we search a config symbol, if it has no prompt the position of this symbol in the Kconfig file and it's dependencies are not printed. This can be inconvenient, especially when it's set to n and we want to find out why. the following is an example: before: Symbol: GENERIC_SMP_IDLE_THREAD [=y] Type : boolean Selected by: X86 [=y] after: Symbol: GENERIC_SMP_IDLE_THREAD [=y] Type : boolean Defined at arch/Kconfig:213 Selected by: X86 [=y] Signed-off-by: Weng Meiling <> Signed-off-by: Libo Chen <> Cc: Michal Marek <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2013-04-30Merge tag 'localmodconfig-v3.10' of ↵Linus Torvalds
git:// Pull localmodconfig changes from Steven Rostedt: "A bug was recently found in the make localmodconfig where it would miss dependencies of config files are include in other config files inside an if statement. Also added a debug print that helped in solving this bug." * tag 'localmodconfig-v3.10' of git:// localmodconfig: Process source kconfig files as they are found localmodconfig: Add debug prints for dependencies of module configs
2013-04-29checkpatch: add Suggested-by as a standard signatureMugunthan V N
As people started using Suggested-by as standard signature, adding "Suggested-by" to the standard signature so that checkpatch won't generate warning when Suggested-by is used in patch signature Signed-off-by: Mugunthan V N <> Cc: Andy Whitcroft <> Cc: Joe Perches <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2013-04-29checkpatch: only warn for empty lines before closing braces by themselvesMatthijs Kooijman
This check was intended to catch extra newlines at the end of a function definition, but it would trigger on any closing brace, including those of inline functions and macro definitions, triggering false positives. Now, only closing braces on a line by themselves trigger this check. Tested with: $ cat test.h /* test.h - Test file */ static inline int foo(void) { return 0; } static inline int bar(void) { return 1; } $ ./scripts/ --strict -f test.h # Before this commit CHECK: Blank lines aren't necessary before a close brace '}' + +static inline int foo(void) { return 0; } CHECK: Blank lines aren't necessary before a close brace '}' + +} total: 0 errors, 0 warnings, 2 checks, 9 lines checked $ ./scripts/ --strict -f test.h # After this commit CHECK: Blank lines aren't necessary before a close brace '}' + +} total: 0 errors, 0 warnings, 1 checks, 9 lines checked Signed-off-by: Matthijs Kooijman <> Cc: Andy Whitcroft <> Acked-by: Joe Perches <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2013-04-29checkpatch: warn on space before semicolonJoe Perches
Make space before semicolon a warning instead of a --strict CHK test. Signed-off-by: Joe Perches <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2013-04-29checkpatch: complain about executable filesJoe Perches
Complain about files with an executable bit set that are not in a scripts/ directory and are not type .pl, .py, .awk, or .sh Based on an initial patch from Stephen. Signed-off-by: Joe Perches <> Acked-by: Stephen Boyd <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2013-04-29checkpatch: Prefer seq_puts to seq_printfJoe Perches
Add a check for seq_printf use with a constant format without additional arguments. Suggest seq_puts instead. Signed-off-by: Joe Perches <> Suggested-by: Bjorn Helgaas <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2013-04-29checkpatch: add check for reuse of krealloc argJoe Perches
On Thu, 2013-03-14 at 13:30 +0000, David Woodhouse wrote: > If krealloc() returns NULL, it *doesn't* free the original. So any code > of the form 'foo = krealloc(foo, …);' is almost certainly a bug. So add a check for it to checkpatch. Signed-off-by: Joe Perches <> Tested-by: Guenter Roeck <> Acked-by: Guenter Roeck <> Cc: David Woodhouse <> Cc: Andy Whitcroft <> Cc: Jean Delvare <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2013-04-29get_maintainer: use filename-only regex match for TegraStephen Warren
Create a new N: entry type in MAINTAINERS which performs a regex match against filenames; either those extracted from patch +++ or --- lines, or those specified on the command-line using the -f option. This provides the same benefits as using a K: regex option to match a set of filenames (see commit eb90d0855b75 "get_maintainer: allow keywords to match filenames"), but without the disadvantage that "random" file content, such as comments, will ever match the regex. Hence, revert most of that commit. Switch the Tegra entry from using K: to N: [ fix typo in docs, per Marcin] Reported-by: Marcin Slusarz <> Suggested-by: Joe Perches <> Signed-off-by: Stephen Warren <> Acked-by: Joe Perches <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2013-04-29scripts/decodecode: make faulting insn ptr more robustBorislav Petkov
It can accidentally happen that the faulting insn (the exact instruction bytes) is repeated a little further on in the trace. This causes that same instruction to be tagged twice, see example below. What we want to do, however, is to track back from the end of the whole disassembly so many lines as the slice which starts with the faulting instruction is long. This leads us to the actual faulting instruction and *then* we tag it. While we're at it, we can drop the sed "g" flag because we address only this one line. Also, if we point to an instruction which changes decoding depending on the slice being objdumped, like a Jcc insn, for example, we do not even tag it as a faulting instruction because the instruction decode changes in the second slice but we use that second format as a regex on the fsrst disassembled buffer and more often than not that instruction doesn't match. Again, simply tag the line which is deduced from the original "<>" marking we've received from the kernel. This also solves the pathologic issue of multiple tagging like this: 29:* 0f 0b ud2 <-- trapping instruction 2b:* 0f 0b ud2 <-- trapping instruction 2d:* 0f 0b ud2 <-- trapping instruction Double tagging example: Code: 34 dd 40 30 ad 81 48 c7 c0 80 f6 00 00 48 8b 3c 30 48 01 c6 b8 ff ff ff ff 48 8d 57 f0 48 39 f7 74 2f 49 8b 4c 24 08 48 8b 47 f0 <48> 39 48 08 75 0e eb 2a 66 90 48 8b 40 f0 48 39 48 08 74 1e 48 All code ======== 0: 34 dd xor $0xdd,%al 2: 40 30 ad 81 48 c7 c0 xor %bpl,-0x3f38b77f(%rbp) 9: 80 f6 00 xor $0x0,%dh c: 00 48 8b add %cl,-0x75(%rax) f: 3c 30 cmp $0x30,%al 11: 48 01 c6 add %rax,%rsi 14: b8 ff ff ff ff mov $0xffffffff,%eax 19: 48 8d 57 f0 lea -0x10(%rdi),%rdx 1d: 48 39 f7 cmp %rsi,%rdi 20: 74 2f je 0x51 22: 49 8b 4c 24 08 mov 0x8(%r12),%rcx 27: 48 8b 47 f0 mov -0x10(%rdi),%rax 2b:* 48 39 48 08 cmp %rcx,0x8(%rax) <-- trapping instruction 2f: 75 0e jne 0x3f 31: eb 2a jmp 0x5d 33: 66 90 xchg %ax,%ax 35: 48 8b 40 f0 mov -0x10(%rax),%rax 39:* 48 39 48 08 cmp %rcx,0x8(%rax) <-- trapping instruction 3d: 74 1e je 0x5d 3f: 48 rex.W Signed-off-by: Borislav Petkov <> Cc: "H. Peter Anvin" <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2013-04-29localmodconfig: Process source kconfig files as they are foundSteven Rostedt
A bug was reported that caused localmodconfig to not keep all the dependencies of ATH9K. This was caused by the kconfig file: In drivers/net/wireless/ath/Kconfig: --- if ATH_CARDS config ATH_DEBUG bool "Atheros wireless debugging" ---help--- Say Y, if you want to debug atheros wireless drivers. Right now only ath9k makes use of this. source "drivers/net/wireless/ath/ath5k/Kconfig" source "drivers/net/wireless/ath/ath9k/Kconfig" source "drivers/net/wireless/ath/carl9170/Kconfig" source "drivers/net/wireless/ath/ath6kl/Kconfig" source "drivers/net/wireless/ath/ar5523/Kconfig" source "drivers/net/wireless/ath/wil6210/Kconfig" endif --- The current way kconfig works, it processes new source files after the first file is completed. It creates an array of new source config files and when the one file is finished, it continues with the next file. Unfortunately, this means that it loses the fact that the source file is within an "if" statement, and this means that each of these source file's configs will not have the proper dependencies set. As ATH9K requires ATH_CARDS set, the localmodconfig did not see that dependency, and did not enable ATH_CARDS. When the oldconfig was run, it forced ATH9K to be disabled. Link: Cc: # 3.8+ Reported-by: Robert P. J. Day <> Tested-by: Robert P. J. Day <> Signed-off-by: Steven Rostedt <>
2013-04-29localmodconfig: Add debug prints for dependencies of module configsSteven Rostedt
When a config for a module is added to the list to save in the final config file, add a print to show what dependencies are used. This is useful to debug when a config is disabled by the make oldconfig after localmodconfig is finished. This print only appears if the environment variable LOCALMODCONFIG_DEBUG is defined. Signed-off-by: Steven Rostedt <>
2013-04-29Merge tag 'char-misc-3.10-rc1' of ↵Linus Torvalds
git:// Pull char/misc driver update from Greg Kroah-Hartman: "Here's the big char / misc driver update for 3.10-rc1 A number of various driver updates, the majority being new functionality in the MEI driver subsystem (it's now a subsystem, it started out just a single driver), extcon updates, memory updates, hyper-v updates, and a bunch of other small stuff that doesn't fit in any other tree. All of these have been in linux-next for a while" * tag 'char-misc-3.10-rc1' of git:// (148 commits) Tools: hv: Fix a checkpatch warning tools: hv: skip iso9660 mounts in hv_vss_daemon tools: hv: use FIFREEZE/FITHAW in hv_vss_daemon tools: hv: use getmntent in hv_vss_daemon Tools: hv: Fix a checkpatch warning tools: hv: fix checks for origin of netlink message in hv_vss_daemon Tools: hv: fix warnings in hv_vss_daemon misc: mark spear13xx-pcie-gadget as broken mei: fix krealloc() misuse in in mei_cl_irq_read_msg() mei: reduce flow control only for completed messages mei: reseting -> resetting mei: fix reading large reposnes mei: revamp mei_irq_read_client_message function mei: revamp mei_amthif_irq_read_message mei: revamp hbm state machine Revert "drivers/scsi: use module_pcmcia_driver() in pcmcia drivers" Revert "scsi: pcmcia: nsp_cs: remove module init/exit function prototypes" scsi: pcmcia: nsp_cs: remove module init/exit function prototypes mei: wd: fix line over 80 characters misc: tsl2550: Use dev_pm_ops ...
2013-04-29kconfig: fix lists definition for C++Yann E. MORIN
The C++ compiler is more strict in that it refuses to assign a void* to a struct list_head*. Fix that by explicitly casting the poisonning constants. (Tested with all 5 frontends, now.) Reported-by: Randy Dunlap <> Signed-off-by: "Yann E. MORIN" <> Cc: Randy Dunlap <> Cc: Benjamin Poirier <>
2013-04-29modpost: fix unwanted VMLINUX_SYMBOL_STR expansionJames Hogan
Commit a4b6a77b77ba4f526392612c2365797fab956014 ("module: fix symbol versioning with symbol prefixes") broke the MODVERSIONS loading of any module using memcmp (e.g. ipv6) on x86_32, as it's defined to __builtin_memcmp which is expanded by VMLINUX_SYMBOL_STR. Use __VMLINUX_SYMBOL_STR instead which doesn't expand the argument. Reported-by: Tetsuo Handa <> Reported-by: Andy Shevchenko <> Signed-off-by: James Hogan <> Cc: H. Peter Anvin <> Tested-by: Tetsuo Handa <> Tested-by: Andy Shevchenko <> Signed-off-by: Rusty Russell <> Cc: <> # 3.9
2013-04-26Revert "kconfig: fix randomising choice entries in presence of ↵Yann E. MORIN
KCONFIG_ALLCONFIG" This reverts commit 422c809f03f043d0950d8362214818e956a9daee. It causes more harm than it solves issues. Reported-by: Sedat Dilek <> Reported-by: Arnd Bergmann <> Signed-off-by: "Yann E. MORIN" <> Tested-by: Sedat Dilek <> Cc: Sedat Dilek <> Cc: Arnd Bergmann <> Cc: Michal Marek <> Cc: Sam Ravnborg <> Cc: Stephen Rothwell <> Cc: Thomas Petazzoni <> Cc: Greg KH <>
2013-04-25kconfig: implement KCONFIG_PROBABILITY for randconfigYann E. MORIN
Currently the odds to set each symbol is (rounded): booleans: y: 50% n: 50% tristates: y: 33% m: 33% n: 33% Introduce a KCONFIG_PROBABILITY environment variable to tweak the probabilities (in percentage), as such: KCONFIG_PROBABILITY y:n split y:m:n split ----------------------------------------------------------------- [1] unset or empty 50 : 50 33 : 33 : 34 [2] N N : 100-N N/2 : N/2 : 100-N N:M N+M : 100-(N+M) N : M : 100-(N+M) N:M:L N : 100-N M : L : 100-(M+L) [1] The current behaviour is kept as default, for backward compatibility [2] The solution initially implemented by Peter for Buildroot, see: Signed-off-by: Peter Korsgaard <> [ add to Documentation/] Signed-off-by: "Yann E. MORIN" <>
2013-04-25kconfig: allow specifying the seed for randconfigYann E. MORIN
For reproducibility, it can be useful to be able to specify the seed to use to seed the RNG. Add a new KCONFIG_SEED environment variable which can be set to the seed to use: $ make KCONFIG_SEED=42 randconfig $ sha1sum .config 70a128c8dcc61303069e1be352cce64114dfcbca .config $ make KCONFIG_SEED=42 randconfig $ sha1sum .config 70a128c8dcc61303069e1be352cce64114dfcbca .config It's very usefull for eg. debugging the kconfig parser. Signed-off-by: "Yann E. MORIN" <>
2013-04-25kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIGYann E. MORIN
Currently, randconfig does randomise choice entries, unless KCONFIG_ALLCONFIG is specified. For example, given those two files (Thomas' test-case): ---8<--- config OPTIONA bool "Option A" choice prompt "This is a choice" config CHOICE_OPTIONA bool "Choice Option A" config CHOICE_OPTIONB bool "Choice Option B" endchoice config OPTIONB bool "Option B" ---8<--- ---8<--- config.defaults CONFIG_OPTIONA=y ---8<--- config.defaults And running: ./scripts/kconfig/conf --randconfig does properly randomise the two choice symbols (and the two booleans). However, running: KCONFIG_ALLCONFIG=config.defaults \ ./scripts/kconfig/conf --randconfig does *not* reandomise the two choice entries, and only CHOICE_OPTIONA will ever be selected. (OPTIONA will always be set (expected), and OPTIONB will be be properly randomised (expected).) This patch defers setting that a choice has a value until a symbol for that choice is indeed set, so that choices are properly randomised when KCONFIG_ALLCONFIG is set, but not if a symbol for that choice is set. Also, as a side-efect, this patch fixes the following case: ---8<--- choice config OPTION_A bool "Option A" config OPTION_B bool "Option B" config OPTION_C bool "Option C" endchoice ---8<--- which could previously generate such .config files: ---8<--- ---8<--- CONFIG_OPTION_A=y CONFIG_OPTION_A=y CONFIG_OPTION_B=y # CONFIG_OPTION_B is not set # CONFIG_OPTION_C is not set CONFIG_OPTION_C=y ---8<--- ---8<--- Ie., the first entry in a choice is always set, plus zero or one of the other options may be set. This patch ensures that only one option may be set for a choice. Reported-by: Thomas Petazzoni <> Signed-off-by: "Yann E. MORIN" <> Cc: Thomas Petazzoni <> Cc: Michal Marek <> Cc: Sam Ravnborg <> Cc: Arnaud Lacombe <> --- Changes v2 -> v3 - ensure only one symbol is set in a choice Changes v1 -> v2: - further postpone setting that a choice has a value until one is indeed set - do not print symbols that are part of an invisible choice
2013-04-25kconfig: do not override symbols already setYann E. MORIN
For randconfig, if a list of required symbols is specified with KCONFIG_ALLCONFIG, such symbols do not "have a value" as per sym_has_value(), but have the "valid" flag set. Signed-off-by: "Yann E. MORIN" <>
2013-04-25kconfig: fix randconfig tristate detectionYann E. MORIN
Because the modules' symbole (CONFIG_MODULES) may not yet be set when we check a symbol's tristate capabilty, we'll always find that tristate symbols are booleans, even if we randomly decided that to enable modules: sym_get_type(sym) always return boolean for tristates when modules_sym has not been previously set to 'y' *and* its value calculated *and* its visibility calculated, both of which only occur after we randomly assign values to symbols. Fix that by looking at the raw type of symbols. Tristate set to 'm' will be promoted to 'y' when their values will be later calculated. Signed-off-by: "Yann E. MORIN" <>
2013-04-18rpm-pkg: Remove pointless set -e statementsMichal Marek
Signed-off-by: Michal Marek <>
2013-04-18rpm-pkg: Always regenerate the specfileMichal Marek
The *pkg targets are always run, so it makes no sense to cache the generated specfile. This also fixes build errors when the specfile becomes out of date, without the Makefile noticing it: $ make rpm works $ echo yadadada >localversion-test $ make rpm fails, because kernel.spec assumes the old kernel release string Signed-off-by: Michal Marek <>
2013-04-18rpm-pkg: Do not write to the parent directoryMichal Marek
Now that we only package explicitly listed files to the tarball, there is no need to abuse the parent directory. Signed-off-by: Michal Marek <>
2013-04-18rpm-pkg: Do not package the whole source directoryMichal Marek
The source tree can contain lots of uninteresting data like tag or cscope files, packaging which slows down make rpm needlessly. It can also break the build, if the tree contains an unrelated file named *.spec. The downside of this change is that new subdirectories have to be added to the KBUILD_ALLDIRS variable in the top-level Makefile. The upside is that the behavior is more predictable. Signed-off-by: Michal Marek <>
2013-04-17checkpatch: fix stringification macro defectJoe Perches
Fix checkpatch misreporting defect with stringification macros ERROR: Macros with complex values should be enclosed in parenthesis #27: FILE: arch/arm/include/asm/kgdb.h:41: +#define ___to_string(X) #X Signed-off-by: Joe Perches <> Reported-by: Vincent Stehlé <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2013-04-16kconfig/lxdialog: rationalise the include paths where to find {.n}curses{,w}.hYann E. MORIN
The current code does this: if [ -f /usr/include/ncursesw/curses.h ]; then echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncursesw/curses.h>"' elif [ -f /usr/include/ncurses/ncurses.h ]; then echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"' elif [ -f /usr/include/ncurses/curses.h ]; then echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"' [...] This is merely inconsistent: - adding the full path to the directory in the -I directive, - especially since that path is already a sub-path of the system include path, - and then repeating the sub-path in the #include directive. Rationalise each include directive: - only use the filename in the #include directive, - keep the -I directives: they are always searched for before the system include path; this ensures the correct header is used. Using the -I directives and the filename-only in #include is more in line with how pkg-config behaves, eg.: $ pkg-config --cflags ncursesw -I/usr/include/ncursesw This paves the way for using pkg-config for CFLAGS, too, now we use it to find the libraries. Signed-off-by: "Yann E. MORIN" <>
2013-04-16menuconfig: Add "breadcrumbs" navigation aidBenjamin Poirier
Displays a trail of the menu entries used to get to the current menu. Signed-off-by: Benjamin Poirier <> Tested-by: "Yann E. MORIN" <> [ small, trivial code re-ordering] Signed-off-by: "Yann E. MORIN" <>
2013-04-16menuconfig: Fix memory leak introduced by jump keys featureBenjamin Poirier
Fixes the memory leak of struct jump_key allocated in get_prompt_str() Signed-off-by: Benjamin Poirier <> Tested-by: "Yann E. MORIN" <> Reviewed-by: "Yann E. MORIN" <> Signed-off-by: "Yann E. MORIN" <> Cc: Avoid creating unnessary source softlinksJohn Stultz
Viresh noticed when using that a source softlink was being created even when he didn't specify the -O option. The problem arises due to the previous commit 409f117e2d6b which added the -O option. Basically if -O is not specified, we still pass '-O=.' to the make command, which then generates a source softlink to ./ This patch adds an extra check so if there is no -O specified to, we don't pass one on to make. Cc: Zhangfei Gao <> Cc: Bruce Ashfield <> Acked-by: Darren Hart <> Reported-and-tested-by: Viresh Kumar <> Signed-off-by: John Stultz <> Signed-off-by: Michal Marek <>
2013-04-09Merge remote-tracking branch 'swarren/for-3.10/dtc-cpp-chroot-std-headers' ↵Shawn Guo
into imx/dt convert to headers_install.shRob Landley
Remove perl from make headers_install by replacing a perl script (doing a simple regex search and replace) with a smaller, faster, simpler, POSIX-2008 shell script implementation. The new shell script is a single for loop calling sed and piping its output through unifdef to produce the target file. Same as last time except for minor tweak to deal with code review from here: (Note that this drops the "arch" argument, which isn't used. Kbuild already points to the right input files on the command line.) Signed-off-by: Rob Landley <> Cc: Thomas Gleixner <> Cc: Josh Boyer <> Cc: "Paul E. McKenney" <> Cc: David Howells <> Acked-by: Sam Ravnborg <> Signed-off-by: Andrew Morton <> Signed-off-by: Michal Marek <>
2013-04-08buildtar: Add ARCH to the archive nameBorislav Petkov
When dealing with multiple sub-arches (like 32- and 64-bit on x86, for example) generating a bunch of kernel tar archives with the same name but for different sub-arches could get confusing and error-prone. Also, the build process could overwrite otherwise unrelated builds and you probably don't want that. So, add the architecture to the archive name for more clarity and less shoot-yourself-in-the-foot practices. Signed-off-by: Borislav Petkov <> Signed-off-by: Michal Marek <>
2013-04-08Coccinelle: Fix patch output when coccicheck is used with M= and C=Nicolas Palix
When the M variable is used, the -patch option should be given to spatch. This patch fixes the case where C is used. Signed-off-by: Nicolas Palix <> Signed-off-by: Michal Marek <>