]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
10 years agoepoll-do-not-take-global-epmutex-for-simple-topologies-fix
Andrew Morton [Tue, 5 Nov 2013 05:57:01 +0000 (16:57 +1100)]
epoll-do-not-take-global-epmutex-for-simple-topologies-fix

- use `bool' for boolean variables
- remove unneeded/undesirable cast of void*
- add missed ep_scan_ready_list() kerneldoc

Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Davide Libenzi <davidel@xmailserver.org>
Cc: Eric Wong <normalperson@yhbt.net>
Cc: Jason Baron <jbaron@akamai.com>
Cc: Nathan Zimmer <nzimmer@sgi.com>
Cc: Nelson Elhage <nelhage@nelhage.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agoepoll: do not take global 'epmutex' for simple topologies
Jason Baron [Tue, 5 Nov 2013 05:57:00 +0000 (16:57 +1100)]
epoll: do not take global 'epmutex' for simple topologies

When calling EPOLL_CTL_ADD for an epoll file descriptor that is attached
directly to a wakeup source, we do not need to take the global 'epmutex',
unless the epoll file descriptor is nested.  The purpose of taking the
'epmutex' on add is to prevent complex topologies such as loops and deep
wakeup paths from forming in parallel through multiple EPOLL_CTL_ADD
operations.  However, for the simple case of an epoll file descriptor
attached directly to a wakeup source (with no nesting), we do not need to
hold the 'epmutex'.

This patch along with 'epoll: optimize EPOLL_CTL_DEL using rcu' improves
scalability on larger systems.  Quoting Nathan Zimmer's mail on SPECjbb
performance:

"On the 16 socket run the performance went from 35k jOPS to 125k jOPS.  In
addition the benchmark when from scaling well on 10 sockets to scaling
well on just over 40 sockets.

...

Currently the benchmark stops scaling at around 40-44 sockets but it seems like
I found a second unrelated bottleneck."

Signed-off-by: Jason Baron <jbaron@akamai.com>
Tested-by: Nathan Zimmer <nzimmer@sgi.com>
Cc: Eric Wong <normalperson@yhbt.net>
Cc: Nelson Elhage <nelhage@nelhage.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Davide Libenzi <davidel@xmailserver.org>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agoepoll: remove the on_list check for 'struct epitem'
Jason Baron [Tue, 5 Nov 2013 05:56:59 +0000 (16:56 +1100)]
epoll: remove the on_list check for 'struct epitem'

By removing the 'int on_list' field from 'struct epitem', we avoid hitting
the BUILD_BUG_ON() for 'struct epitem' being larger than 128 bytes.

In file included from include/linux/init.h:4:0,
                 from fs/eventpoll.c:14:
fs/eventpoll.c: In function 'eventpoll_init':
include/linux/compiler.h:321:20: error: call to '__compiletime_assert_2137' declared with attribute error: BUILD_BUG_ON failed: sizeof(void *) <= 8 && sizeof(struct epitem) > 128
    prefix ## suffix();    \

The check to make sure that the 'struct epitem' was actually linked via
epi->fllink was added to avoid having the list removal primitives called
twice for the same 'struct epitem'.  However, the double call possibility
was removed by 'Subject: epoll: optimize EPOLL_CTL_DEL using rcu'.  There,
the call to 'list_del_init()' in eventpoll_release_file() was removed (we
now rely on the list delete happening entirely in 'ep_remove()', which is
called from eventpoll_release_file()).

There is also the question as to whether multiple ep_remove() calls could
happen concurrently.  This can not happen since EPOLL_CTL_DEL can't race
with eventpoll_release_file() or ep_free() - it has to do an fget() to
proceed.  Further, eventpoll_release_file() can not race with ep_free(),
since they both acquire the 'epmutex'.

Signed-off-by: Jason Baron <jbaron@akamai.com>
Reported-by: Wu Fengguang <fengguang.wu@intel.com>
Cc: Nathan Zimmer <nzimmer@sgi.com>
Cc: Eric Wong <normalperson@yhbt.net>
Cc: Nelson Elhage <nelhage@nelhage.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Davide Libenzi <davidel@xmailserver.org>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agoepoll: optimize EPOLL_CTL_DEL using rcu
Jason Baron [Tue, 5 Nov 2013 05:56:59 +0000 (16:56 +1100)]
epoll: optimize EPOLL_CTL_DEL using rcu

Nathan Zimmer found that once we get over 10+ cpus, the scalability of
SPECjbb falls over due to the contention on the global 'epmutex', which is
taken in on EPOLL_CTL_ADD and EPOLL_CTL_DEL operations.

Patch #1 removes the 'epmutex' lock completely from the EPOLL_CTL_DEL path
by using rcu to guard against any concurrent traversals.

Patch #2 remove the 'epmutex' lock from EPOLL_CTL_ADD operations for
simple topologies.  IE when adding a link from an epoll file descriptor to
a wakeup source, where the epoll file descriptor is not nested.

This patch (of 2):

Optimize EPOLL_CTL_DEL such that it does not require the 'epmutex' by
converting the file->f_ep_links list into an rcu one.  In this way, we can
traverse the epoll network on the add path in parallel with deletes.
Since deletes can't create loops or worse wakeup paths, this is safe.

This patch in combination with the patch "epoll: Do not take global 'epmutex'
for simple topologies", shows a dramatic performance improvement in
scalability for SPECjbb.

Signed-off-by: Jason Baron <jbaron@akamai.com>
Tested-by: Nathan Zimmer <nzimmer@sgi.com>
Cc: Eric Wong <normalperson@yhbt.net>
Cc: Nelson Elhage <nelhage@nelhage.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Davide Libenzi <davidel@xmailserver.org>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agocheckpatch-add-check-for-sscanf-without-return-use-v2
Joe Perches [Tue, 5 Nov 2013 05:56:58 +0000 (16:56 +1100)]
checkpatch-add-check-for-sscanf-without-return-use-v2

V2: Use the $Compare variable instead of just == or !=
    There are some tests that use < and >

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agocheckpatch: add check for sscanf without return use
Joe Perches [Tue, 5 Nov 2013 05:56:58 +0000 (16:56 +1100)]
checkpatch: add check for sscanf without return use

Naked use sscanf can be troublesome because the pointed to variables may
not have been set.

Add a warning when the sscanf return value is not used.

For now, do not add __must_check to the sscanf prototype because that will
cause a couple of hundred new warnings when compiling a kernel.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agocheckpatch: improve "return is not a function" test
Joe Perches [Tue, 5 Nov 2013 05:56:57 +0000 (16:56 +1100)]
checkpatch: improve "return is not a function" test

Find a few more cases where parentheses are used around the value of a
return statement.

This now uses the "$balanced_parens" test and also makes the test depend
on perl v5.10 and higher.

This now finds return with parenthesis uses the old code did not find
like:

ERROR: return is not a function, parentheses are not required
#211: FILE: arch/m68k/include/asm/sun3xflop.h:211:
+ return ((error == 0) ? 0 : -1);

Signed-off-by: Joe Perches <joe@perches.com>
Tested-by: David Cohen <david.a.cohen@linux.intel.com>
Acked-by: David Cohen <david.a.cohen@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agocheckpatch.pl: check for the FSF mailing address
Josh Triplett [Tue, 5 Nov 2013 05:56:57 +0000 (16:56 +1100)]
checkpatch.pl: check for the FSF mailing address

Kernel maintainers reject new instances of the GPL boilerplate paragraph
directing people to write to the FSF for a copy of the GPL, since the FSF
has moved in the past and may do so again.

Make this an error for new code, but just a --strict CHK in --file mode;
anyone interested in doing tree-wide cleanups of this form can enable this
test explicitly.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agocheckpatch: make the memory barrier test noisier
Joe Perches [Tue, 5 Nov 2013 05:56:56 +0000 (16:56 +1100)]
checkpatch: make the memory barrier test noisier

Peter Zijlstra prefers that comments be required near uses of memory
barriers.

Change the message level for memory barrier uses from a --strict test only
to a normal WARN so it's always emitted.

This might produce false positives around insertions of memory barriers
when a comment is outside the patch context block.

And checkpatch is still stupid, it only looks for existence of any
comment, not at the comment content.

Signed-off-by: Joe Perches <joe@perches.com>
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agocheckpatch: add rules to check init attribute and const defects
Joe Perches [Tue, 5 Nov 2013 05:56:55 +0000 (16:56 +1100)]
checkpatch: add rules to check init attribute and const defects

People get this regularly wrong and it breaks the LTO builds, as it causes
a section attribute conflict.

Add --fix capability too.

Based on a patch from Andi Kleen.

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agocheckpatch: add test for #defines of ARCH_HAS_<foo>
Joe Perches [Tue, 5 Nov 2013 05:56:55 +0000 (16:56 +1100)]
checkpatch: add test for #defines of ARCH_HAS_<foo>

Add a test for these #defines

Additionally, moved string_find_replace sub as it screws up subsequent
formatting when placed inside another sub.

Signed-off-by: Joe Perches <joe@perches.com>
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agocheckpatch: find CamelCase definitions of struct/union/enum
Joe Perches [Tue, 5 Nov 2013 05:56:54 +0000 (16:56 +1100)]
checkpatch: find CamelCase definitions of struct/union/enum

Checkpatch doesn't currently find CamelCase definitions of structs, unions
or enums.

Add that ability.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agocheckpatch: update seq_<foo> tests
Joe Perches [Tue, 5 Nov 2013 05:56:54 +0000 (16:56 +1100)]
checkpatch: update seq_<foo> tests

seq_vprintf, seq_printf and seq_puts are logging functions and should be
allowed to exceed the maximium line length.

Add maximum line length exceptions for these functions.

Also, suggesting seq_printf conversions to seq_puts should be tested for
arguments after the format.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agocheckpatch: extend CamelCase types and ignore existing CamelCase uses in a patch
Joe Perches [Tue, 5 Nov 2013 05:56:53 +0000 (16:56 +1100)]
checkpatch: extend CamelCase types and ignore existing CamelCase uses in a patch

Extend the CamelCase words found to include structure members.

In https://lkml.org/lkml/2013/9/3/318 Sarah Sharp (mostly) wrote:

"In general, if checkpatch.pl complains about a variable a patch
introduces that's CamelCase, you should pay attention to it.  Otherwise,
[] ignore it."

So, if checking a patch, scan the original patched file if it's available
and add any preexisting CamelCase types so reuses do not generate
CamelCase messages.

That also means Andrew's not so cruelly spurned anymore.
https://lkml.org/lkml/2013/2/22/426

Signed-off-by: Joe Perches <joe@perches.com>
Suggested-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agocheckpatch: report missing spaces around trigraphs with --strict
Joe Perches [Tue, 5 Nov 2013 05:56:53 +0000 (16:56 +1100)]
checkpatch: report missing spaces around trigraphs with --strict

Spaces around trigraphs are specified by CodingStyle but checkpatch is
currently silent about them because there are many current instances
without them.

Make missing spaces around trigraphs a --strict message.

Signed-off-by: Joe Perches <joe@perches.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agolib: Add CRC64 ECMA module
Marian Chereji [Tue, 5 Nov 2013 05:56:52 +0000 (16:56 +1100)]
lib: Add CRC64 ECMA module

Add implementation of CRC64 ECMA checksum.

We have an IP Acceleration driver for Freescale network processors which
is using this CRC64.  However, it still needs some work in order for it to
become upstreamable.

Signed-off-by: Marian Chereji <marian.chereji@freescale.com>
Reviewed-by: Varvara Andrei-B21317 <andrei.varvara@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agosound/soc/pxa/mmp-pcm.c: use gen_pool_dma_alloc() to allocate dma buffer
Nicolin Chen [Tue, 5 Nov 2013 05:56:52 +0000 (16:56 +1100)]
sound/soc/pxa/mmp-pcm.c: use gen_pool_dma_alloc() to allocate dma buffer

Since gen_pool_dma_alloc() is introduced, we implement it to simplify code.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agosound/soc/davinci/davinci-pcm.c: use gen_pool_dma_alloc() in davinci-pcm.c
Nicolin Chen [Tue, 5 Nov 2013 05:56:51 +0000 (16:56 +1100)]
sound/soc/davinci/davinci-pcm.c: use gen_pool_dma_alloc() in davinci-pcm.c

Since gen_pool_dma_alloc() is introduced, we implement it to simplify code.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agodrivers/uio/uio_pruss.c: use gen_pool_dma_alloc() to allocate sram memory
Nicolin Chen [Tue, 5 Nov 2013 05:56:51 +0000 (16:56 +1100)]
drivers/uio/uio_pruss.c: use gen_pool_dma_alloc() to allocate sram memory

Since gen_pool_dma_alloc() is introduced, we implement it to simplify code.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Cc: "Hans J. Koch" <hjk@hansjkoch.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agodrivers/media/platform/coda.c: use gen_pool_dma_alloc() to allocate iram buffer
Nicolin Chen [Tue, 5 Nov 2013 05:56:50 +0000 (16:56 +1100)]
drivers/media/platform/coda.c: use gen_pool_dma_alloc() to allocate iram buffer

Since gen_pool_dma_alloc() is introduced, we implement it to simplify code.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agodrivers/dma/mmp_tdma.c: use gen_pool_dma_alloc() to allocate descriptor
Nicolin Chen [Tue, 5 Nov 2013 05:56:50 +0000 (16:56 +1100)]
drivers/dma/mmp_tdma.c: use gen_pool_dma_alloc() to allocate descriptor

Since gen_pool_dma_alloc() is introduced, we implement it to simplify code.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agoarch/arm/mach-davinci/sram.c: use gen_pool_dma_alloc() to sram.c
Nicolin Chen [Tue, 5 Nov 2013 05:56:49 +0000 (16:56 +1100)]
arch/arm/mach-davinci/sram.c: use gen_pool_dma_alloc() to sram.c

Since gen_pool_dma_alloc() is introduced, we implement it to simplify code.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agolib/genalloc: add a helper function for DMA buffer allocation
Nicolin Chen [Tue, 5 Nov 2013 05:56:48 +0000 (16:56 +1100)]
lib/genalloc: add a helper function for DMA buffer allocation

When using pool space for DMA buffer, there might be duplicated calling of
gen_pool_alloc() and gen_pool_virt_to_phys() in each implementation.

Thus it's better to add a simple helper function, a compatible one to the
common dma_alloc_coherent(), to save some code.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Cc: "Hans J. Koch" <hjk@hansjkoch.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agolib/digsig.c: use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))
Duan Jiong [Tue, 5 Nov 2013 05:56:48 +0000 (16:56 +1100)]
lib/digsig.c: use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))

Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Cc: James Morris <james.l.morris@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agolib/vsprintf.c: document formats for dentry and struct file
Olof Johansson [Tue, 5 Nov 2013 05:56:47 +0000 (16:56 +1100)]
lib/vsprintf.c: document formats for dentry and struct file

Looks like these were added to Documentation/printk-formats.txt but
not the in-file table.

Signed-off-by: Olof Johansson <olof@lixom.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agolib/debugobjects.c: remove unnecessary work pending test
Xie XiuQi [Tue, 5 Nov 2013 05:56:47 +0000 (16:56 +1100)]
lib/debugobjects.c: remove unnecessary work pending test

Remove unnecessary work pending test before calling schedule_work().  It
has been tested in queue_work_on() already.  No functional changed.

Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com>
Reviewed-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobitops/find: clarify and extend documentation
Cody P Schafer [Tue, 5 Nov 2013 05:56:46 +0000 (16:56 +1100)]
bitops/find: clarify and extend documentation

Add return value documentation and clarify the units of the @size
parameter.

Signed-off-by: Cody P Schafer <cody@linux.vnet.ibm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Cody P Schafer <cody@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agodrivers/video/backlight/hx8357.c: remove redundant of_match_ptr
Sachin Kamat [Tue, 5 Nov 2013 05:56:46 +0000 (16:56 +1100)]
drivers/video/backlight/hx8357.c: remove redundant of_match_ptr

'hx8357_dt_ids' is always compiled in.  Hence of_match_ptr is not needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: atmel-pwm-bl: use gpio_request_one
Johan Hovold [Tue, 5 Nov 2013 05:56:45 +0000 (16:56 +1100)]
backlight: atmel-pwm-bl: use gpio_request_one

Use devm_gpio_request_one rather than requesting and setting direction
in two calls.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: atmel-pwm-bl: refactor gpio_on handling
Johan Hovold [Tue, 5 Nov 2013 05:56:45 +0000 (16:56 +1100)]
backlight: atmel-pwm-bl: refactor gpio_on handling

Add helper function to control the gpio_on signal.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: atmel-pwm-bl: use gpio_is_valid
Johan Hovold [Tue, 5 Nov 2013 05:56:44 +0000 (16:56 +1100)]
backlight: atmel-pwm-bl: use gpio_is_valid

Use gpio_is_valid rather than open coding the more restrictive != -1
test.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: atmel-pwm-bl: remove unused include
Johan Hovold [Tue, 5 Nov 2013 05:56:44 +0000 (16:56 +1100)]
backlight: atmel-pwm-bl: remove unused include

Remove unused include of clk.h.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: atmel-pwm-bl: clean up get_intensity
Johan Hovold [Tue, 5 Nov 2013 05:56:43 +0000 (16:56 +1100)]
backlight: atmel-pwm-bl: clean up get_intensity

Clean up get_intensity to increase readability.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: atmel-pwm-bl: clean up probe error handling
Johan Hovold [Tue, 5 Nov 2013 05:56:43 +0000 (16:56 +1100)]
backlight: atmel-pwm-bl: clean up probe error handling

Clean up probe error handling by checking parameters before any
allocations and removing an obsolete error label.  Also remove unnecessary
reset of private gpio number.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: atmel-pwm-bl: fix module autoload
Johan Hovold [Tue, 5 Nov 2013 05:56:42 +0000 (16:56 +1100)]
backlight: atmel-pwm-bl: fix module autoload

Add missing module alias which is needed for module autoloading.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: atmel-pwm-bl: fix gpio polarity in remove
Johan Hovold [Tue, 5 Nov 2013 05:56:42 +0000 (16:56 +1100)]
backlight: atmel-pwm-bl: fix gpio polarity in remove

Make sure to honour gpio polarity also at remove so that the backlight is
actually disabled on boards with active-low enable pin.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: atmel-pwm-bl: fix reported brightness
Johan Hovold [Tue, 5 Nov 2013 05:56:41 +0000 (16:56 +1100)]
backlight: atmel-pwm-bl: fix reported brightness

The driver supports 16-bit brightness values, but the value returned
from get_brightness was truncated to eight bits.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agodrivers/video/backlight/lm3630a_bl.c: add missing destroy_workqueue() on error in...
Wei Yongjun [Tue, 5 Nov 2013 05:56:40 +0000 (16:56 +1100)]
drivers/video/backlight/lm3630a_bl.c: add missing destroy_workqueue() on error in lm3630a_intr_config()

Add the missing destroy_workqueue() before return from
lm3630a_intr_config() in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: s6e63m0: use devm_{backlight,lcd}_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:40 +0000 (16:56 +1100)]
backlight: s6e63m0: use devm_{backlight,lcd}_device_register()

Use devm_backlight_device_register() and devm_lcd_device_register() to
make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: cr_bllcd: use devm_{backlight,lcd}_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:39 +0000 (16:56 +1100)]
backlight: cr_bllcd: use devm_{backlight,lcd}_device_register()

Use devm_backlight_device_register() and devm_lcd_device_register() to
make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: corgi_lcd: use devm_{backlight,lcd}_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:39 +0000 (16:56 +1100)]
backlight: corgi_lcd: use devm_{backlight,lcd}_device_register()

Use devm_backlight_device_register() and devm_lcd_device_register() to
make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: ld9040: use devm_{backlight,lcd}_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:38 +0000 (16:56 +1100)]
backlight: ld9040: use devm_{backlight,lcd}_device_register()

Use devm_backlight_device_register() and devm_lcd_device_register() to
make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: ams369fg06: use devm_{backlight,lcd}_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:38 +0000 (16:56 +1100)]
backlight: ams369fg06: use devm_{backlight,lcd}_device_register()

Use devm_backlight_device_register() and devm_lcd_device_register() to
make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: tdo24m: use devm_lcd_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:37 +0000 (16:56 +1100)]
backlight: tdo24m: use devm_lcd_device_register()

Use devm_lcd_device_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: platform_lcd: use devm_lcd_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:37 +0000 (16:56 +1100)]
backlight: platform_lcd: use devm_lcd_device_register()

Use devm_lcd_device_register() to make cleanup paths simpler, and remove
unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: ltv350qv: use devm_lcd_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:36 +0000 (16:56 +1100)]
backlight: ltv350qv: use devm_lcd_device_register()

Use devm_lcd_device_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: lms501kf03: use devm_lcd_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:36 +0000 (16:56 +1100)]
backlight: lms501kf03: use devm_lcd_device_register()

Use devm_lcd_device_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: lms283gf05: use devm_lcd_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:35 +0000 (16:56 +1100)]
backlight: lms283gf05: use devm_lcd_device_register()

Use devm_lcd_device_register() to make cleanup paths simpler, and remove
unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: ili9320: use devm_lcd_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:34 +0000 (16:56 +1100)]
backlight: ili9320: use devm_lcd_device_register()

Use devm_lcd_device_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: ili922x: use devm_lcd_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:34 +0000 (16:56 +1100)]
backlight: ili922x: use devm_lcd_device_register()

Use devm_lcd_device_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: hx8357: use devm_lcd_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:33 +0000 (16:56 +1100)]
backlight: hx8357: use devm_lcd_device_register()

Use devm_lcd_device_register() to make cleanup paths simpler, and remove
unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: wm831x_bl: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:33 +0000 (16:56 +1100)]
backlight: wm831x_bl: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler, and
remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: tps65217_bl: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:32 +0000 (16:56 +1100)]
backlight: tps65217_bl: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler, and
remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: pcf50633: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:32 +0000 (16:56 +1100)]
backlight: pcf50633: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler, and
remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: pandora_bl: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:31 +0000 (16:56 +1100)]
backlight: pandora_bl: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler, and
remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: max8925_bl: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:31 +0000 (16:56 +1100)]
backlight: max8925_bl: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler, and
remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: lv5207lp: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:30 +0000 (16:56 +1100)]
backlight: lv5207lp: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: lp855x: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:30 +0000 (16:56 +1100)]
backlight: lp855x: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler.  Also,
unnecessary lp855x_backlight_unregister() is removed.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: lm3533_bl: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:29 +0000 (16:56 +1100)]
backlight: lm3533_bl: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: kb3886_bl: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:28 +0000 (16:56 +1100)]
backlight: kb3886_bl: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler, and
remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: gpio_backlight: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:28 +0000 (16:56 +1100)]
backlight: gpio_backlight: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler, and
remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: generic_bl: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:27 +0000 (16:56 +1100)]
backlight: generic_bl: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: ep93xx: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:27 +0000 (16:56 +1100)]
backlight: ep93xx: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler, and
remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: da9052_bl: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:26 +0000 (16:56 +1100)]
backlight: da9052_bl: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: da903x_bl: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:26 +0000 (16:56 +1100)]
backlight: da903x_bl: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler, and
remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: bd6107: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:25 +0000 (16:56 +1100)]
backlight: bd6107: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: atmel-pwm-bl: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:25 +0000 (16:56 +1100)]
backlight: atmel-pwm-bl: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: as3711_bl: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:24 +0000 (16:56 +1100)]
backlight: as3711_bl: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler, and
remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: adp8870: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:23 +0000 (16:56 +1100)]
backlight: adp8870: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: adp8860: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:23 +0000 (16:56 +1100)]
backlight: adp8860: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: adp5520: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:22 +0000 (16:56 +1100)]
backlight: adp5520: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: aat2870: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:22 +0000 (16:56 +1100)]
backlight: aat2870: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: 88pm860x_bl: use devm_backlight_device_register()
Jingoo Han [Tue, 5 Nov 2013 05:56:21 +0000 (16:56 +1100)]
backlight: 88pm860x_bl: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler, and
remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: use dev_get_platdata()
Jingoo Han [Tue, 5 Nov 2013 05:56:21 +0000 (16:56 +1100)]
backlight: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: lp8788: Staticize 'default_bl_config'
Jingoo Han [Tue, 5 Nov 2013 05:56:20 +0000 (16:56 +1100)]
backlight: lp8788: Staticize 'default_bl_config'

Fix the following sparse warning:

drivers/video/backlight/lp8788_bl.c:55:25: warning: symbol 'default_bl_config' was not declared. Should it be static?

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: lm3639: Don't mix different enum types
Jingoo Han [Tue, 5 Nov 2013 05:56:19 +0000 (16:56 +1100)]
backlight: lm3639: Don't mix different enum types

Don't mix different enum types to fix the sparse warnings.

drivers/video/backlight/lm3639_bl.c:80:51: warning: mixing different enum types
drivers/video/backlight/lm3639_bl.c:80:51:     int enum lm3639_fleds  versus
drivers/video/backlight/lm3639_bl.c:80:51:     int enum lm3639_bleds
drivers/video/backlight/lm3639_bl.c:82:51: warning: mixing different enum types
drivers/video/backlight/lm3639_bl.c:82:51:     int enum lm3639_fleds  versus
drivers/video/backlight/lm3639_bl.c:82:51:     int enum lm3639_bleds

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: ld9040: Staticize local variable gamma_table
Jingoo Han [Tue, 5 Nov 2013 05:56:19 +0000 (16:56 +1100)]
backlight: ld9040: Staticize local variable gamma_table

Fix the following sparse warnings:

drivers/video/backlight/ld9040_gamma.h:172:3: warning: symbol 'gamma_table' was not declared. Should it be static?

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: lm3630: fix sparse warning
Daniel Jeong [Tue, 5 Nov 2013 05:56:18 +0000 (16:56 +1100)]
backlight: lm3630: fix sparse warning

This patch is to fix sparse warning due to mixing different enum type.

Signed-off-by: Daniel Jeong <gshark.jeong@gmail.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agodrivers/video/backlight/lm3630a_bl.c: potential NULL deref in probe()
Dan Carpenter [Tue, 5 Nov 2013 05:56:18 +0000 (16:56 +1100)]
drivers/video/backlight/lm3630a_bl.c: potential NULL deref in probe()

We dereference "pdata" later in the function so we can't leave it as NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agodrivers/video/backlight/lm3630a_bl.c: fix signedness bug in lm3630a_chip_init()
Dan Carpenter [Tue, 5 Nov 2013 05:56:17 +0000 (16:56 +1100)]
drivers/video/backlight/lm3630a_bl.c: fix signedness bug in lm3630a_chip_init()

"rval" needs to be signed for the error handling to work.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: lm3630: apply chip revision
Daniel Jeong [Tue, 5 Nov 2013 05:56:17 +0000 (16:56 +1100)]
backlight: lm3630: apply chip revision

The LM3630 chip was revised by TI and chip name was also changed to
LM3630A.  And register map, default values and initial sequences are
changed.  The files, lm3630_bl.{c,h} are replaced by lm3630a_bl.{c,h} You
can find more information about LM3630A(datasheet, evm etc) at
http://www.ti.com/product/lm3630a

Signed-off-by: Daniel Jeong <gshark.jeong@gmail.com>
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agobacklight: lp855x_bl: support new LP8555 device
Milo Kim [Tue, 5 Nov 2013 05:56:16 +0000 (16:56 +1100)]
backlight: lp855x_bl: support new LP8555 device

LP8555 is one of the LP855x family devices.

This device needs pre_init_device() and post_init_device() driver
structure.  It's same as LP8557, so the device configuration code is
shared with LP8557.  Backlight outputs are generated from dual DC-DC boost
converters.  It's configurable EPROM settings which are defined in the
platform data.

Driver documentation and device tree bindings are updated.

Signed-off-by: Milo Kim <milo.kim@ti.com>
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agomaintainers-remove-richard-purdie-as-backlight-maintainer-fix
Andrew Morton [Tue, 5 Nov 2013 05:56:16 +0000 (16:56 +1100)]
maintainers-remove-richard-purdie-as-backlight-maintainer-fix

s/USA/UK/

Cc: Jingoo Han <jg1.han@samsung.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agoMAINTAINERS: remove Richard Purdie as backlight maintainer
Jingoo Han [Tue, 5 Nov 2013 05:56:15 +0000 (16:56 +1100)]
MAINTAINERS: remove Richard Purdie as backlight maintainer

Remove Richard Purdie as backlight subsystem maintainer,

akpm: Richard is still responsive and is reviewing some of the patches,
but appears to agree that listing him as the maintainer is no longer
appropriate.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agoget_maintainer.pl incomplete output
Joe Perches [Tue, 5 Nov 2013 05:56:15 +0000 (16:56 +1100)]
get_maintainer.pl incomplete output

Try this:

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agokernel/printk/printk.c: boot_delay return value fix
Dave Young [Tue, 5 Nov 2013 05:56:14 +0000 (16:56 +1100)]
kernel/printk/printk.c: boot_delay return value fix

Kernel report "Malformed early option boot_delay" because it returns
non-zero value.  Move to 'return 0' now because there's no reason it
should return 1.

Signed-off-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agokernel/printk/printk.c: enable boot delay for earlyprintk
Dave Young [Tue, 5 Nov 2013 05:56:13 +0000 (16:56 +1100)]
kernel/printk/printk.c: enable boot delay for earlyprintk

boot_delay does not work for earlyprintk because the kernel cmdline
parsing is late.

Change to use early_param so early kernel messages can also be delayed.

Signed-off-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agovsprintf: check real user/group id for %pK
Ryan Mallon [Tue, 5 Nov 2013 05:56:13 +0000 (16:56 +1100)]
vsprintf: check real user/group id for %pK

Some setuid binaries will allow reading of files which have read
permission by the real user id.  This is problematic with files which use
%pK because the file access permission is checked at open() time, but the
kptr_restrict setting is checked at read() time.  If a setuid binary opens
a %pK file as an unprivileged user, and then elevates permissions before
reading the file, then kernel pointer values may be leaked.

This happens for example with the setuid pppd application on Ubuntu 12.04:

  $ head -1 /proc/kallsyms
  00000000 T startup_32

  $ pppd file /proc/kallsyms
  pppd: In file /proc/kallsyms: unrecognized option 'c1000000'

This will only leak the pointer value from the first line, but other
setuid binaries may leak more information.

Fix this by adding a check that in addition to the current process having
CAP_SYSLOG, that effective user and group ids are equal to the real ids.
If a setuid binary reads the contents of a file which uses %pK then the
pointer values will be printed as NULL if the real user is unprivileged.

Update the sysctl documentation to reflect the changes, and also correct
the documentation to state the kptr_restrict=0 is the default.

This is a only temporary solution to the issue.  The correct solution is
to do the permission check at open() time on files, and to replace %pK
with a function which checks the open() time permission.  %pK uses in
printk should be removed since no sane permission check can be done, and
instead protected by using dmesg_restrict.

Signed-off-by: Ryan Mallon <rmallon@gmail.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Joe Perches <joe@perches.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agokernel/printk/printk.c: convert to pr_foo()
Andrew Morton [Tue, 5 Nov 2013 05:56:12 +0000 (16:56 +1100)]
kernel/printk/printk.c: convert to pr_foo()

It was half-and-half.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Joe Perches <joe@perches.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agoprintk: report console names during cut-over
Kees Cook [Tue, 5 Nov 2013 05:56:12 +0000 (16:56 +1100)]
printk: report console names during cut-over

This reports the names of consoles as they're being disabled to help
identify which is which during cut-over.  Helps answer the question "which
boot console actually got activated?" once the regular console is running,
mostly when debugging boot console failures.

Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Joe Perches <joe@perches.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agodrivers/misc/ti-st/st_core.c: fix NULL dereference on protocol type check
Gustavo Padovan [Tue, 5 Nov 2013 05:56:11 +0000 (16:56 +1100)]
drivers/misc/ti-st/st_core.c: fix NULL dereference on protocol type check

If the type we receive is greater than ST_MAX_CHANNELS we can't rely on
type as vector index since we would be accessing unknown memory when we use the type
as index.

 Unable to handle kernel NULL pointer dereference at virtual address 0000001b
 pgd = c0004000
 [0000001b] *pgd=00000000
 Internal error: Oops: 17 [#1] PREEMPT SMP ARM
 Modules linked in: btwilink wl12xx wlcore mac80211 cfg80211 rfcomm bnep bluo
 CPU: 0    Tainted: G        W     (3.4.0+ #15)
 PC is at st_int_recv+0x278/0x344
 LR is at get_parent_ip+0x14/0x30
 pc : [<c03b01a8>]    lr : [<c007273c>]    psr: 200f0193
 sp : dc631ed0  ip : e3e21c24  fp : dc631f04
 r10: 00000000  r9 : 600f0113  r8 : 0000003f
 r7 : e3e21b14  r6 : 00000067  r5 : e2e49c1c  r4 : e3e21a80
 r3 : 00000001  r2 : 00000001  r1 : 00000001  r0 : 600f0113
 Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
 Control: 10c5387d  Table: 9c50004a  DAC: 00000015

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agoinit/main.c: remove prototype for softirq_init()
Geert Uytterhoeven [Tue, 5 Nov 2013 05:56:11 +0000 (16:56 +1100)]
init/main.c: remove prototype for softirq_init()

It's already available in <linux/interrupt.h>

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agolglock: map to spinlock when !CONFIG_SMP
Josh Triplett [Tue, 5 Nov 2013 05:56:10 +0000 (16:56 +1100)]
lglock: map to spinlock when !CONFIG_SMP

When the system has only one CPU, lglock is effectively a spinlock; map it
directly to spinlock to eliminate the indirection and duplicate code.

In addition to removing overhead, this drops 1.6k of code with a defconfig
modified to have !CONFIG_SMP, and 1.1k with a minimal config.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: David Howells <dhowells@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Nick Piggin <npiggin@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agosched: remove ARCH specific fpu_counter from task_struct
Vineet Gupta [Tue, 5 Nov 2013 05:56:09 +0000 (16:56 +1100)]
sched: remove ARCH specific fpu_counter from task_struct

fpu_counter in task_struct was used only by sh/x86.  Both of these now
carry it in ARCH specific thread_struct, hence this can now be removed
from generic task_struct, shrinking it slightly for other arches.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul Mundt <paul.mundt@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agox86: move fpu_counter into ARCH specific thread_struct
Vineet Gupta [Tue, 5 Nov 2013 05:56:09 +0000 (16:56 +1100)]
x86: move fpu_counter into ARCH specific thread_struct

Only a couple of arches (sh/x86) use fpu_counter in task_struct so it can
be moved out into ARCH specific thread_struct, reducing the size of
task_struct for other arches.

Compile tested i386_defconfig + gcc 4.7.3

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: Paul Mundt <paul.mundt@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agosh: move fpu_counter into ARCH specific thread_struct
Vineet Gupta [Tue, 5 Nov 2013 05:56:08 +0000 (16:56 +1100)]
sh: move fpu_counter into ARCH specific thread_struct

Only a couple of arches (sh/x86) use fpu_counter in task_struct so it can
be moved out into ARCH specific thread_struct, reducing the size of
task_struct for other arches.

Compile tested sh defconfig + sh4-linux-gcc (4.6.3)

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Paul Mundt <paul.mundt@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agojump_label: unlikely(x) > 0
Roel Kluin [Tue, 5 Nov 2013 05:56:08 +0000 (16:56 +1100)]
jump_label: unlikely(x) > 0

if (unlikely(x) > 0) doesn't seem to help branch prediction

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: "H. Peter Anvin" <hpa@linux.intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agokernel/sys.c: remove obsolete #include <linux/kexec.h>
Geert Uytterhoeven [Tue, 5 Nov 2013 05:56:07 +0000 (16:56 +1100)]
kernel/sys.c: remove obsolete #include <linux/kexec.h>

15d94b82565ebfb0 ("reboot: move shutdown/reboot related functions to
kernel/reboot.c") moved all kexec-related functionality to
kernel/reboot.c, so kernel/sys.c no longer needs to include
<linux/kexec.h>.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Robin Holt <holt@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agokernel/delayacct.c: remove redundant checking in __delayacct_add_tsk()
Chen Gang [Tue, 5 Nov 2013 05:56:07 +0000 (16:56 +1100)]
kernel/delayacct.c: remove redundant checking in __delayacct_add_tsk()

The wrapper function delayacct_add_tsk() already checked 'tsk->delays',
and __delayacct_add_tsk() has no another direct callers, so can remove the
redundancy checking code.

And the label 'done' is also useless, so remove it, too.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
10 years agogen_init_cpio: avoid NULL pointer dereference and rework env expanding
Michal Nazarewicz [Tue, 5 Nov 2013 05:56:06 +0000 (16:56 +1100)]
gen_init_cpio: avoid NULL pointer dereference and rework env expanding

getenv() may return NULL if given environment variable does not exist
which leads to NULL dereference when calling strncat.

Besides that, the environment variable name was copied to a temporary
env_var buffer, but this copying can be avoided by simply using the input
string.

Lastly, the whole loop can be greatly simplified by using the snprintf
function instead of the playing with strncat.

 By the way, the current implementation allows a recursive variable
 expansion, as in:

   $ echo 'out ${A} out ' | A='a ${B} a' B=b /tmp/a
   out a b a out

 I'm assuming this is just a side effect and not a conscious decision
 (especially as this may lead to infinite loop), but I didn't want to
 change this behaviour without consulting.

 If the current behaviour is deamed incorrect, I'll be happy to send
 a patch without recursive processing.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Jesper Juhl <jj@codesealer.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>