Documentation/kconfig: more concise and straightforward search explanation

Re-phrase the explanations on the sorting of search results, in a more
concise and complete way.

Drop reference to the user's locale when sorting alphabetically, since
this is implicit.

Reported-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
kconfig: avoid multiple calls to strlen

Calls to strlen are costly, so avoid calling strln as much as we can.

Reported-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
kconfig/[mn]conf: shorten title in search-box

No need to repeat the 'CONFIG_' string in the title,
once is explicit enough.

Reported-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Jean Delvare <jdelvare@suse.de>
kconfig: minor style fixes in symbol-search code

Two minor style fixes:
  - no space before/after parenthesis in function definition
  - no {} for single-line if()

And one grammar fix in a comment.

Reported-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
kconfig: don't allocate n+1 elements in temporary array

The temporary array that stores the search results is not NULL-terminated,
so there is no reason to allocate n+1 elements.

Reported-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
kconfig: simplify symbol-search code

There is no need for a double indirection in the temporary array that
stores the internediate search results.

Reported-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Merge branch 'yem-kconfig-rc-fixes' of git://gitorious.org/linux-kconfig/linux-kconfig into kbuild/kconfig
nfsd: nfs4_file_get_access: need to be more careful with O_RDWR

If fi_fds = {non-NULL, NULL, non-NULL} and oflag = O_WRONLY
the WARN_ON_ONCE(!(fp->fi_fds[oflag] || fp->fi_fds[O_RDWR]))
doesn't trigger when it should.

Signed-off-by: Harshula Jayasuriya <harshula@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
nfsd4: fix setlease error return

This actually makes a difference in the 4.1 case, since we use the
status to decide what reason to give the client for the delegation
refusal (see nfsd4_open_deleg_none_ext), and in theory a client might
choose suboptimal behavior if we give the wrong answer.

Reported-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs: 9p: use strlcpy instead of strncpy

For 'NULL' terminated string, recommend always to be ended by zero.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
x86/jump-label: Use best default nops for inital jump label calls

As specified by H. Peter Anvin, the best nops for x86 without knowing
the running computer is:

32bit:
  0x3e, 0x8d, 0x74, 0x26, 0x00 also known as GENERIC_NOP5_ATOMIC

64bit:
  0x0f, 0x1f, 0x44, 0x00, 0x00  also known as P6_NOP5_ATOMIC

Currently the default nop that is used by jump label is:

 0xe9 0x00 0x00 0x00 0x00

Which is really a 5byte jump to the next position.

It's better to use a real nop than a jmp.

Cc: H. Peter Anvin <hpa@linux.intel.com>
Cc: Jason Baron <jbaron@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
x86/jump-label: Do not bother updating nops if they are correct

On boot up, the jump label init function scans all the jump label locations
and converts them to the best nop for the machine. If the nop is already
the ideal nop, do not bother with changing it.

Cc: Jason Baron <jbaron@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
x86/jump-label: Add safety checks to jump label conversions

As with all modifying of kernel text, we need to be very paranoid.

When converting the jump label locations to and from nops to jumps
a check has been added to make sure what we are replacing is what we
expect, otherwise we bug.

Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jason Baron <jbaron@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
x86/jump-label: Show where and what was wrong on errors

When modifying text sections for jump labels, a paranoid check is
performed. If the check fails, the system "bugs". But why it failed
is not shown.

The BUG_ON()s in the jump label update code is replaced with bug_at(ip).
This is a function that will show what pointer failed, and what was
at the location of the failure that made jump label panic.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
MAINTAINERS: drivers/power: add entry for SmartReflex AVS drivers

The SmartReflex AVS driver evolved out of the OMAP kernel and now lives
under drivers/power/avs.

I've historically been maintainer of this but Nishanth Menon is doing most
of the heavy lifting now.  Add us both as co-maintainers.

Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
power: reset: Add msm restart support

Add support for restart and poweroff functionality present on MSM chipsets
with the MPM2 ps-hold hardware.

Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
Tested-by: Ivan T. Ivanov <iivanov@mm-sol.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
power_supply: Make goldfish_battery depend on GOLDFISH || COMPILE_TEST

Nearly all the other goldfish peripherals (mtd, keyboard, etc) have a
dependency on the main platform's GOLDFISH Kconfig item, but this one got
skipped.  Even with consistency as a justification, there was initial
resistance[1] from some people to adding it however, as they wanted the
extra compile coverage.

Now, with CONFIG_COMPILE_TEST, we have the middle ground that will give
people the coverage who want it, and let those who don't want it to skip
ever seeing the option presented.

[1] https://lkml.org/lkml/2013/2/27/333

Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
power supply: collie_battery: Convert to use dev_pm_ops

This commit fixes the following warnings:

 linux/drivers/power/collie_battery.c:372:2: warning: initialization from
 incompatible pointer type [enabled by default]
 linux/drivers/power/collie_battery.c:372:2: warning: (near initialization
 for 'collie_bat_driver.suspend') [enabled by default]

Referencess:

MFD: ucb1x00-core: convert to use dev_pm_ops
https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/include/linux/mfd?id=5a09b7120a965a7d7e8494d0ed509135bbce0118

MFD: mcp-core: remove legacy driver suspend/resume methods
https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/include/linux/mfd?id=cf4abfcc0df2985ff6061f74e63b8353f2a1d0bc

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
power_supply: tosa_battery: Get rid of irq_to_gpio usage

This commit fixes the following error:

 linux/drivers/power/tosa_battery.c:153:2: error: implicit declaration of
 function 'irq_to_gpio' [-Werror=implicit-function-declaration]

Since 9d08d5d77a355510c2f5657c86b0a4b25acfe72c, irq_to_gpio() is no longer
available but still in use by collie_battery.c. As it's just for a debug
message, just get rid of this call.

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
power: Add APM X-Gene system reboot driver

Add APM X-Gene SoC system reboot driver. This driver handles only system
reboot. System shutdown is board specific and can be handled by board
driver or GPIO based shutdown driver.

Signed-off-by: Loc Ho <lho@apm.com>
Signed-off-by: Feng Kan <fkan@apm.com>
Signed-off-by: Kumar Sankaran <ksankaran@apm.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>