]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
11 years agortc: rtc-spear: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:07 +0000 (15:08 +1100)]
rtc: rtc-spear: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-snvs: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:07 +0000 (15:08 +1100)]
rtc: rtc-snvs: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-s3c: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:07 +0000 (15:08 +1100)]
rtc: rtc-s3c: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-pcf8523: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:06 +0000 (15:08 +1100)]
rtc: rtc-pcf8523: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-palmas: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:06 +0000 (15:08 +1100)]
rtc: rtc-palmas: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-mxc: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:06 +0000 (15:08 +1100)]
rtc: rtc-mxc: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-mv: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:05 +0000 (15:08 +1100)]
rtc: rtc-mv: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-max8997: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:05 +0000 (15:08 +1100)]
rtc: rtc-max8997: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-max8907: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:05 +0000 (15:08 +1100)]
rtc: rtc-max8907: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-max77686: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:05 +0000 (15:08 +1100)]
rtc: rtc-max77686: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler. Also, this patch uses devm_request_threaded_irq().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-lpc32xx: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:04 +0000 (15:08 +1100)]
rtc: rtc-lpc32xx: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-lp8788: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:04 +0000 (15:08 +1100)]
rtc: rtc-lp8788: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-imxdi: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:04 +0000 (15:08 +1100)]
rtc: rtc-imxdi: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-ep93xx: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:03 +0000 (15:08 +1100)]
rtc: rtc-ep93xx: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-ds1742: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:03 +0000 (15:08 +1100)]
rtc: rtc-ds1742: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-ds1553: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:03 +0000 (15:08 +1100)]
rtc: rtc-ds1553: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-ds1511: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:03 +0000 (15:08 +1100)]
rtc: rtc-ds1511: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-davinci: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:02 +0000 (15:08 +1100)]
rtc: rtc-davinci: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-da9055: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:02 +0000 (15:08 +1100)]
rtc: rtc-da9055: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-da9052: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:02 +0000 (15:08 +1100)]
rtc: rtc-da9052: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-coh90133: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:01 +0000 (15:08 +1100)]
rtc: rtc-coh90133: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-88pm80x: use devm_rtc_device_register()
Jingoo Han [Wed, 20 Mar 2013 04:08:01 +0000 (15:08 +1100)]
rtc: rtc-88pm80x: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup
paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-tx4939: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:08:01 +0000 (15:08 +1100)]
rtc: rtc-tx4939: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-tegra: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:08:01 +0000 (15:08 +1100)]
rtc: rtc-tegra: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-sun4v: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:08:00 +0000 (15:08 +1100)]
rtc: rtc-sun4v: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-starfire: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:08:00 +0000 (15:08 +1100)]
rtc: rtc-starfire: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-sh: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:08:00 +0000 (15:08 +1100)]
rtc: rtc-sh: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-rp5c01: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:07:59 +0000 (15:07 +1100)]
rtc: rtc-rp5c01: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-pxa: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:07:59 +0000 (15:07 +1100)]
rtc: rtc-pxa: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-ps3: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:07:59 +0000 (15:07 +1100)]
rtc: rtc-ps3: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-pcap: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:07:59 +0000 (15:07 +1100)]
rtc: rtc-pcap: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-omap: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:07:58 +0000 (15:07 +1100)]
rtc: rtc-omap: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-nuc900: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:07:58 +0000 (15:07 +1100)]
rtc: rtc-nuc900: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-mv: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:07:58 +0000 (15:07 +1100)]
rtc: rtc-mv: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-msm6242: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:07:58 +0000 (15:07 +1100)]
rtc: rtc-msm6242: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-mc13xxx: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:07:57 +0000 (15:07 +1100)]
rtc: rtc-mc13xxx: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-imxdi: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:07:57 +0000 (15:07 +1100)]
rtc: rtc-imxdi: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-generic: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:07:57 +0000 (15:07 +1100)]
rtc: rtc-generic: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-efi: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:07:56 +0000 (15:07 +1100)]
rtc: rtc-efi: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-ds1302: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:07:56 +0000 (15:07 +1100)]
rtc: rtc-ds1302: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-davinci: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:07:56 +0000 (15:07 +1100)]
rtc: rtc-davinci: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-coh901331: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:07:56 +0000 (15:07 +1100)]
rtc: rtc-coh901331: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-au1xxx: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:07:55 +0000 (15:07 +1100)]
rtc: rtc-au1xxx: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-at91rm9200: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:07:55 +0000 (15:07 +1100)]
rtc: rtc-at91rm9200: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-at32ap700x: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:07:55 +0000 (15:07 +1100)]
rtc: rtc-at32ap700x: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-ab3100: use module_platform_driver_probe()
Jingoo Han [Wed, 20 Mar 2013 04:07:54 +0000 (15:07 +1100)]
rtc: rtc-ab3100: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/rtc/class.c: use struct device as the first argument for devm_rtc_device_regi...
Jingoo Han [Wed, 20 Mar 2013 04:07:54 +0000 (15:07 +1100)]
drivers/rtc/class.c: use struct device as the first argument for devm_rtc_device_register()

Other devm_* APIs use 'struct device *dev' as the first argument.  Thus,
in order to sync with other devm_* functions, struct device is used as the
first argument for devm_rtc_device_register().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/rtc/rtc-v3020.c: use gpio_request_array()
Jingoo Han [Wed, 20 Mar 2013 04:07:54 +0000 (15:07 +1100)]
drivers/rtc/rtc-v3020.c: use gpio_request_array()

Using gpio_request_array()/gpio_free_array() can make the code simpler
because it can set the direction and initial value in one shot and the for
loop is unnecessary.

Also, struct v3020_gpio is removed, because the struct v3020_gpio is
replaced with struct gpio.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/rtc/rtc-max77686.c: use dev_info()/dev_emerg() instead of pr_info()/pr_emerg()
Jingoo Han [Wed, 20 Mar 2013 04:07:54 +0000 (15:07 +1100)]
drivers/rtc/rtc-max77686.c: use dev_info()/dev_emerg() instead of pr_info()/pr_emerg()

dev_info()/dev_emerg() are preferred to pr_info()/pr_emerg().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/rtc/rtc-max77686.c: fix indentation of bit definitions
Jingoo Han [Wed, 20 Mar 2013 04:07:53 +0000 (15:07 +1100)]
drivers/rtc/rtc-max77686.c: fix indentation of bit definitions

Fix indentation of bit definitions to enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/rtc/rtc-max77686.c: use devm_kzalloc()
Jingoo Han [Wed, 20 Mar 2013 04:07:53 +0000 (15:07 +1100)]
drivers/rtc/rtc-max77686.c: use devm_kzalloc()

Use devm_kzalloc() to make cleanup paths more simple.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/rtc/rtc-max77686.c: add missing module author name
Jingoo Han [Wed, 20 Mar 2013 04:07:53 +0000 (15:07 +1100)]
drivers/rtc/rtc-max77686.c: add missing module author name

Add missing module author name to MODULE_AUTHOR macro.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/rtc/rtc-max77686.c: use module_platform_driver()
Jingoo Han [Wed, 20 Mar 2013 04:07:52 +0000 (15:07 +1100)]
drivers/rtc/rtc-max77686.c: use module_platform_driver()

Use module_platform_driver() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: add devm_rtc_device_{register,unregister}()
Jingoo Han [Wed, 20 Mar 2013 04:07:52 +0000 (15:07 +1100)]
rtc: add devm_rtc_device_{register,unregister}()

These functions allow the driver core to automatically clean up any
allocation made by rtc drivers.  Thus it simplifies the error paths.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-tegra: add __init/__exit annotation
Jingoo Han [Wed, 20 Mar 2013 04:07:52 +0000 (15:07 +1100)]
rtc: rtc-tegra: add __init/__exit annotation

When platform_driver_probe() is used, bind/unbind via sysfs is disabled.
Thus, __init/__exit annotations can be added to probe()/remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-pcap: add __init/__exit annotation
Jingoo Han [Wed, 20 Mar 2013 04:07:52 +0000 (15:07 +1100)]
rtc: rtc-pcap: add __init/__exit annotation

When platform_driver_probe() is used, bind/unbind via sysfs is disabled.
Thus, __init/__exit annotations can be added to probe()/remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-nuc900: add __init/__exit annotation
Jingoo Han [Wed, 20 Mar 2013 04:07:51 +0000 (15:07 +1100)]
rtc: rtc-nuc900: add __init/__exit annotation

When platform_driver_probe() is used, bind/unbind via sysfs is disabled.
Thus, __init/__exit annotations can be added to probe()/remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-imxdi: add __init/__exit annotation
Jingoo Han [Wed, 20 Mar 2013 04:07:51 +0000 (15:07 +1100)]
rtc: rtc-imxdi: add __init/__exit annotation

When platform_driver_probe() is used, bind/unbind via sysfs is disabled.
Thus, __init/__exit annotations can be added to probe()/remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-ds1302: add __exit annotation
Jingoo Han [Wed, 20 Mar 2013 04:07:51 +0000 (15:07 +1100)]
rtc: rtc-ds1302: add __exit annotation

When platform_driver_probe() is used, bind/unbind via sysfs is disabled.
Thus, __init/__exit annotations can be added to probe()/remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-davinci: add __exit annotation
Jingoo Han [Wed, 20 Mar 2013 04:07:50 +0000 (15:07 +1100)]
rtc: rtc-davinci: add __exit annotation

When platform_driver_probe() is used, bind/unbind via sysfs is disabled.
Thus, __init/__exit annotations can be added to probe()/remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agortc: rtc-mv: add __init annotation
Jingoo Han [Wed, 20 Mar 2013 04:07:50 +0000 (15:07 +1100)]
rtc: rtc-mv: add __init annotation

When platform_driver_probe() is used, bind/unbind via sysfs is disabled.
Thus, __init/__exit annotations can be added to probe()/remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoi2o: check copy_from_user() size parameter
Dan Carpenter [Wed, 20 Mar 2013 04:07:50 +0000 (15:07 +1100)]
i2o: check copy_from_user() size parameter

Limit the size of the copy so we don't corrupt memory.  Hopefully this can
only be called by root, but fixing this makes the static checkers happier.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Masanari Iida <standby24x7@gmail.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodmi_scan: proper buf type in dmi_present()
Artem Savkov [Wed, 20 Mar 2013 04:07:50 +0000 (15:07 +1100)]
dmi_scan: proper buf type in dmi_present()

buf needs to be unsigned in dmi_present(), otherwise dmi_base calculation
doesn't work properly leading to a wraparound during dmi_ioremap:

[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: at arch/x86/mm/ioremap.c:524 __early_ioremap+0x85/0x18a()
[    0.000000] Modules linked in:
[    0.000000] Pid: 0, comm: swapper Not tainted 3.9.0-rc2-next-20130312 #283
[    0.000000] Call Trace:
[    0.000000]  [<c1036992>] warn_slowpath_common+0x72/0xa0
[    0.000000]  [<c19cc176>] ? __early_ioremap+0x85/0x18a
[    0.000000]  [<c19cc176>] ? __early_ioremap+0x85/0x18a
[    0.000000]  [<c10369e2>] warn_slowpath_null+0x22/0x30
[    0.000000]  [<c19cc176>] __early_ioremap+0x85/0x18a
[    0.000000]  [<c19cc1ed>] ? __early_ioremap+0xfc/0x18a
[    0.000000]  [<c19cc412>] early_ioremap+0xd/0xf
[    0.000000]  [<c19fbba9>] dmi_present+0xf5/0x22a
[    0.000000]  [<c19fbd9d>] dmi_scan_machine+0xbf/0x11c
[    0.000000]  [<c19bd781>] setup_arch+0x4db/0xca0
[    0.000000]  [<c168105c>] ? printk+0x3d/0x3f
[    0.000000]  [<c19ba763>] start_kernel+0x7b/0x329
[    0.000000]  [<c19ba361>] i386_start_kernel+0x137/0x13a
[    0.000000] ---[ end trace 4eaa2a86a8e2da22 ]---
[    0.000000] DMI not present or invalid.

Introduced in "dmi_scan: refactor dmi_scan_machine(), {smbios,dmi}_present()"

Signed-off-by: Artem Savkov <artem.savkov@gmail.com>
Acked-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodmi_scan: refactor dmi_scan_machine(), {smbios,dmi}_present()
Ben Hutchings [Wed, 20 Mar 2013 04:07:49 +0000 (15:07 +1100)]
dmi_scan: refactor dmi_scan_machine(), {smbios,dmi}_present()

Move the calls to memcpy_fromio() up into the loop in dmi_scan_machine(),
and move the signature checks back down into dmi_decode().  We need to
check at 16-byte intervals but keep a 32-byte buffer for an SMBIOS entry,
so shift the buffer after each iteration.

Merge smbios_present() into dmi_present(), so we look for an SMBIOS
signature at the beginning of the given buffer and then for a DMI
signature at an offset of 16 bytes.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Reported-by: Tim McGrath <tmhikaru@gmail.com>
Tested-by: Tim Mcgrath <tmhikaru@gmail.com>
Cc: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoinit: scream bloody murder if interrupts are enabled too early
Steven Rostedt [Wed, 20 Mar 2013 04:07:49 +0000 (15:07 +1100)]
init: scream bloody murder if interrupts are enabled too early

As I was testing a lot of my code recently, and having several
"successes", I accidentally noticed in the dmesg this little line:

[    0.000000] start_kernel(): bug: interrupts were enabled *very* early, fixing it

Sure enough, one of my patches two commits ago enabled interrupts early.
The sad part here is that I never noticed it, and I ran several tests with
ktest too, and ktest did not notice this line.

What ktest looks for (and so does many other automated testing scripts) is
a back trace produced by a WARN_ON() or BUG().  As a back trace was never
produced, my buggy patch could have slipped into linux-next, or even
worse, mainline.

Adding a WARN(!irqs_disabled()) makes this bug a little more obvious:

[    0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
[    0.000000] __ex_table already sorted, skipping sort
[    0.000000] Checking aperture...
[    0.000000] No AGP bridge found
[    0.000000] Calgary: detecting Calgary via BIOS EBDA area
[    0.000000] Calgary: Unable to locate Rio Grande table in EBDA - bailing!
[    0.000000] Memory: 2003252k/2054848k available (4857k kernel code, 460k absent, 51136k reserved, 6210k data, 1096k init)
[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: at /home/rostedt/work/git/linux-trace.git/init/main.c:543 start_kernel+0x21e/0x415()
[    0.000000] Hardware name: To Be Filled By O.E.M.
[    0.000000] Interrupts were enabled *very* early, fixing it
[    0.000000] Modules linked in:
[    0.000000] Pid: 0, comm: swapper/0 Not tainted 3.8.0-test+ #286
[    0.000000] Call Trace:
[    0.000000]  [<ffffffff81037b79>] warn_slowpath_common+0x83/0x9b
[    0.000000]  [<ffffffff81037c34>] warn_slowpath_fmt+0x46/0x48
[    0.000000]  [<ffffffff81ae4a39>] start_kernel+0x21e/0x415
[    0.000000]  [<ffffffff81ae4623>] ? repair_env_string+0x56/0x56
[    0.000000]  [<ffffffff81ae4312>] x86_64_start_reservations+0x10e/0x112
[    0.000000]  [<ffffffff81ae4120>] ? early_idt_handlers+0x120/0x120
[    0.000000]  [<ffffffff81ae4418>] x86_64_start_kernel+0x102/0x111
[    0.000000] ---[ end trace 007d8b0491b4f5d8 ]---
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000]  RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    0.000000] NR_IRQS:4352 nr_irqs:712 16
[    0.000000] Console: colour VGA+ 80x25
[    0.000000] console [ttyS0] enabled, bootconsole disabled

Do you see it?

The original version of this patch just slapped a WARN_ON() in there and
kept the printk().  Ard van Breemen suggested using the WARN() interface,
which makes the code a bit cleaner.

Also, while examining other warnings in init/main.c, I found two other
locations that deserve a bloody murder scream if their conditions are hit,
and updated them accordingly.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Ard van Breemen <ard@telegraafnet.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobinfmt_elf.c: use get_random_int() to fix entropy depleting
Jeff Liu [Wed, 20 Mar 2013 04:07:49 +0000 (15:07 +1100)]
binfmt_elf.c: use get_random_int() to fix entropy depleting

Entropy is quickly depleted under normal operations like ls(1), cat(1),
etc...  between 2.6.30 to current mainline, for instance:

$ cat /proc/sys/kernel/random/entropy_avail
3428
$ cat /proc/sys/kernel/random/entropy_avail
2911
$cat /proc/sys/kernel/random/entropy_avail
2620

We observed this problem has been occurring since 2.6.30 with
fs/binfmt_elf.c: create_elf_tables()->get_random_bytes(), introduced by
f06295b44c296c8f ("ELF: implement AT_RANDOM for glibc PRNG seeding").

/*
 * Generate 16 random bytes for userspace PRNG seeding.
 */
get_random_bytes(k_rand_bytes, sizeof(k_rand_bytes));

The patch introduces a wrapper around get_random_int() which has lower
overhead than calling get_random_bytes() directly.

With this patch applied:
$ cat /proc/sys/kernel/random/entropy_avail
2731
$ cat /proc/sys/kernel/random/entropy_avail
2802
$ cat /proc/sys/kernel/random/entropy_avail
2878

Analyzed by John Sobecki.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andreas Dilger <aedilger@gmail.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Arnd Bergmann <arnn@arndb.de>
Cc: John Sobecki <john.sobecki@oracle.com>
Cc: James Morris <james.l.morris@oracle.com>
Cc: Jakub Jelinek <jakub@redhat.com>
Cc: Ted Ts'o <tytso@mit.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoepoll: cleanup: hoist out f_op->poll calls
Eric Wong [Wed, 20 Mar 2013 04:07:48 +0000 (15:07 +1100)]
epoll: cleanup: hoist out f_op->poll calls

This reduces the amount of code inside the ready list iteration loops for
better readability IMHO.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Cc: Davide Libenzi <davidel@xmailserver.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoepoll: lock ep->mtx in ep_free to silence lockdep
Eric Wong [Wed, 20 Mar 2013 04:07:48 +0000 (15:07 +1100)]
epoll: lock ep->mtx in ep_free to silence lockdep

Technically we do not need to hold ep->mtx during ep_free since we are
certain there are no other users of ep at that point.  However, lockdep
complains with a "suspicious rcu_dereference_check() usage!" message; so
lock the mutex before ep_remove to silence the warning.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Davide Libenzi <davidel@xmailserver.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: NeilBrown <neilb@suse.de>,
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoepoll: use RCU to protect wakeup_source in epitem
Eric Wong [Wed, 20 Mar 2013 04:07:48 +0000 (15:07 +1100)]
epoll: use RCU to protect wakeup_source in epitem

This prevents wakeup_source destruction when a user hits the item with
EPOLL_CTL_MOD while ep_poll_callback is running.

Tested with CONFIG_SPARSE_RCU_POINTER=y and "make fs/eventpoll.o C=2"

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Davide Libenzi <davidel@xmailserver.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: NeilBrown <neilb@suse.de>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoepoll: stop comparing pointers with 0 in self-test app
Sasha Levin [Wed, 20 Mar 2013 04:07:47 +0000 (15:07 +1100)]
epoll: stop comparing pointers with 0 in self-test app

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Reviewed-by: Daniel Hazelton <dshadowwolf@gmail.com>
Cc: "Paton J. Lewis" <palewis@adobe.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoepoll: support for disabling items, and a self-test app
Paton J. Lewis [Wed, 20 Mar 2013 04:07:47 +0000 (15:07 +1100)]
epoll: support for disabling items, and a self-test app

It is not currently possible to reliably delete epoll items when using the
same epoll set from multiple threads.  After calling epoll_ctl with
EPOLL_CTL_DEL, another thread might still be executing code related to an
event for that epoll item (in response to epoll_wait).  Therefore the
deleting thread does not know when it is safe to delete resources
pertaining to the associated epoll item because another thread might be
using those resources.

The deleting thread could wait an arbitrary amount of time after calling
epoll_ctl with EPOLL_CTL_DEL and before deleting the item, but this is
inefficient and could result in the destruction of resources before
another thread is done handling an event returned by epoll_wait.

This patch enhances epoll_ctl to support EPOLL_CTL_DISABLE, which disables
an epoll item.  If epoll_ctl returns -EBUSY in this case, then another
thread may handling a return from epoll_wait for this item.  Otherwise if
epoll_ctl returns 0, then it is safe to delete the epoll item.  This
allows multiple threads to use a mutex to determine when it is safe to
delete an epoll item and its associated resources, which allows epoll
items to be deleted both efficiently and without error in a multi-threaded
environment.  Note that EPOLL_CTL_DISABLE is only useful in conjunction
with EPOLLONESHOT, and using EPOLL_CTL_DISABLE on an epoll item without
EPOLLONESHOT returns -EINVAL.

This patch also adds a new test_epoll self-test program to both
demonstrate the need for this feature and test it.

Signed-off-by: Paton J. Lewis <palewis@adobe.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Jason Baron <jbaron@redhat.com>
Cc: Paul Holland <pholland@adobe.com>
Cc: Davide Libenzi <davidel@xmailserver.org>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoepoll: comment + BUILD_BUG_ON to prevent epitem bloat
Eric Wong [Wed, 20 Mar 2013 04:07:47 +0000 (15:07 +1100)]
epoll: comment + BUILD_BUG_ON to prevent epitem bloat

This will prevent us from accidentally introducing a memory bloat
regression here in the future.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Cc: Davide Libenzi <davidel@xmailserver.org>,
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoepoll-trim-epitem-by-one-cache-line-on-x86_64-fix
Andrew Morton [Wed, 20 Mar 2013 04:07:47 +0000 (15:07 +1100)]
epoll-trim-epitem-by-one-cache-line-on-x86_64-fix

use __packed, for all architectures

Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Davide Libenzi <davidel@xmailserver.org>
Cc: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoepoll: trim epitem by one cache line
Eric Wong [Wed, 20 Mar 2013 04:07:46 +0000 (15:07 +1100)]
epoll: trim epitem by one cache line

It is common for epoll users to have thousands of epitems, so saving a
cache line on every allocation leads to large memory savings.

Since epitem allocations are cache-aligned, reducing sizeof(struct epitem)
from 136 bytes to 128 bytes will allow it to squeeze under a cache line
boundary on x86_64.

Via /sys/kernel/slab/eventpoll_epi, I see the following changes on my
x86_64 Core2 Duo (which has 64-byte cache alignment):

object_size  :  192 => 128
objs_per_slab:   21 =>  32

Also, add a BUILD_BUG_ON() to check for future accidental breakage.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Cc: Davide Libenzi <davidel@xmailserver.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agocheckpatch: Complain about executable files
Joe Perches [Wed, 20 Mar 2013 04:07:46 +0000 (15:07 +1100)]
checkpatch: Complain about executable files

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 <joe@perches.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agocheckpatch: Prefer seq_puts to seq_printf
Joe Perches [Wed, 20 Mar 2013 04:07:46 +0000 (15:07 +1100)]
checkpatch: Prefer seq_puts to seq_printf

Add a check for seq_printf use with a constant format without additional
arguments.  Suggest seq_puts instead.

Signed-off-by: Joe Perches <joe@perches.com>
Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agocheckpatch: add check for reuse of krealloc arg
Joe Perches [Wed, 20 Mar 2013 04:07:45 +0000 (15:07 +1100)]
checkpatch: add check for reuse of krealloc arg

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 <joe@perches.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoargv_split-teach-it-to-handle-mutable-strings-fix-2
Oleg Nesterov [Wed, 20 Mar 2013 04:07:45 +0000 (15:07 +1100)]
argv_split-teach-it-to-handle-mutable-strings-fix-2

Cc: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoargv_split-teach-it-to-handle-mutable-strings-fix
Andrew Morton [Wed, 20 Mar 2013 04:07:45 +0000 (15:07 +1100)]
argv_split-teach-it-to-handle-mutable-strings-fix

Cc: Andi Kleen <andi@firstfloor.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agoargv_split(): teach it to handle mutable strings
Oleg Nesterov [Wed, 20 Mar 2013 04:07:45 +0000 (15:07 +1100)]
argv_split(): teach it to handle mutable strings

argv_split() allocates argv[count_argc(str)] array and assumes that it
will find the same number of arguments later.  This is obviously wrong if
this string can be changed, say, by sysctl.

With this patch argv_split() kstrndup's the whole string and does not
split it, we simply replace the spaces with zeroes and keep the allocated
memory in argv[-1] for argv_free(arg).

We do not use argv[0] because:

- str can be all-spaces or empty. In fact this case is fine,
  we could kfree() it before return, but:

- str can have a space at the start, and we can not rely on
  kstrndup(skip_spaces(str)) because it can equally race if
  this string is mutable.

Also, simplify count_argc() and kill the no longer used skip_arg().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agolib/int_sqrt.c: optimize square root algorithm
Davidlohr Bueso [Wed, 20 Mar 2013 04:07:44 +0000 (15:07 +1100)]
lib/int_sqrt.c: optimize square root algorithm

Optimize the current version of the shift-and-subtract (hardware)
algorithm, described by John von Newmann[1] and Guy L.  Steele.

Iterating 1,000,000 times, perf shows for the current version:

 Performance counter stats for './sqrt-curr' (10 runs):

         27.170996 task-clock                #    0.979 CPUs utilized            ( +-  3.19% )
                 3 context-switches          #    0.103 K/sec                    ( +-  4.76% )
                 0 cpu-migrations            #    0.004 K/sec                    ( +-100.00% )
               104 page-faults               #    0.004 M/sec                    ( +-  0.16% )
        64,921,199 cycles                    #    2.389 GHz                      ( +-  0.03% )
        28,967,789 stalled-cycles-frontend   #   44.62% frontend cycles idle     ( +-  0.18% )
   <not supported> stalled-cycles-backend
       104,502,623 instructions              #    1.61  insns per cycle
                                             #    0.28  stalled cycles per insn  ( +-  0.00% )
        34,088,368 branches                  # 1254.587 M/sec                    ( +-  0.00% )
             4,901 branch-misses             #    0.01% of all branches          ( +-  1.32% )

       0.027763015 seconds time elapsed                                          ( +-  3.22% )

And for the new version:

Performance counter stats for './sqrt-new' (10 runs):

          0.496869 task-clock                #    0.519 CPUs utilized            ( +-  2.38% )
                 0 context-switches          #    0.000 K/sec
                 0 cpu-migrations            #    0.403 K/sec                    ( +-100.00% )
               104 page-faults               #    0.209 M/sec                    ( +-  0.15% )
           590,760 cycles                    #    1.189 GHz                      ( +-  2.35% )
           395,053 stalled-cycles-frontend   #   66.87% frontend cycles idle     ( +-  3.67% )
   <not supported> stalled-cycles-backend
           398,963 instructions              #    0.68  insns per cycle
                                             #    0.99  stalled cycles per insn  ( +-  0.39% )
            70,228 branches                  #  141.341 M/sec                    ( +-  0.36% )
             3,364 branch-misses             #    4.79% of all branches          ( +-  5.45% )

       0.000957440 seconds time elapsed                                          ( +-  2.42% )

Furthermore, this saves space in instruction text:

   text    data     bss     dec     hex filename
    111       0       0     111      6f lib/int_sqrt-baseline.o
     89       0       0      89      59 lib/int_sqrt.o

[1] http://en.wikipedia.org/wiki/First_Draft_of_a_Report_on_the_EDVAC

Signed-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com>
Reviewed-by: Jonathan Gonzalez <jgonzlez@linets.cl>
Tested-by: Jonathan Gonzalez <jgonzlez@linets.cl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/leds/leds-ot200.c: fix error caused by shifted mask
Christian Gmeiner [Wed, 20 Mar 2013 04:07:44 +0000 (15:07 +1100)]
drivers/leds/leds-ot200.c: fix error caused by shifted mask

During the development of this driver an in-house register documentation
was used.  The last week some integration tests were done and this problem
was found.  It turned out that the released register documentation is
wrong.

The fix is very simple: shift all masks by one.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: Bryan Wu <cooloney@gmail.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/video/backlight/lp855x_bl.c: use PAGE_SIZE for the sysfs read operation
Kim, Milo [Wed, 20 Mar 2013 04:07:44 +0000 (15:07 +1100)]
drivers/video/backlight/lp855x_bl.c: use PAGE_SIZE for the sysfs read operation

sysfs allocates PAGE_SIZE.  It is used by each R/W operation method.  Use
it instead of another buffer size.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobacklight: da903x_bl: use BL_CORE_SUSPENDRESUME option
Jingoo Han [Wed, 20 Mar 2013 04:07:43 +0000 (15:07 +1100)]
backlight: da903x_bl: use BL_CORE_SUSPENDRESUME option

Use BL_CORE_SUSPENDRESUME option to support suspend/resume.
It reduces code size.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agovideo: backlight: add ili922x lcd driver
Stefano Babic [Wed, 20 Mar 2013 04:07:43 +0000 (15:07 +1100)]
video: backlight: add ili922x lcd driver

Add LCD driver for Ilitek ILI9221/ILI9222 controller.  The driver uses SPI
interface for controller access and configuration and RGB interface for
graphics data transfer.

Signed-off-by: Stefano Babic <sbabic@denx.de>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/video/backlight/adp5520_bl.c: fix compiler warning in adp5520_show()
Devendra Naga [Wed, 20 Mar 2013 04:07:43 +0000 (15:07 +1100)]
drivers/video/backlight/adp5520_bl.c: fix compiler warning in adp5520_show()

While compiling with make W=1 (gcc gcc (GCC) 4.7.2 20121109 (Red Hat
4.7.2-8)) found the following warning

drivers/video/backlight/adp5520_bl.c: In function `adp5520_show':
drivers/video/backlight/adp5520_bl.c:146:6: warning: variable `error' set but not used [-Wunused-but-set-variable]

fixed by checking the return value of the variable

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agodrivers/video/backlight/Kconfig: fix typo "MACH_SAM9...EK" three times
Paul Bolle [Wed, 20 Mar 2013 04:07:43 +0000 (15:07 +1100)]
drivers/video/backlight/Kconfig: fix typo "MACH_SAM9...EK" three times

Fix three typos (originally) introduced by a9a84c37d ("atmel_lcdfb:
backlight control").

Two of these typos were introduced in v2.6.25.  (The third was introduced
in 915190f7d4f08 ("[ARM] 5614/1: at91: atmel_lcdfb: add at91sam9g10
support to atmel LCD driver")).  Checking these commits reveals that the
default value of 'y' has never been set automatically in all releases
since v2.6.25!  Perhaps this line might as well be dropped.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobacklight: tdo24m: convert tdo24m to dev_pm_ops
Jingoo Han [Wed, 20 Mar 2013 04:07:42 +0000 (15:07 +1100)]
backlight: tdo24m: convert tdo24m to dev_pm_ops

Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobacklight: ltv350qv: convert ltv350qv to dev_pm_ops
Jingoo Han [Wed, 20 Mar 2013 04:07:42 +0000 (15:07 +1100)]
backlight: ltv350qv: convert ltv350qv to dev_pm_ops

Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobacklight: locomolcd: convert locomolcd to dev_pm_ops
Jingoo Han [Wed, 20 Mar 2013 04:07:42 +0000 (15:07 +1100)]
backlight: locomolcd: convert locomolcd to dev_pm_ops

Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobacklight: lm3533_bl: convert lm3533_bl to dev_pm_ops
Jingoo Han [Wed, 20 Mar 2013 04:07:41 +0000 (15:07 +1100)]
backlight: lm3533_bl: convert lm3533_bl to dev_pm_ops

Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobacklight: kb3886_bl: convert kb3886bl to dev_pm_ops
Jingoo Han [Wed, 20 Mar 2013 04:07:41 +0000 (15:07 +1100)]
backlight: kb3886_bl: convert kb3886bl to dev_pm_ops

Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobacklight: hp680_bl: convert hp680bl to dev_pm_ops
Jingoo Han [Wed, 20 Mar 2013 04:07:41 +0000 (15:07 +1100)]
backlight: hp680_bl: convert hp680bl to dev_pm_ops

Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobacklight: ep93xx: convert ep93xx to dev_pm_ops
Jingoo Han [Wed, 20 Mar 2013 04:07:41 +0000 (15:07 +1100)]
backlight: ep93xx: convert ep93xx to dev_pm_ops

Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobacklight: corgi_lcd: convert corgi_lcd to dev_pm_ops
Jingoo Han [Wed, 20 Mar 2013 04:07:40 +0000 (15:07 +1100)]
backlight: corgi_lcd: convert corgi_lcd to dev_pm_ops

Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobacklight: adp8870: convert adp8870 to dev_pm_ops
Jingoo Han [Wed, 20 Mar 2013 04:07:40 +0000 (15:07 +1100)]
backlight: adp8870: convert adp8870 to dev_pm_ops

Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobacklight: adp8860: convert adp8860 to dev_pm_ops
Jingoo Han [Wed, 20 Mar 2013 04:07:40 +0000 (15:07 +1100)]
backlight: adp8860: convert adp8860 to dev_pm_ops

Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobacklight: adp5520: convert adp5520_bl to dev_pm_ops
Jingoo Han [Wed, 20 Mar 2013 04:07:39 +0000 (15:07 +1100)]
backlight: adp5520: convert adp5520_bl to dev_pm_ops

Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobacklight: s6e63m0: convert s6e63m0 to dev_pm_ops
Jingoo Han [Wed, 20 Mar 2013 04:07:39 +0000 (15:07 +1100)]
backlight: s6e63m0: convert s6e63m0 to dev_pm_ops

Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11 years agobacklight: lms501kf03: convert lms501kf03 to dev_pm_ops
Jingoo Han [Wed, 20 Mar 2013 04:07:39 +0000 (15:07 +1100)]
backlight: lms501kf03: convert lms501kf03 to dev_pm_ops

Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>