qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC PATCH v2 09/13] alsaaudio: Remove unused error handlin


From: Fam Zheng
Subject: [Qemu-devel] [RFC PATCH v2 09/13] alsaaudio: Remove unused error handling of qemu_set_fd_handler
Date: Thu, 14 May 2015 11:34:25 +0800

The function cannot fail, so the check is superfluous.

Signed-off-by: Fam Zheng <address@hidden>
---
 audio/alsaaudio.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c
index 74ead97..ed7655d 100644
--- a/audio/alsaaudio.c
+++ b/audio/alsaaudio.c
@@ -266,31 +266,19 @@ static int alsa_poll_helper (snd_pcm_t *handle, struct 
pollhlp *hlp, int mask)
 
     for (i = 0; i < count; ++i) {
         if (pfds[i].events & POLLIN) {
-            err = qemu_set_fd_handler (pfds[i].fd, alsa_poll_handler,
-                                       NULL, hlp);
+            qemu_set_fd_handler (pfds[i].fd, alsa_poll_handler, NULL, hlp);
         }
         if (pfds[i].events & POLLOUT) {
             if (conf.verbose) {
                 dolog ("POLLOUT %d %d\n", i, pfds[i].fd);
             }
-            err = qemu_set_fd_handler (pfds[i].fd, NULL,
-                                       alsa_poll_handler, hlp);
+            qemu_set_fd_handler (pfds[i].fd, NULL, alsa_poll_handler, hlp);
         }
         if (conf.verbose) {
             dolog ("Set handler events=%#x index=%d fd=%d err=%d\n",
                    pfds[i].events, i, pfds[i].fd, err);
         }
 
-        if (err) {
-            dolog ("Failed to set handler events=%#x index=%d fd=%d err=%d\n",
-                   pfds[i].events, i, pfds[i].fd, err);
-
-            while (i--) {
-                qemu_set_fd_handler (pfds[i].fd, NULL, NULL, NULL);
-            }
-            g_free (pfds);
-            return -1;
-        }
     }
     hlp->pfds = pfds;
     hlp->count = count;
-- 
2.4.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]