mirror of
https://github.com/team-infusion-developers/android_hardware_samsung.git
synced 2024-11-06 21:55:41 +00:00
lights: Remove superfluous log newlines
Change-Id: Id1522dfe92c9e585000edd7067b50968f38c07ca
This commit is contained in:
parent
354f713a56
commit
b5b9500a62
2 changed files with 7 additions and 11 deletions
|
@ -99,7 +99,7 @@ static int write_str(char const *path, const char* value)
|
|||
return amt == -1 ? -errno : 0;
|
||||
} else {
|
||||
if (already_warned == 0) {
|
||||
ALOGE("write_str failed to open %s\n", path);
|
||||
ALOGE("write_str failed to open %s", path);
|
||||
already_warned = 1;
|
||||
}
|
||||
return -errno;
|
||||
|
@ -128,7 +128,7 @@ static int set_light_backlight(struct light_device_t *dev __unused,
|
|||
if (max_brightness > MAX_INPUT_BRIGHTNESS) {
|
||||
int old_brightness = brightness;
|
||||
brightness = brightness * max_brightness / MAX_INPUT_BRIGHTNESS;
|
||||
ALOGV("%s: scaling brightness %d => %d\n", __func__,
|
||||
ALOGV("%s: scaling brightness %d => %d", __func__,
|
||||
old_brightness, brightness);
|
||||
}
|
||||
|
||||
|
@ -190,13 +190,9 @@ static int write_leds(const struct led_config *led)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
ALOGV("%s: color=0x%08x, delay_on=%d, delay_off=%d, blink=\"%s\".",
|
||||
ALOGV("%s: color=0x%08x, delay_on=%d, delay_off=%d, blink=%s",
|
||||
__func__, led->color, led->delay_on, led->delay_off, blink);
|
||||
|
||||
/* Add '\n' here to make the above log message clean. */
|
||||
blink[count] = '\n';
|
||||
blink[count+1] = '\0';
|
||||
|
||||
pthread_mutex_lock(&g_lock);
|
||||
err = write_str(LED_BLINK_NODE, blink);
|
||||
pthread_mutex_unlock(&g_lock);
|
||||
|
|
|
@ -39,13 +39,13 @@ int read_int(char const *path)
|
|||
|
||||
fd = open(path, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
ALOGE("%s: failed to open %s\n", __func__, path);
|
||||
ALOGE("%s: failed to open %s", __func__, path);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
len = read(fd, buf, num_bytes - 1);
|
||||
if (len < 0) {
|
||||
ALOGE("%s: failed to read from %s\n", __func__, path);
|
||||
ALOGE("%s: failed to read from %s", __func__, path);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -81,13 +81,13 @@ int write_int(char const *path, const int value)
|
|||
|
||||
if (fd >= 0) {
|
||||
char buffer[20];
|
||||
int bytes = sprintf(buffer, "%d\n", value);
|
||||
int bytes = sprintf(buffer, "%d", value);
|
||||
int amt = write(fd, buffer, bytes);
|
||||
close(fd);
|
||||
return amt == -1 ? -errno : 0;
|
||||
} else {
|
||||
if (already_warned == 0) {
|
||||
ALOGE("write_int failed to open %s\n", path);
|
||||
ALOGE("write_int failed to open %s", path);
|
||||
already_warned = 1;
|
||||
}
|
||||
return -errno;
|
||||
|
|
Loading…
Reference in a new issue