From patchwork Thu Jan 23 07:49:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Volker_R=C3=BCmelin?= X-Patchwork-Id: 1227675 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=t-online.de Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 483Dw566s1z9sS3 for ; Thu, 23 Jan 2020 18:50:29 +1100 (AEDT) Received: from localhost ([::1]:52354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuXFz-0005kH-9T for incoming@patchwork.ozlabs.org; Thu, 23 Jan 2020 02:50:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46026) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuXFN-0005hA-Nc for qemu-devel@nongnu.org; Thu, 23 Jan 2020 02:49:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iuXFM-0004Px-QZ for qemu-devel@nongnu.org; Thu, 23 Jan 2020 02:49:49 -0500 Received: from mailout01.t-online.de ([194.25.134.80]:36340) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iuXFM-0004P9-Ku for qemu-devel@nongnu.org; Thu, 23 Jan 2020 02:49:48 -0500 Received: from fwd28.aul.t-online.de (fwd28.aul.t-online.de [172.20.26.133]) by mailout01.t-online.de (Postfix) with SMTP id 5BBAC42DD470; Thu, 23 Jan 2020 08:49:47 +0100 (CET) Received: from linpower.localnet (GvE5AwZawhyHpEISWGUAR6yEAWHXtdmV5fAU0TtZcH1uphGC7+rltvL1mYr6Y36QlL@[46.86.62.122]) by fwd28.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1iuXFK-468UOO0; Thu, 23 Jan 2020 08:49:46 +0100 Received: by linpower.localnet (Postfix, from userid 1000) id 55E302006F4; Thu, 23 Jan 2020 08:49:43 +0100 (CET) From: =?utf-8?q?Volker_R=C3=BCmelin?= To: Gerd Hoffmann Subject: [PATCH 2/9] audio: fix audio_generic_read Date: Thu, 23 Jan 2020 08:49:36 +0100 Message-Id: <20200123074943.6699-2-vr_qemu@t-online.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <1e29e1d3-b59b-fcd6-cdff-a680bcdbffa4@t-online.de> References: <1e29e1d3-b59b-fcd6-cdff-a680bcdbffa4@t-online.de> MIME-Version: 1.0 X-ID: GvE5AwZawhyHpEISWGUAR6yEAWHXtdmV5fAU0TtZcH1uphGC7+rltvL1mYr6Y36QlL X-TOI-MSGID: aaa557f0-0931-451b-b1ee-f95a482e22fe X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 194.25.134.80 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: QEMU , =?utf-8?b?Wm9sdMOhbiBLxZF2w6Fnw7M=?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It seems the function audio_generic_read started as a copy of function audio_generic_write and some necessary changes were forgotten. Fix the mixed up source and destination pointers and rename misnamed variables. Signed-off-by: Volker RĂ¼melin --- audio/audio.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/audio/audio.c b/audio/audio.c index db44482342..bf0f01e17f 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1480,12 +1480,12 @@ size_t audio_generic_write(HWVoiceOut *hw, void *buf, size_t size) size_t audio_generic_read(HWVoiceIn *hw, void *buf, size_t size) { - size_t dst_size, copy_size; - void *dst = hw->pcm_ops->get_buffer_in(hw, &dst_size); - copy_size = MIN(size, dst_size); + size_t src_size, copy_size; + void *src = hw->pcm_ops->get_buffer_in(hw, &src_size); + copy_size = MIN(size, src_size); - memcpy(dst, buf, copy_size); - hw->pcm_ops->put_buffer_in(hw, buf, copy_size); + memcpy(buf, src, copy_size); + hw->pcm_ops->put_buffer_in(hw, src, copy_size); return copy_size; }