[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e2b752b3-512f-5e07-b325-a34b301a4685@users.sourceforge.net>
Date: Mon, 5 Sep 2016 18:59:07 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-acpi@...r.kernel.org, Hans de Goede <hdegoede@...hat.com>,
Len Brown <lenb@...nel.org>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Zhang Rui <rui.zhang@...el.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>,
Paolo Bonzini <pbonzini@...hat.com>
Subject: [PATCH 12/21] ACPI-video: Delete unnecessary if statement in
acpi_video_switch_brightness()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Mon, 5 Sep 2016 16:10:40 +0200
Move a function call into an else branch for successful function execution.
Omit a duplicate check for the local variable "result" then at the end.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/acpi/acpi_video.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
index fe9b40e..0362a43 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -1372,14 +1372,12 @@ acpi_video_switch_brightness(struct work_struct *work)
level_next = acpi_video_get_next_level(device, level_current, event);
result = acpi_video_device_lcd_set_level(device, level_next);
-
- if (!result)
- backlight_force_update(device->backlight,
- BACKLIGHT_UPDATE_HOTKEY);
-
out:
if (result)
printk(KERN_ERR PREFIX "Failed to switch the brightness\n");
+ else
+ backlight_force_update(device->backlight,
+ BACKLIGHT_UPDATE_HOTKEY);
}
int acpi_video_get_edid(struct acpi_device *device, int type, int device_id,
--
2.10.0
Powered by blists - more mailing lists