diff options
author | MarcKe <herderkewitz@googlemail.com> | 2015-01-25 22:32:31 +0100 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-10-30 17:01:02 -0700 |
commit | e72aba1b407f8b6e4bacb827f665e5be77c7124e (patch) | |
tree | ec2719dd7980ef38db6dff7a0e0829603b280baf | |
parent | f98cd750ac944a30fa67fa239b513958152b23c7 (diff) | |
download | system_core-e72aba1b407f8b6e4bacb827f665e5be77c7124e.zip system_core-e72aba1b407f8b6e4bacb827f665e5be77c7124e.tar.gz system_core-e72aba1b407f8b6e4bacb827f665e5be77c7124e.tar.bz2 |
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
-rw-r--r-- | healthd/healthd_mode_charger.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
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); } |