From e72aba1b407f8b6e4bacb827f665e5be77c7124e Mon Sep 17 00:00:00 2001 From: MarcKe Date: Sun, 25 Jan 2015 22:32:31 +0100 Subject: healthd: remove useless goto in charger mode jumping to the cleanup makes a check that will fail anyways, since fd is smaller than 0 Change-Id: Ic53f186e00fc09a49de5185b01a2bf64a8ceba35 --- healthd/healthd_mode_charger.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'healthd') diff --git a/healthd/healthd_mode_charger.cpp b/healthd/healthd_mode_charger.cpp index 0e3a092..3328154 100644 --- a/healthd/healthd_mode_charger.cpp +++ b/healthd/healthd_mode_charger.cpp @@ -221,7 +221,7 @@ static int set_tricolor_led(int on, int color) fd = open(leds[i].path, O_RDWR); if (fd < 0) { LOGE("Could not open red led node\n"); - goto cleanup; + continue; } if (on) snprintf(buffer, sizeof(int), "%d\n", 255); @@ -230,7 +230,6 @@ static int set_tricolor_led(int on, int color) if (write(fd, buffer, strlen(buffer)) < 0) LOGE("Could not write to led node\n"); -cleanup: if (fd >= 0) close(fd); } -- cgit v1.1