From patchwork Fri Jun 12 12:57:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 483564 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BB92C140562 for ; Fri, 12 Jun 2015 23:01:09 +1000 (AEST) Received: from localhost ([::1]:51165 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3Oa3-00028T-UN for incoming@patchwork.ozlabs.org; Fri, 12 Jun 2015 09:01:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3OX4-0001I1-8w for qemu-devel@nongnu.org; Fri, 12 Jun 2015 08:58:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z3OX3-000795-Gl for qemu-devel@nongnu.org; Fri, 12 Jun 2015 08:58:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3OX3-00078w-CI for qemu-devel@nongnu.org; Fri, 12 Jun 2015 08:58:01 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id E9F233824E3; Fri, 12 Jun 2015 12:58:00 +0000 (UTC) Received: from localhost (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5CCvxOp004404; Fri, 12 Jun 2015 08:58:00 -0400 From: Stefan Hajnoczi To: Date: Fri, 12 Jun 2015 13:57:33 +0100 Message-Id: <1434113861-26495-9-git-send-email-stefanha@redhat.com> In-Reply-To: <1434113861-26495-1-git-send-email-stefanha@redhat.com> References: <1434113861-26495-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell , Fam Zheng , Stefan Hajnoczi Subject: [Qemu-devel] [PULL 08/16] alsaaudio: Remove unused error handling of qemu_set_fd_handler X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Fam Zheng The function cannot fail, so the check is superfluous. Signed-off-by: Fam Zheng Message-id: 1433400324-7358-10-git-send-email-famz@redhat.com Signed-off-by: Stefan Hajnoczi --- 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;