From nobody Mon Feb 9 15:45:47 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=1640912190; cv=none; d=zohomail.com; s=zohoarc; b=LGLgnsSWg1Yel7nZkl79Qdgz9tXY2jhOuJDVK6UAEal+g5l/NYwlLWFnybrzceo0KWsoiPFIkzEevp53xAPAkpHpLypUDDggOZyxhOez2vhMIgnXiwF7a5yUIh7/EggoPqcKKwDR/EXTHoKykgaSxLbwFNrHYCaMtDzCxrq8psA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1640912190; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=JE68J83OkbzA8nCRRfKVPFa1WbIbEeNp8R6h+tw15yA=; b=UrhJZLu3YpIq4MzuBLcIwJgQ8BylwU+Ckh3L4f1KWobJ5vlHn+Q441u6rx9XpP12D+c3W9w/WZvVxUCazb4fsbmlZZdtz6vGkLuAQ7JaxHSaZSo+cXgq6prnz5LYGkJ8JbMmCpuHCtcfWmdZuHtFyq3p+fwsuv1QNyntoKl564k= 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 1640912190058239.12789986872735; Thu, 30 Dec 2021 16:56:30 -0800 (PST) Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-384-eDvX5dw7N-ymA3S0wsdGlQ-1; Thu, 30 Dec 2021 19:56:28 -0500 Received: by mail-ed1-f71.google.com with SMTP id d7-20020aa7ce07000000b003f84e9b9c2fso17913438edv.3 for ; Thu, 30 Dec 2021 16:56:28 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id sa6sm8122800ejc.6.2021.12.30.16.56.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Dec 2021 16:56:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640912189; 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=JE68J83OkbzA8nCRRfKVPFa1WbIbEeNp8R6h+tw15yA=; b=TdDU+OjM6C+Tr/EzHR/twWVF5jTTkb/3SR+7NY3C7FiUtF5hx2mizDCGdZNalWhSUSFMP2 TFrpejZ6kajxWLG3sBE9IfAHdsotp7NPG0QaPjUYp/pxJTpWUJz1QXSqt3zrGRtiWq1TSm d13bf5ac4ssDG5x+mS8i6+P4gGu2z1k= X-MC-Unique: eDvX5dw7N-ymA3S0wsdGlQ-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=JE68J83OkbzA8nCRRfKVPFa1WbIbEeNp8R6h+tw15yA=; b=NWTHCjALf/lcvNZnwKcdaFycvt/9EoAnpYc9cJ0qnV0vg/6SIarvqufaecHnRJdgNl loOUkKw3zdHNPW6CHDUYt6MBRXHY/ViPbvGp3EHzWwdy9ivTgt9jx2Liuq3V51XA51gL Dco2p/EBH9V0UgzrjvkErCMTP0Nj8rKNz40To/CyJkmQ6NC601tAKyOVzSUlyifHyVkV cyJAOOE/n+Nwg5/IILWGvJ9FsPzu0w6bwCF2SPUDRR5AzdJj8z3K7MN5jFy3wjwYl4FR DdlqohlBDHE/jrbo86bKWvLlgFCggTwKFp5Dxdwp+5yvxb34V0qxdcEK1M7KEpFFaSQq cJJg== X-Gm-Message-State: AOAM531bPBTW5UeSv8SxVBeJmtONDLcCfFRF0ol1qgck89/aCPTRYbZ2 /VF8lbXWtmlUDJngtDyhlkT30t5ac5z6mez2HdZSpzkzIq6BcA3J56n1dyJ99HBCuPDZ8qKuDEF sB0l4NnKFqmjdKw== X-Received: by 2002:a17:907:1c92:: with SMTP id nb18mr26650575ejc.249.1640912187240; Thu, 30 Dec 2021 16:56:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJydYwDARW50WnUU4/RVl/v4ApOhsA9Jb5AvPSAimAvCKtmnNIOYftP9+T4mG3pHewE9VGTk2w== X-Received: by 2002:a17:907:1c92:: with SMTP id nb18mr26650573ejc.249.1640912187116; Thu, 30 Dec 2021 16:56:27 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Klaus Jensen Subject: [PULL 08/22] dma: Have dma_buf_rw() take a void pointer Date: Fri, 31 Dec 2021 01:55:32 +0100 Message-Id: <20211231005546.723396-9-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231005546.723396-1-philmd@redhat.com> References: <20211231005546.723396-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: 1640912192020000002 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 *. Reviewed-by: Klaus Jensen Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211223115554.3155328-8-philmd@redhat.com> --- 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