summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Paik2017-12-14 19:31:58 -0600
committerSteve Paik2017-12-14 19:31:58 -0600
commitfea16e1dea1f93a0daac1bb81ad26ecd7fc57513 (patch)
tree85be3cd40c592fb1acb291dbfb5c4beba567b25f /libsuspend
parent385ea22741ed5bad794fb6b1dff2b46481f241c4 (diff)
downloadplatform-system-core-fea16e1dea1f93a0daac1bb81ad26ecd7fc57513.tar.gz
platform-system-core-fea16e1dea1f93a0daac1bb81ad26ecd7fc57513.tar.xz
platform-system-core-fea16e1dea1f93a0daac1bb81ad26ecd7fc57513.zip
Fix LOG() messages to drop \n
Bug: 70669809 Test: It's gone Change-Id: Id66776a229be677c89968d1e0dc81fc8b4b7de5d
Diffstat (limited to 'libsuspend')
-rw-r--r--libsuspend/autosuspend.c8
-rw-r--r--libsuspend/autosuspend_wakeup_count.c42
2 files changed, 25 insertions, 25 deletions
diff --git a/libsuspend/autosuspend.c b/libsuspend/autosuspend.c
index 96e1c10d0..1d6c4349e 100644
--- a/libsuspend/autosuspend.c
+++ b/libsuspend/autosuspend.c
@@ -40,14 +40,14 @@ static int autosuspend_init(void)
40 } 40 }
41 41
42 if (!autosuspend_ops) { 42 if (!autosuspend_ops) {
43 ALOGE("failed to initialize autosuspend\n"); 43 ALOGE("failed to initialize autosuspend");
44 return -1; 44 return -1;
45 } 45 }
46 46
47out: 47out:
48 autosuspend_inited = true; 48 autosuspend_inited = true;
49 49
50 ALOGV("autosuspend initialized\n"); 50 ALOGV("autosuspend initialized");
51 return 0; 51 return 0;
52} 52}
53 53
@@ -60,7 +60,7 @@ int autosuspend_enable(void)
60 return ret; 60 return ret;
61 } 61 }
62 62
63 ALOGV("autosuspend_enable\n"); 63 ALOGV("autosuspend_enable");
64 64
65 if (autosuspend_enabled) { 65 if (autosuspend_enabled) {
66 return 0; 66 return 0;
@@ -84,7 +84,7 @@ int autosuspend_disable(void)
84 return ret; 84 return ret;
85 } 85 }
86 86
87 ALOGV("autosuspend_disable\n"); 87 ALOGV("autosuspend_disable");
88 88
89 if (!autosuspend_enabled) { 89 if (!autosuspend_enabled) {
90 return 0; 90 return 0;
diff --git a/libsuspend/autosuspend_wakeup_count.c b/libsuspend/autosuspend_wakeup_count.c
index 2da204ae0..0a172be79 100644
--- a/libsuspend/autosuspend_wakeup_count.c
+++ b/libsuspend/autosuspend_wakeup_count.c
@@ -67,36 +67,36 @@ static void *suspend_thread_func(void *arg __attribute__((unused)))
67 update_sleep_time(success); 67 update_sleep_time(success);
68 usleep(sleep_time); 68 usleep(sleep_time);
69 success = false; 69 success = false;
70 ALOGV("%s: read wakeup_count\n", __func__); 70 ALOGV("%s: read wakeup_count", __func__);
71 lseek(wakeup_count_fd, 0, SEEK_SET); 71 lseek(wakeup_count_fd, 0, SEEK_SET);
72 wakeup_count_len = TEMP_FAILURE_RETRY(read(wakeup_count_fd, wakeup_count, 72 wakeup_count_len = TEMP_FAILURE_RETRY(read(wakeup_count_fd, wakeup_count,
73 sizeof(wakeup_count))); 73 sizeof(wakeup_count)));
74 if (wakeup_count_len < 0) { 74 if (wakeup_count_len < 0) {
75 strerror_r(errno, buf, sizeof(buf)); 75 strerror_r(errno, buf, sizeof(buf));
76 ALOGE("Error reading from %s: %s\n", SYS_POWER_WAKEUP_COUNT, buf); 76 ALOGE("Error reading from %s: %s", SYS_POWER_WAKEUP_COUNT, buf);
77 wakeup_count_len = 0; 77 wakeup_count_len = 0;
78 continue; 78 continue;
79 } 79 }
80 if (!wakeup_count_len) { 80 if (!wakeup_count_len) {
81 ALOGE("Empty wakeup count\n"); 81 ALOGE("Empty wakeup count");
82 continue; 82 continue;
83 } 83 }
84 84
85 ALOGV("%s: wait\n", __func__); 85 ALOGV("%s: wait", __func__);
86 ret = sem_wait(&suspend_lockout); 86 ret = sem_wait(&suspend_lockout);
87 if (ret < 0) { 87 if (ret < 0) {
88 strerror_r(errno, buf, sizeof(buf)); 88 strerror_r(errno, buf, sizeof(buf));
89 ALOGE("Error waiting on semaphore: %s\n", buf); 89 ALOGE("Error waiting on semaphore: %s", buf);
90 continue; 90 continue;
91 } 91 }
92 92
93 ALOGV("%s: write %*s to wakeup_count\n", __func__, wakeup_count_len, wakeup_count); 93 ALOGV("%s: write %*s to wakeup_count", __func__, wakeup_count_len, wakeup_count);
94 ret = TEMP_FAILURE_RETRY(write(wakeup_count_fd, wakeup_count, wakeup_count_len)); 94 ret = TEMP_FAILURE_RETRY(write(wakeup_count_fd, wakeup_count, wakeup_count_len));
95 if (ret < 0) { 95 if (ret < 0) {
96 strerror_r(errno, buf, sizeof(buf)); 96 strerror_r(errno, buf, sizeof(buf));
97 ALOGE("Error writing to %s: %s\n", SYS_POWER_WAKEUP_COUNT, buf); 97 ALOGE("Error writing to %s: %s", SYS_POWER_WAKEUP_COUNT, buf);
98 } else { 98 } else {
99 ALOGV("%s: write %s to %s\n", __func__, sleep_state, SYS_POWER_STATE); 99 ALOGV("%s: write %s to %s", __func__, sleep_state, SYS_POWER_STATE);
100 ret = TEMP_FAILURE_RETRY(write(state_fd, sleep_state, strlen(sleep_state))); 100 ret = TEMP_FAILURE_RETRY(write(state_fd, sleep_state, strlen(sleep_state)));
101 if (ret >= 0) { 101 if (ret >= 0) {
102 success = true; 102 success = true;
@@ -107,11 +107,11 @@ static void *suspend_thread_func(void *arg __attribute__((unused)))
107 } 107 }
108 } 108 }
109 109
110 ALOGV("%s: release sem\n", __func__); 110 ALOGV("%s: release sem", __func__);
111 ret = sem_post(&suspend_lockout); 111 ret = sem_post(&suspend_lockout);
112 if (ret < 0) { 112 if (ret < 0) {
113 strerror_r(errno, buf, sizeof(buf)); 113 strerror_r(errno, buf, sizeof(buf));
114 ALOGE("Error releasing semaphore: %s\n", buf); 114 ALOGE("Error releasing semaphore: %s", buf);
115 } 115 }
116 } 116 }
117 return NULL; 117 return NULL;
@@ -122,16 +122,16 @@ static int autosuspend_wakeup_count_enable(void)
122 char buf[80]; 122 char buf[80];
123 int ret; 123 int ret;
124 124
125 ALOGV("autosuspend_wakeup_count_enable\n"); 125 ALOGV("autosuspend_wakeup_count_enable");
126 126
127 ret = sem_post(&suspend_lockout); 127 ret = sem_post(&suspend_lockout);
128 128
129 if (ret < 0) { 129 if (ret < 0) {
130 strerror_r(errno, buf, sizeof(buf)); 130 strerror_r(errno, buf, sizeof(buf));
131 ALOGE("Error changing semaphore: %s\n", buf); 131 ALOGE("Error changing semaphore: %s", buf);
132 } 132 }
133 133
134 ALOGV("autosuspend_wakeup_count_enable done\n"); 134 ALOGV("autosuspend_wakeup_count_enable done");
135 135
136 return ret; 136 return ret;
137} 137}
@@ -141,16 +141,16 @@ static int autosuspend_wakeup_count_disable(void)
141 char buf[80]; 141 char buf[80];
142 int ret; 142 int ret;
143 143
144 ALOGV("autosuspend_wakeup_count_disable\n"); 144 ALOGV("autosuspend_wakeup_count_disable");
145 145
146 ret = sem_wait(&suspend_lockout); 146 ret = sem_wait(&suspend_lockout);
147 147
148 if (ret < 0) { 148 if (ret < 0) {
149 strerror_r(errno, buf, sizeof(buf)); 149 strerror_r(errno, buf, sizeof(buf));
150 ALOGE("Error changing semaphore: %s\n", buf); 150 ALOGE("Error changing semaphore: %s", buf);
151 } 151 }
152 152
153 ALOGV("autosuspend_wakeup_count_disable done\n"); 153 ALOGV("autosuspend_wakeup_count_disable done");
154 154
155 return ret; 155 return ret;
156} 156}
@@ -177,31 +177,31 @@ struct autosuspend_ops *autosuspend_wakeup_count_init(void)
177 state_fd = TEMP_FAILURE_RETRY(open(SYS_POWER_STATE, O_RDWR)); 177 state_fd = TEMP_FAILURE_RETRY(open(SYS_POWER_STATE, O_RDWR));
178 if (state_fd < 0) { 178 if (state_fd < 0) {
179 strerror_r(errno, buf, sizeof(buf)); 179 strerror_r(errno, buf, sizeof(buf));
180 ALOGE("Error opening %s: %s\n", SYS_POWER_STATE, buf); 180 ALOGE("Error opening %s: %s", SYS_POWER_STATE, buf);
181 goto err_open_state; 181 goto err_open_state;
182 } 182 }
183 183
184 wakeup_count_fd = TEMP_FAILURE_RETRY(open(SYS_POWER_WAKEUP_COUNT, O_RDWR)); 184 wakeup_count_fd = TEMP_FAILURE_RETRY(open(SYS_POWER_WAKEUP_COUNT, O_RDWR));
185 if (wakeup_count_fd < 0) { 185 if (wakeup_count_fd < 0) {
186 strerror_r(errno, buf, sizeof(buf)); 186 strerror_r(errno, buf, sizeof(buf));
187 ALOGE("Error opening %s: %s\n", SYS_POWER_WAKEUP_COUNT, buf); 187 ALOGE("Error opening %s: %s", SYS_POWER_WAKEUP_COUNT, buf);
188 goto err_open_wakeup_count; 188 goto err_open_wakeup_count;
189 } 189 }
190 190
191 ret = sem_init(&suspend_lockout, 0, 0); 191 ret = sem_init(&suspend_lockout, 0, 0);
192 if (ret < 0) { 192 if (ret < 0) {
193 strerror_r(errno, buf, sizeof(buf)); 193 strerror_r(errno, buf, sizeof(buf));
194 ALOGE("Error creating semaphore: %s\n", buf); 194 ALOGE("Error creating semaphore: %s", buf);
195 goto err_sem_init; 195 goto err_sem_init;
196 } 196 }
197 ret = pthread_create(&suspend_thread, NULL, suspend_thread_func, NULL); 197 ret = pthread_create(&suspend_thread, NULL, suspend_thread_func, NULL);
198 if (ret) { 198 if (ret) {
199 strerror_r(ret, buf, sizeof(buf)); 199 strerror_r(ret, buf, sizeof(buf));
200 ALOGE("Error creating thread: %s\n", buf); 200 ALOGE("Error creating thread: %s", buf);
201 goto err_pthread_create; 201 goto err_pthread_create;
202 } 202 }
203 203
204 ALOGI("Selected wakeup count\n"); 204 ALOGI("Selected wakeup count");
205 return &autosuspend_wakeup_count_ops; 205 return &autosuspend_wakeup_count_ops;
206 206
207err_pthread_create: 207err_pthread_create: