summaryrefslogtreecommitdiff
path: root/drivers/video/backlight/lcd.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@mail.ru>2007-02-08 00:12:28 +0000
committerRichard Purdie <rpurdie@rpsys.net>2007-02-20 08:38:44 +0000
commit90968e8ebc4611896ff7f2ef0c0bf8455e845cd1 (patch)
treeb2b59bb46bf1118f7283145953c494c5164534d0 /drivers/video/backlight/lcd.c
parentdfcba200679dc3f62212154b65b40b835ce69ab7 (diff)
downloadlinux-next-90968e8ebc4611896ff7f2ef0c0bf8455e845cd1.tar.gz
backlight: Remove excessive (un)likelys
Remove excessive numbers of (un)likely()s in the backlight core. There are no hot paths in this code so rely on compiler to do the right thing. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Diffstat (limited to 'drivers/video/backlight/lcd.c')
-rw-r--r--drivers/video/backlight/lcd.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c
index f95f0e33101d..959024812abc 100644
--- a/drivers/video/backlight/lcd.c
+++ b/drivers/video/backlight/lcd.c
@@ -67,7 +67,7 @@ static ssize_t lcd_show_power(struct class_device *cdev, char *buf)
struct lcd_device *ld = to_lcd_device(cdev);
down(&ld->sem);
- if (likely(ld->props && ld->props->get_power))
+ if (ld->props && ld->props->get_power)
rc = sprintf(buf, "%d\n", ld->props->get_power(ld));
else
rc = -ENXIO;
@@ -90,7 +90,7 @@ static ssize_t lcd_store_power(struct class_device *cdev, const char *buf, size_
return -EINVAL;
down(&ld->sem);
- if (likely(ld->props && ld->props->set_power)) {
+ if (ld->props && ld->props->set_power) {
pr_debug("lcd: set power to %d\n", power);
ld->props->set_power(ld, power);
rc = count;
@@ -106,7 +106,7 @@ static ssize_t lcd_show_contrast(struct class_device *cdev, char *buf)
struct lcd_device *ld = to_lcd_device(cdev);
down(&ld->sem);
- if (likely(ld->props && ld->props->get_contrast))
+ if (ld->props && ld->props->get_contrast)
rc = sprintf(buf, "%d\n", ld->props->get_contrast(ld));
up(&ld->sem);
@@ -127,7 +127,7 @@ static ssize_t lcd_store_contrast(struct class_device *cdev, const char *buf, si
return -EINVAL;
down(&ld->sem);
- if (likely(ld->props && ld->props->set_contrast)) {
+ if (ld->props && ld->props->set_contrast) {
pr_debug("lcd: set contrast to %d\n", contrast);
ld->props->set_contrast(ld, contrast);
rc = count;
@@ -143,7 +143,7 @@ static ssize_t lcd_show_max_contrast(struct class_device *cdev, char *buf)
struct lcd_device *ld = to_lcd_device(cdev);
down(&ld->sem);
- if (likely(ld->props))
+ if (ld->props)
rc = sprintf(buf, "%d\n", ld->props->max_contrast);
up(&ld->sem);
@@ -194,7 +194,7 @@ struct lcd_device *lcd_device_register(const char *name, void *devdata,
pr_debug("lcd_device_register: name=%s\n", name);
new_ld = kmalloc(sizeof(struct lcd_device), GFP_KERNEL);
- if (unlikely(!new_ld))
+ if (!new_ld)
return ERR_PTR(-ENOMEM);
init_MUTEX(&new_ld->sem);
@@ -205,7 +205,7 @@ struct lcd_device *lcd_device_register(const char *name, void *devdata,
class_set_devdata(&new_ld->class_dev, devdata);
rc = class_device_register(&new_ld->class_dev);
- if (unlikely(rc)) {
+ if (rc) {
kfree(new_ld);
return ERR_PTR(rc);
}
@@ -219,7 +219,7 @@ struct lcd_device *lcd_device_register(const char *name, void *devdata,
for (i = 0; i < ARRAY_SIZE(lcd_class_device_attributes); i++) {
rc = class_device_create_file(&new_ld->class_dev,
&lcd_class_device_attributes[i]);
- if (unlikely(rc)) {
+ if (rc) {
while (--i >= 0)
class_device_remove_file(&new_ld->class_dev,
&lcd_class_device_attributes[i]);