summaryrefslogtreecommitdiffstats
path: root/libion
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2018-03-07 06:51:03 -0800
committerMark Salyzyn <salyzyn@google.com>2018-03-07 10:56:06 -0800
commit5be32c312c695b8d9abc7558e338e32ff047a9e6 (patch)
treec6fd7af123b80dddf37986bc0779206d7ace2118 /libion
parenta026a176ffb99f6f415795a05d39f30b023f5c6f (diff)
downloadsystem_core-5be32c312c695b8d9abc7558e338e32ff047a9e6.tar.gz
system_core-5be32c312c695b8d9abc7558e338e32ff047a9e6.tar.bz2
system_core-5be32c312c695b8d9abc7558e338e32ff047a9e6.zip
libion: cleanup logging
Get rid of trailing newlines as they just take wasted space. Added a missing strerror(error) expansion for failure to open. Test: compile Bug: 74258013 Change-Id: I04c0038e1ca53d2ffe0a78386744f12874215c19
Diffstat (limited to 'libion')
-rw-r--r--libion/ion.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libion/ion.c b/libion/ion.c
index 583612854..b8de5a411 100644
--- a/libion/ion.c
+++ b/libion/ion.c
@@ -55,7 +55,7 @@ int ion_is_legacy(int fd) {
int ion_open() {
int fd = open("/dev/ion", O_RDONLY | O_CLOEXEC);
- if (fd < 0) ALOGE("open /dev/ion failed!\n");
+ if (fd < 0) ALOGE("open /dev/ion failed: %s", strerror(errno));
return fd;
}
@@ -69,7 +69,7 @@ int ion_close(int fd) {
static int ion_ioctl(int fd, int req, void* arg) {
int ret = ioctl(fd, req, arg);
if (ret < 0) {
- ALOGE("ioctl %x failed with code %d: %s\n", req, ret, strerror(errno));
+ ALOGE("ioctl %x failed with code %d: %s", req, ret, strerror(errno));
return -errno;
}
return ret;
@@ -115,12 +115,12 @@ int ion_map(int fd, ion_user_handle_t handle, size_t length, int prot, int flags
ret = ion_ioctl(fd, ION_IOC_MAP, &data);
if (ret < 0) return ret;
if (data.fd < 0) {
- ALOGE("map ioctl returned negative fd\n");
+ ALOGE("map ioctl returned negative fd");
return -EINVAL;
}
tmp_ptr = mmap(NULL, length, prot, flags, data.fd, offset);
if (tmp_ptr == MAP_FAILED) {
- ALOGE("mmap failed: %s\n", strerror(errno));
+ ALOGE("mmap failed: %s", strerror(errno));
return -errno;
}
*map_fd = data.fd;
@@ -140,7 +140,7 @@ int ion_share(int fd, ion_user_handle_t handle, int* share_fd) {
ret = ion_ioctl(fd, ION_IOC_SHARE, &data);
if (ret < 0) return ret;
if (data.fd < 0) {
- ALOGE("share ioctl returned negative fd\n");
+ ALOGE("share ioctl returned negative fd");
return -EINVAL;
}
*share_fd = data.fd;