From c2c4af49560801ea5af94021d1241156708d61db Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Mon, 10 Jan 2011 02:06:10 +0300 Subject: [PATCH] 8250-serial: Simplify is_readable function Signed-off-by: Cyrill Gorcunov --- tools/kvm/8250-serial.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tools/kvm/8250-serial.c b/tools/kvm/8250-serial.c index cbbad0d97dc..913ef8ea6a1 100644 --- a/tools/kvm/8250-serial.c +++ b/tools/kvm/8250-serial.c @@ -92,16 +92,12 @@ static int read_char(int fd) static bool is_readable(int fd) { - struct pollfd pollfd; - int err; - - pollfd = (struct pollfd) { - .fd = fd, - .events = POLLIN, + struct pollfd pollfd = (struct pollfd) { + .fd = fd, + .events = POLLIN, }; - err = poll(&pollfd, 1, 0); - return err > 0; + return poll(&pollfd, 1, 0) > 0; } void serial8250__interrupt(struct kvm *self) -- 2.11.4.GIT