menuconfig: fix extended colors ncurses support

The ncurses library allows for extended colors. The support for extended
colors support depends on wide-character support. ncurses headers
enable extended colors (NCURSES_EXT_COLORS) only when wide-character
support is enabled (NCURSES_WIDECHAR).

The "make menuconfig" uses wide-character ncursesw library, which can be
compiled with wide-character support, but does not define NCURSES_WIDECHAR
and it's using headers without wide-character (and extended colors) support.

This fixes problems with colors on systems with enabled extended colors
(like PLD Linux). Without this patch "make menuconfig" is hard to use.

Signed-off-by: Krzysztof Mazur <krzysiek@podlesie.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
kconfig: remove CONFIG_ from string constants

Having the CONFIG_ prefix in string constants gets in the way of
using a run-time-defined CONFIG_ prefix.

Fix that by using temp growable strings (gstr) in which we printf
the text.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
kconfig: add a function to get the CONFIG_ prefix

Currently, we get the CONFIG_ prefix via the CONFIG_ macro, which means
the CONFIG_ prefix is hard-coded at compile time. This goes against
having a run-time defined CONFIG_ prefix.

Add a function that returns the CONFIG_ prefix to use (but keep the
current hard-coded behavior, to be changed in a later patch).

To avoid touching all the code that uses the CONFIG_ macro, we just
undef it, and define it to be a call to the function.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
kconfig: get CONFIG_ prefix from the environment

Currently, the CONFIG_ prefix is hard-coded in the kconfig frontends
executables. This means that two projects that use kconfig with
different prefixes can not share the same kconfig frontends.

Instead of hard-coding the prefix in the frontends, get it from the
environment, and revert back to hard-coded value if not found.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
kconfig: Fix malloc handling in conf tools

(and get them out of the noise in the audit work)

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
kconfig: Regenerate lexer

Apply changes from commit 177acf78 (kconfig: Fix malloc handling in conf
tools) to the _shipped file.

Signed-off-by: Michal Marek <mmarek@suse.cz>
Revert "kconfig-language: add to hints"

This reverts commit 64b81ed7fb1e45c914317b20316f32827bc6444b.

As Martin says about this paragraph:
    However, I can not reproduce this. The attached file contains both
    cases. [...] AFAICS, both versions behave equivalently. I suggest
    changing the documentation accordingly.

    [in http://marc.info/?l=linux-kbuild&m=134987006202410&w=2]

Reported-by: Martin Walch <walch.martin@gmx.de>
Cc: Martin Walch <walch.martin@gmx.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
merge_config.sh: Add option to specify output dir

Provide a -O option to specify dir to put generated .config
Then merge_config.sh does not need to be copied to target dir,
for easy re-usage in other script

Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Tested-by: Jon Medhurst (Tixy) <tixy@linaro.org>
Acked-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
scripts/kconfig: ensure we use proper CONFIG_ prefix

Now that we get the CONFIG_ prefix from the environment, we must
ensure we use the proper prefix in case the user has it set in
the environment.

Simply unexport CONFIG_ to fallback to our hard-coded default.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
edac: edac_mc no longer deals with kobjects directly

There are no more embedded kobjects in struct mem_ctl_info. Remove a header and
a comment that does not reflect the code anymore.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
sb_edac: add a missing /n on a debug message

[   17.024963] EDAC DEBUG: get_memory_layout: TOHM: 132.160 GB (0x0000002043ffffff)<7>[   17.024971] EDAC DEBUG: get_memory_layout: SAD#0 DRAM up to 33.792 GB (0x0000000840000000) Interleave: 8:6 reg=0x000083c3

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
i7core_edac: fix erroneous size of static array

Remove size from lookup arrays and mark them as const.

Reviewed-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Niklas Söderlund <niso@kth.se>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
i7core_edac: fix kernel crash on unloading i7core_edac.

It is easy to trigger this crash on 3.7.0:

root@intel_westmere_ep-3:~# modprobe -r i7core_edac
EDAC PCI: Removed device 0 for i7core_edac EDAC PCI controller: DEV 0000:fe:03.0
EDAC MC: Removed device 1 for i7core_edac.c i7 core #1: DEV 0000:fe:03.0
EDAC PCI: Removed device 1 for i7core_edac EDAC PCI controller: DEV 0000:ff:03.0
EDAC MC: Removed device 0 for i7core_edac.c i7 core #0: DEV 0000:ff:03.0
BUG: unable to handle kernel NULL pointer dereference at 0000000000000110
IP: [<ffffffff82069ee9>] __blocking_notifier_call_chain+0x29/0x80
PGD 1eaae7067 PUD 1e96e4067 PMD 0
Oops: 0000 [#1] PREEMPT SMP
Modules linked in: minix acpi_cpufreq freq_table mperf ioatdma processor edac_core(-) iTCO_wdt coretemp evdev hwmon lpc_ich dca mfd_core crc32c_intel ioapic [last unloaded: i7core_edac]
CPU 3
Pid: 1268, comm: modprobe Not tainted 3.7.0-WR5.0.1.0_standard+ #30 Intel Corporation S5520HC/S5520HC
RIP: 0010:[<ffffffff82069ee9>]  [<ffffffff82069ee9>] __blocking_notifier_call_chain+0x29/0x80
RSP: 0018:ffff8801eb12de28  EFLAGS: 00010246
RAX: 0000000000000000 RBX: 00000000000000f0 RCX: 00000000ffffffff
RDX: ffff88012b452800 RSI: 0000000000000002 RDI: 00000000000000f0
RBP: ffff8801eb12de68 R08: 0000000000000000 R09: ffffea0004ad1118
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff8801eb12dee8 R14: ffff88012b452800 R15: 000000000060e518
FS:  00007f9ea95a9700(0000) GS:ffff8801efc20000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000110 CR3: 00000001262f1000 CR4: 00000000000007e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process modprobe (pid: 1268, threadinfo ffff8801eb12c000, task ffff8801e8421690)
Stack:
  ffff88012c802a00 ffff88012b445ec0 ffff88012c802300 ffff88012b452800
  0000000000000000 ffff8801eb12dee8 000000000060e080 000000000060e518
  ffff8801eb12de78 ffffffff82069f56 ffff8801eb12dea8 ffffffff824ead7c
Call Trace:
  [<ffffffff82069f56>] blocking_notifier_call_chain+0x16/0x20
  [<ffffffff824ead7c>] device_del+0x3c/0x1d0
  [<ffffffffa00095a8>] edac_mc_sysfs_exit+0x1c/0x2f [edac_core]
  [<ffffffffa000961c>] edac_exit+0x4f/0x56 [edac_core]
  [<ffffffff820a3d2a>] sys_delete_module+0x17a/0x240
  [<ffffffff8212da7c>] ? vm_munmap+0x5c/0x80
  [<ffffffff82877682>] system_call_fastpath+0x16/0x1b
Code: 90 90 55 48 89 e5 48 83 ec 40 48 89 5d d8 4c 89 65 e0 4c 89 6d e8 4c 89 75 f0 4c 89 7d f8 66 66 66 66 90 31 c0 49 89 d6 48 89 fb <48> 8b 57 20 49 89 f5 41 89 cf 4c 8d 67 20 48 85 d2 74 2c 4c 89
RIP  [<ffffffff82069ee9>] __blocking_notifier_call_chain+0x29/0x80
  RSP <ffff8801eb12de28>
CR2: 0000000000000110
---[ end trace b69acf12ccad1c0d ]---

Usually, edac_subsys is grabbed one time by pci at initialization.
But edac_subsys may be released several times if multiple pci MCs exist.
The fix just makes the operations balanced.

Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
kconfig: document use of CONFIG_ environment variable

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
menuconfig:inputbox: support navigate input position

This patch add support navigate input position *inside* the input
field with LEFT/RIGHT, so it is possible to modify the text in place.

Signed-off-by: Wang YanQing <udknight@gmail.com>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
kconfig:lxdialog: remove duplicate code

dialog.h has two line the same below:
extern char dialog_input_result[];
This patch remove one of them.

Signed-off-by: Wang YanQing <udknight@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Introduce THERMAL_TREND_RAISE_FULL and THERMAL_TREND_DROP_FULL

These two new thermal_trend types are used to tell the governor
that the temeprature is raising/dropping quickly.

Thermal cooling governors should handle this situation and make
proper decisions, e.g. set cooling state to upper/lower limit directly
instead of one step each time.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Introduce THERMAL_TREND_RAISE/DROP_FULL support for step_wise governor

step_wise governor should set the device cooling state to
upper/lower limit directly when THERMAL_TREND_RAISE/DROP_FULL.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
step_wise: Unify the code for both throttle and dethrottle

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Thermal: exynos: Add sysfs node supporting exynos's emulation mode.

This patch supports exynos's emulation mode with newly created sysfs node.
Exynos 4x12 (4212, 4412) and 5 series provide emulation mode for thermal
management unit. Thermal emulation mode supports software debug for TMU's
operation. User can set temperature manually with software code and TMU
will read current temperature from user value not from sensor's value.
This patch includes also documentary placed under Documentation/thermal/.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>