lkml.org 
[lkml]   [2017]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH v2 5/9] ACPI-video: Delete unnecessary if statement in acpi_video_switch_brightness()
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 9 Aug 2017 15:43:17 +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@users.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 09ea1f115f55..8295ae1deab9 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -1422,14 +1422,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.13.4
\
 
 \ /
  Last update: 2017-08-09 17:42    [W:0.439 / U:0.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site