From patchwork Tue May 19 10:51:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 473689 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 64004140D4E for ; Tue, 19 May 2015 12:56:10 +1000 (AEST) Received: from localhost ([::1]:43680 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuXhQ-0003UJ-EL for incoming@patchwork.ozlabs.org; Mon, 18 May 2015 22:56:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuXdW-0004YH-Jj for qemu-devel@nongnu.org; Mon, 18 May 2015 22:52:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YuXdU-0001nW-Mo for qemu-devel@nongnu.org; Mon, 18 May 2015 22:52:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuXdU-0001nR-8z; Mon, 18 May 2015 22:52:04 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4J2q0TA018790 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 18 May 2015 22:52:00 -0400 Received: from cpc-pc.redhat.com (vpn1-5-200.pek2.redhat.com [10.72.5.200]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4J2p7Rq009902; Mon, 18 May 2015 22:51:54 -0400 From: Fam Zheng To: qemu-devel@nongnu.org Date: Tue, 19 May 2015 10:51:06 +0000 Message-Id: <1432032670-15124-10-git-send-email-famz@redhat.com> In-Reply-To: <1432032670-15124-1-git-send-email-famz@redhat.com> References: <1432032670-15124-1-git-send-email-famz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , qemu-block@nongnu.org, Juan Quintela , Jason Wang , Vincenzo Maffione , "Vassili Karpov \(malc\)" , Gerd Hoffmann , Stefan Hajnoczi , Amit Shah , Paolo Bonzini , Giuseppe Lettieri , Luigi Rizzo Subject: [Qemu-devel] [PATCH v3 09/13] 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 The function cannot fail, so the check is superfluous. Signed-off-by: Fam Zheng --- 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;