trusty: Reformat libtrusty
Test: m libtrusty
Change-Id: I5eb8413e7581603879de5abcb6de7b1b6d3484c0
diff --git a/trusty/libtrusty/trusty.c b/trusty/libtrusty/trusty.c
index ad4d8cd..1a440a3 100644
--- a/trusty/libtrusty/trusty.c
+++ b/trusty/libtrusty/trusty.c
@@ -29,30 +29,27 @@
#include <trusty/ipc.h>
-int tipc_connect(const char *dev_name, const char *srv_name)
-{
- int fd;
- int rc;
+int tipc_connect(const char* dev_name, const char* srv_name) {
+ int fd;
+ int rc;
- fd = open(dev_name, O_RDWR);
- if (fd < 0) {
- rc = -errno;
- ALOGE("%s: cannot open tipc device \"%s\": %s\n",
- __func__, dev_name, strerror(errno));
- return rc < 0 ? rc : -1;
- }
+ fd = open(dev_name, O_RDWR);
+ if (fd < 0) {
+ rc = -errno;
+ ALOGE("%s: cannot open tipc device \"%s\": %s\n", __func__, dev_name, strerror(errno));
+ return rc < 0 ? rc : -1;
+ }
- rc = ioctl(fd, TIPC_IOC_CONNECT, srv_name);
- if (rc < 0) {
- rc = -errno;
- ALOGE("%s: can't connect to tipc service \"%s\" (err=%d)\n",
- __func__, srv_name, errno);
- close(fd);
- return rc < 0 ? rc : -1;
- }
+ rc = ioctl(fd, TIPC_IOC_CONNECT, srv_name);
+ if (rc < 0) {
+ rc = -errno;
+ ALOGE("%s: can't connect to tipc service \"%s\" (err=%d)\n", __func__, srv_name, errno);
+ close(fd);
+ return rc < 0 ? rc : -1;
+ }
- ALOGV("%s: connected to \"%s\" fd %d\n", __func__, srv_name, fd);
- return fd;
+ ALOGV("%s: connected to \"%s\" fd %d\n", __func__, srv_name, fd);
+ return fd;
}
ssize_t tipc_send(int fd, const struct iovec* iov, int iovcnt, struct trusty_shm* shms,
@@ -71,7 +68,6 @@
return rc;
}
-void tipc_close(int fd)
-{
- close(fd);
+void tipc_close(int fd) {
+ close(fd);
}