From nobody Mon Feb 9 16:13:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1639658175; cv=none; d=zohomail.com; s=zohoarc; b=S4gAj/e0gMGlwgtUYK4gLQUb1xUpph6ApVhft/bVZyl2P1HdfHglhEwLTTQE5Laq7J3VRzGjU7w7dxOcSHN/zDnOYknMpiWTkjtCjoNsGnvn0I0YBiOCenl9GPieih/w8mj7+RhIy+82/a+USqRSrq7WiLZlvIkoRruMdCx6LIU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639658175; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=OjX8CYLaX4R3RIAI7ku1YNlJqt9CA9792fVcfHD3DXE=; b=aIYcsVk66ni0BVL3tiwq12YOmFKH0p1dpZGVqiyKbBiSqHIPIyJQH2VuA5dY8H++bfT7gsESkFPmDfZ1lyKZgzhN1bF8bt90bYVWDgWCp1BIj8u1zXxtmoZfM/XgXcj514mWuBLuUbYpH3rfo8f79oeLKy09hc0EMbqVXoLRi74= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1639658175929781.3326207839963; Thu, 16 Dec 2021 04:36:15 -0800 (PST) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-166-E6niSwPANZKN_wJhizNpRQ-1; Thu, 16 Dec 2021 07:36:13 -0500 Received: by mail-wm1-f70.google.com with SMTP id n31-20020a05600c3b9f00b0034440f99123so3212750wms.7 for ; Thu, 16 Dec 2021 04:36:13 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (174.red-83-50-185.dynamicip.rima-tde.net. [83.50.185.174]) by smtp.gmail.com with ESMTPSA id o12sm6105798wrc.85.2021.12.16.04.36.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Dec 2021 04:36:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639658174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OjX8CYLaX4R3RIAI7ku1YNlJqt9CA9792fVcfHD3DXE=; b=FAnYdxZK2WAi353qZSKgzwh3N1QHWjG3BCvIDA+xwCufIjNZCJPIUSA9Gt6xBjNYOUPYXy jUiaavx9S1+4gdCI9ghZShsoL6IGVIQFhvioXYM5Je/EgliUOylLutdm30ZCLLoZPf/pTZ n2/dfUAjMkQyQ/j7nQy9trKpVv6KHCY= X-MC-Unique: E6niSwPANZKN_wJhizNpRQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OjX8CYLaX4R3RIAI7ku1YNlJqt9CA9792fVcfHD3DXE=; b=MHeyjjOVWE8Tyqwoy7PZ6YuJsfDpNuSHbnssOY+kQvOMFkMnQDXapznDNwvsvp/Flu xOspSFRHbGvOLLAFQEMQ2gmLc1eZjpRaB8FQYOvSI+fXLkI2d1CdXl5pWOsayTrJNnTP zVp8EioSlwh57gFx47N0FcTAAtoOaO33fOA9zNnAuD0JzJ0uJ7h2Fs+MYaDaQGqid0T3 AReziKM/hMTIWRf5LTEnlYK5e3QtTzhOjwG63QJTb0fXjTaTTBKQwy/v0e9Dp5R4cnup LeKgFtwJCTu0TW3nYdzjYlFQDqb8/fhqvBbwNwBO4yHnHKj1vyMPGq4oE6LYj92isRq/ +gkw== X-Gm-Message-State: AOAM532wgQltJvamjEfNVU8H8ip3tOYAN/MH/6I+8oU7QzeB4Bbyfoo5 YXN11T6MP5jeO4mwzYrJioRhXXcETpBtQ3+VUHsMqAQ2Hwm9JbxZN6Mucy/Tqwg93HAz/EyMFL1 FukNiLJAlrbAmdQ== X-Received: by 2002:a5d:66cb:: with SMTP id k11mr9233282wrw.253.1639658172847; Thu, 16 Dec 2021 04:36:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2kn9WZBr5BRR9aX7rH7oWfDlQQBLIJSj9XP+aC0UFvSZ8A6EAhCUwTwi39z/SeU3tS1RolQ== X-Received: by 2002:a5d:66cb:: with SMTP id k11mr9233254wrw.253.1639658172653; Thu, 16 Dec 2021 04:36:12 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Xu , Alexander Bulekov , qemu-block@nongnu.org, Qiuhao Li , Hannes Reinecke , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Klaus Jensen , Jason Wang , Li Qiang , Paolo Bonzini , David Hildenbrand , "Michael S. Tsirkin" , John Snow , Gerd Hoffmann , Marcel Apfelbaum , Keith Busch , Fam Zheng Subject: [PATCH 1/8] dma: Have dma_buf_rw() take a void pointer Date: Thu, 16 Dec 2021 13:35:51 +0100 Message-Id: <20211216123558.799425-2-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211216123558.799425-1-philmd@redhat.com> References: <20211216123558.799425-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1639658177982100001 DMA operations are run on any kind of buffer, not arrays of uint8_t. Convert dma_buf_rw() to take a void pointer argument to save us pointless casts to uint8_t *. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- softmmu/dma-helpers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/softmmu/dma-helpers.c b/softmmu/dma-helpers.c index 3c06a2feddd..09e29997ee5 100644 --- a/softmmu/dma-helpers.c +++ b/softmmu/dma-helpers.c @@ -294,9 +294,10 @@ BlockAIOCB *dma_blk_write(BlockBackend *blk, } =20 =20 -static uint64_t dma_buf_rw(uint8_t *ptr, int32_t len, QEMUSGList *sg, +static uint64_t dma_buf_rw(void *buf, int32_t len, QEMUSGList *sg, DMADirection dir) { + uint8_t *ptr =3D buf; uint64_t resid; int sg_cur_index; =20 --=20 2.33.1