obmc-console: Fix readability-else-after-return
```
/usr/bin/clang-tidy -checks=-*, readability-else-after-return -export-fixes /tmp/tmpzmyw6on0/tmpdk8wt96i.yaml -p=build /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/test/test-ringbuffer-boundary-poll.c
/mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../ringbuffer.c:131:4: error: do not use 'else' after 'return' [readability-else-after-return,-warnings-as-errors]
} else {
^~~~~~
```
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ic80538a64f061f9ed3d3d71293dcf4f3d99cb6e4
diff --git a/console-server.c b/console-server.c
index 1a1c4be..2750349 100644
--- a/console-server.c
+++ b/console-server.c
@@ -680,14 +680,11 @@
timersub(earliest, cur_time, &interval);
return ((interval.tv_sec * 1000) +
(interval.tv_usec / 1000));
- } else {
- /* return from poll immediately */
- return 0;
- }
- } else {
- /* poll indefinitely */
- return -1;
- }
+ } /* return from poll immediately */
+ return 0;
+
+ } /* poll indefinitely */
+ return -1;
}
static int call_pollers(struct console *console, struct timeval *cur_time)
@@ -800,10 +797,9 @@
if (rc < 0) {
if (errno == EINTR) {
continue;
- } else {
- warn("poll error");
- break;
}
+ warn("poll error");
+ break;
}
/* process internal fd first */