Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1707428

[PATCH v2 6/9] ACPI-video: Improve a jump target in acpi_video_switch_brightness()

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject [PATCH v2 6/9] ACPI-video: Improve a jump target in acpi_video_switch_brightness()
Date 2017-08-09 17:50 +0200
Message-ID <ucBp7-PO-13@gated-at.bofh.it> (permalink)
References (3 earlier) <seffb-4Kg-7@gated-at.bofh.it> <semJH-1kY-9@gated-at.bofh.it> <sepod-36Y-1@gated-at.bofh.it> <sevN0-7ef-19@gated-at.bofh.it> <ucBfr-Mz-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 9 Aug 2017 15:45:35 +0200

* Avoid another duplicate check for the local variable "result"
  then at the end.

* Jump directly to an error message in the case that the desired brightness
  can not be switched.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/acpi/acpi_video.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
index 8295ae1deab9..e279ed221961 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -1411,19 +1411,19 @@ acpi_video_switch_brightness(struct work_struct *work)
 		return;
 
 	if (!device->brightness)
-		goto out;
+		goto report_failure;
 
 	result = acpi_video_device_lcd_get_level_current(device,
 							 &level_current,
 							 false);
 	if (result)
-		goto out;
+		goto report_failure;
 
 	level_next = acpi_video_get_next_level(device, level_current, event);
 
 	result = acpi_video_device_lcd_set_level(device, level_next);
-out:
 	if (result)
+ report_failure:
 		printk(KERN_ERR PREFIX "Failed to switch the brightness\n");
 	else
 		backlight_force_update(device->backlight,
-- 
2.13.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/9] ACPI-video: Fine-tuning for several function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-09 17:40 +0200
  [PATCH v2 1/9] ACPI-video: Use kmalloc_array() in  acpi_video_get_levels() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-09 17:40 +0200
  [PATCH v2 3/9] ACPI-video: Delete an error message for a failed  kzalloc() call SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-09 17:40 +0200
  [PATCH v2 2/9] ACPI-video: Return directly after a failed device  query SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-09 17:40 +0200
  [PATCH v2 9/9] ACPI-video: Improve a size determination in four  functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-09 17:50 +0200
  [PATCH v2 8/9] ACPI-video: Move four assignments in  acpi_video_get_levels() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-09 17:50 +0200
  [PATCH v2 4/9] ACPI-video: Return directly after a failed  input_allocate_device() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-09 17:50 +0200
  [PATCH v2 6/9] ACPI-video: Improve a jump target in  acpi_video_switch_brightness() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-09 17:50 +0200
  [PATCH v2 7/9] ACPI-video: Delete an unnecessary initialisation in  three functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-09 17:50 +0200
  [PATCH v2 5/9] ACPI-video: Delete unnecessary if statement in  acpi_video_switch_brightness() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-08-09 17:50 +0200

csiph-web