From nobody Mon Feb 9 18:44:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1640912231; cv=none; d=zohomail.com; s=zohoarc; b=DJt4bR/nm121eAAVZuVPCKYOdSNTSfLlNfP8wjaJP11/y27rVoGBHF3TNEiTg+qS7qwoniNi8exOMXAjb+/7n7hmbGezmTi0/UNIKM+pvtuNPDih905+VLo/fmDi/ZVTI8tjv2EIt+aDzxiE0X212i1MdJRL64I9L4/0UZH3TwM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1640912231; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=74OOiqX2C2ZPRJwdKtKEO75yG3GLUs7TFxrYw/0AG1I=; b=NBRisdl04ARkW+mq8UoB75eOHBz5LLkoTdilBIpfFPKat5Kbe4qcQNfduH+qKudozal9yroUvqwLoIkgCILDmx7+nCtFYyeMHJp/A76Nj8zCv8TDbOgVPjsDMS5mmt09IrMwaefWmBjMQ5gQEoJRDJE9TZdPoJqlbCIiD36kFzs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1640912231114514.9515678110736; Thu, 30 Dec 2021 16:57:11 -0800 (PST) Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-21-1TTS9JZiPNuZKxHHdG80wA-1; Thu, 30 Dec 2021 19:57:09 -0500 Received: by mail-ed1-f72.google.com with SMTP id t1-20020a056402524100b003f8500f6e35so18072815edd.8 for ; Thu, 30 Dec 2021 16:57:09 -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 w11sm6836821edd.21.2021.12.30.16.57.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Dec 2021 16:57:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640912230; 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=74OOiqX2C2ZPRJwdKtKEO75yG3GLUs7TFxrYw/0AG1I=; b=TZWrLaTdXRVbb9Z4s9LJ3ypFhJyo4FLkAG1jDLz6t6s1q0WT0wEdflDQ7S0AtVDYAFs9o7 sQBzCQi/1NYk2GCRITckwiV2elF7nw61Hq5wQDm4BcBn1pRdgWOhOhGkL6rF8rUdlZ+QAh XMbr3XMQJP79gvsGc6ed8fc1k9YwQmA= X-MC-Unique: 1TTS9JZiPNuZKxHHdG80wA-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=74OOiqX2C2ZPRJwdKtKEO75yG3GLUs7TFxrYw/0AG1I=; b=VVHR1RBB3TqYLHO856aXhJT2TnJyRZgYS0tJE1Q/1M1YCBn+YlVwi436zUQCO6nfPm btnw/z8jjOdWhk2dr04926GkYE5jOEl2M6sLa4OYQ3VeIxekiThP7NRSBlqtSbhOEhB/ YaoeaUJkI90j50Qf9v0wZ0w5+txzzlhgUoK18PK2wNU+zKe+F3aHwU0pZwh4hn4ENveL 1mnTNTfPTeveBNeHLazTz5y3snFbPbX3wHCi65tT7jQikzun23AjcJEucY3mGEmdbDUE mMPQ6Fy0GwJ6bimzM3eSt171LIjbK2PthbarEbbJw2c9cdIx9yGTtlXSu9LZKQ1OZfiD ZuCQ== X-Gm-Message-State: AOAM531eKkVfFGo2Ya4cYrHb82xd+vJt/R7LdpVTbFeux198pMBr2bif XzQHuZ9bU0ZIROpCSImQ2t6aJYHi51RIWm7K3PPbXrQ/Acvw3/yhCfyqY0I/X8uS3pkGqfxPGSp ztEbXCAyD2yfeMw== X-Received: by 2002:aa7:d795:: with SMTP id s21mr988788edq.30.1640912227985; Thu, 30 Dec 2021 16:57:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJwO9MOEJbowYJ6hMSuiR+HX2ZiP/i9IskH9TxDPXUEPluOOVHYkaXf2i+FmlDmSIYCjj84VBA== X-Received: by 2002:aa7:d795:: with SMTP id s21mr988782edq.30.1640912227876; Thu, 30 Dec 2021 16:57:07 -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?= , Richard Henderson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 17/22] dma: Let st*_dma() propagate MemTxResult Date: Fri, 31 Dec 2021 01:55:41 +0100 Message-Id: <20211231005546.723396-18-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: 1640912232732000001 dma_memory_write() returns a MemTxResult type. Do not discard it, return it to the caller. Reviewed-by: Richard Henderson Reviewed-by: C=C3=A9dric Le Goater Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211223115554.3155328-18-philmd@redhat.com> --- include/sysemu/dma.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/sysemu/dma.h b/include/sysemu/dma.h index d1635f55870..895044d747f 100644 --- a/include/sysemu/dma.h +++ b/include/sysemu/dma.h @@ -248,13 +248,13 @@ static inline void dma_memory_unmap(AddressSpace *as, dma_memory_read(as, addr, &val, (_bits) / 8, attrs); \ return _end##_bits##_to_cpu(val); \ } \ - static inline void st##_sname##_##_end##_dma(AddressSpace *as, \ - dma_addr_t addr, \ - uint##_bits##_t val, \ - MemTxAttrs attrs) \ - { \ - val =3D cpu_to_##_end##_bits(val); \ - dma_memory_write(as, addr, &val, (_bits) / 8, attrs); \ + static inline MemTxResult st##_sname##_##_end##_dma(AddressSpace *as, \ + dma_addr_t addr, \ + uint##_bits##_t va= l, \ + MemTxAttrs attrs) \ + { \ + val =3D cpu_to_##_end##_bits(val); \ + return dma_memory_write(as, addr, &val, (_bits) / 8, attrs); \ } =20 static inline uint8_t ldub_dma(AddressSpace *as, dma_addr_t addr, MemTxAtt= rs attrs) @@ -265,10 +265,10 @@ static inline uint8_t ldub_dma(AddressSpace *as, dma_= addr_t addr, MemTxAttrs att return val; } =20 -static inline void stb_dma(AddressSpace *as, dma_addr_t addr, - uint8_t val, MemTxAttrs attrs) +static inline MemTxResult stb_dma(AddressSpace *as, dma_addr_t addr, + uint8_t val, MemTxAttrs attrs) { - dma_memory_write(as, addr, &val, 1, attrs); + return dma_memory_write(as, addr, &val, 1, attrs); } =20 DEFINE_LDST_DMA(uw, w, 16, le); --=20 2.33.1