CRAS: Format cras_main_message

Reformat codes with the .clang-format we just introduced.
To format whole files provided in-place:
clang-format -i -style=file [<file> ...]

BUG=chromium:950858
TEST=Add directory to check_format_error and run
FEATURES="test" USE=asan emerge-${BOARD} -v media-sound/adhd

Change-Id: I3509480830f75f6e2e168c69dc4b4824c27dbca9
Reviewed-on: https://chromium-review.googlesource.com/1669340
Tested-by: En-Shuo Hsu <enshuo@google.com>
Commit-Ready: En-Shuo Hsu <enshuo@google.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Yu-Hsuan Hsu <yuhsuan@chromium.org>
diff --git a/cras/src/server/cras_main_message.c b/cras/src/server/cras_main_message.c
index 0aeb928..9fe62af 100644
--- a/cras/src/server/cras_main_message.c
+++ b/cras/src/server/cras_main_message.c
@@ -12,7 +12,6 @@
 #include "cras_system_state.h"
 #include "cras_util.h"
 
-
 /* Callback to handle specific type of main thread message. */
 struct cras_main_msg_callback {
 	enum CRAS_MAIN_MESSAGE_TYPE type;
@@ -30,7 +29,7 @@
 {
 	struct cras_main_msg_callback *msg_cb;
 
-	DL_FOREACH(main_msg_callbacks, msg_cb) {
+	DL_FOREACH (main_msg_callbacks, msg_cb) {
 		if (msg_cb->type == type) {
 			syslog(LOG_ERR, "Main message type %u already exists",
 			       type);
@@ -60,7 +59,8 @@
 	return 0;
 }
 
-static int read_main_message(int msg_fd, uint8_t *buf, size_t max_len) {
+static int read_main_message(int msg_fd, uint8_t *buf, size_t max_len)
+{
 	int to_read, nread, rc;
 	struct cras_main_message *msg = (struct cras_main_message *)buf;
 
@@ -90,7 +90,7 @@
 		return;
 	}
 
-	DL_FOREACH(main_msg_callbacks, main_msg_cb) {
+	DL_FOREACH (main_msg_callbacks, main_msg_cb) {
 		if (main_msg_cb->type == msg->type) {
 			main_msg_cb->callback(msg, main_msg_cb->callback_data);
 			break;
@@ -98,7 +98,8 @@
 	}
 }
 
-void cras_main_message_init() {
+void cras_main_message_init()
+{
 	int rc;
 
 	rc = pipe(main_msg_fds);
@@ -111,7 +112,5 @@
 	cras_make_fd_nonblocking(main_msg_fds[0]);
 	cras_make_fd_nonblocking(main_msg_fds[1]);
 
-	cras_system_add_select_fd(main_msg_fds[0],
-				  handle_main_messages,
-				  NULL);
+	cras_system_add_select_fd(main_msg_fds[0], handle_main_messages, NULL);
 }
diff --git a/cras/src/server/cras_main_message.h b/cras/src/server/cras_main_message.h
index 5a2bb28..fd63488 100644
--- a/cras/src/server/cras_main_message.h
+++ b/cras/src/server/cras_main_message.h
@@ -33,8 +33,7 @@
 };
 
 /* Callback function to handle main thread message. */
-typedef void (*cras_message_callback)(struct cras_main_message *msg,
-				      void *arg);
+typedef void (*cras_message_callback)(struct cras_main_message *msg, void *arg);
 
 /* Sends a message to main thread. */
 int cras_main_message_send(struct cras_main_message *msg);