From 700b10f2aa441a7077696a4c6eea51bfd2ebe61c Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 11 Nov 2020 09:36:21 +0900 Subject: [PATCH] examples/buttons/buttons_main.c: Appease nxstyle --- examples/buttons/buttons_main.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/examples/buttons/buttons_main.c b/examples/buttons/buttons_main.c index 44673ddbd..a658f6d3e 100644 --- a/examples/buttons/buttons_main.c +++ b/examples/buttons/buttons_main.c @@ -186,7 +186,7 @@ static int button_daemon(int argc, char *argv[]) /* Open the BUTTON driver */ printf("button_daemon: Opening %s\n", CONFIG_EXAMPLES_BUTTONS_DEVPATH); - fd = open(CONFIG_EXAMPLES_BUTTONS_DEVPATH, O_RDONLY|O_NONBLOCK); + fd = open(CONFIG_EXAMPLES_BUTTONS_DEVPATH, O_RDONLY | O_NONBLOCK); if (fd < 0) { int errcode = errno; @@ -207,7 +207,8 @@ static int button_daemon(int argc, char *argv[]) goto errout_with_fd; } - printf("button_daemon: Supported BUTTONs 0x%02x\n", (unsigned int)supported); + printf("button_daemon: Supported BUTTONs 0x%02x\n", + (unsigned int)supported); #ifdef CONFIG_EXAMPLES_BUTTONS_SIGNAL /* Define the notifications events */ @@ -255,7 +256,8 @@ static int button_daemon(int argc, char *argv[]) if (ret < 0) { int errcode = errno; - printf("button_daemon: ERROR: sigwaitinfo() failed: %d\n", errcode); + printf("button_daemon: ERROR: sigwaitinfo() failed: %d\n", + errcode); goto errout_with_fd; } @@ -273,7 +275,8 @@ static int button_daemon(int argc, char *argv[]) timeout = false; pollin = false; - ret = poll(fds, CONFIG_BUTTONS_NPOLLWAITERS, CONFIG_BUTTONS_POLL_DELAY); + ret = poll(fds, CONFIG_BUTTONS_NPOLLWAITERS, + CONFIG_BUTTONS_POLL_DELAY); printf("\nbutton_daemon: poll returned: %d\n", ret); if (ret < 0) @@ -310,12 +313,14 @@ static int button_daemon(int argc, char *argv[]) { if ((fds[i].revents & POLLIN) != 0) { - printf("button_daemon: ERROR no read data[%d]\n", i); + printf("button_daemon: ERROR no read data[%d]\n", + i); } } else if (errno != EINTR) { - printf("button_daemon: read[%d] failed: %d\n", i, errno); + printf("button_daemon: read[%d] failed: %d\n", i, + errno); } nbytes = 0; @@ -324,12 +329,16 @@ static int button_daemon(int argc, char *argv[]) { if (timeout) { - printf("button_daemon: ERROR? Poll timeout, but data read[%d]\n", i); - printf(" (might just be a race condition)\n"); + printf("button_daemon: ERROR? Poll timeout, " + "but data read[%d]\n", i); + printf(" (might just be a race " + "condition)\n"); } } - /* Suppress error report if no read data on the next time through */ + /* Suppress error report if no read data on the next time + * through + */ fds[i].revents = 0; }