From patchwork Thu Dec 23 11:55:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1572653 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=bRL+4kY/; dkim-atps=neutral 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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4JKTxN0Cnwz9tkD for ; Thu, 23 Dec 2021 23:28:08 +1100 (AEDT) Received: from localhost ([::1]:40624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n0NCX-0007g2-RU for incoming@patchwork.ozlabs.org; Thu, 23 Dec 2021 07:28:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0MlM-0004cj-6R for qemu-ppc@nongnu.org; Thu, 23 Dec 2021 07:00:01 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:43267) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0MlJ-0001EJ-UR for qemu-ppc@nongnu.org; Thu, 23 Dec 2021 06:59:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640260797; 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=AccLfnY/B/12ZHLoZ2OU6IixKvcUVx9674CliXPrEJo=; b=bRL+4kY/zinwtC3pF1HHQOFS2JifjDtsAbfJKltGrh3AUIIf5zlC9osuaNQTaAh4COFfyp Z4CxUHmk5kz8mOmd2dc3qq2COm7mrpjbceYCQmLBtLH7X/etVUL48vuf/pU15MoZMe0wyx Ysea6vMgVcwSCs6fdIZP6F8fhauohcY= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-182-GncSlYyBNKilshsPNQJ-mA-1; Thu, 23 Dec 2021 06:59:54 -0500 X-MC-Unique: GncSlYyBNKilshsPNQJ-mA-1 Received: by mail-wm1-f71.google.com with SMTP id b75-20020a1c804e000000b0034569bde713so4532719wmd.9 for ; Thu, 23 Dec 2021 03:59:54 -0800 (PST) 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=AccLfnY/B/12ZHLoZ2OU6IixKvcUVx9674CliXPrEJo=; b=XF7NrtZQHt0yWb513AxyT0tvvGTMjetKQCxzpBN4L6jG+cLBI+zG4zbKNQggwxVvfj L8se4gqAMc67HJlOMiD1rWqnv9LRvgFpyGPbWMdMSjBpkABQL6Es/hnkUiQmPt5A/o1i Qcpkjq2PTjvu8rKP9YamWBbKJheqnBYONdSen+mFaQqgElhL8nyF1PNqgo2ogjKFItCQ azwgnLHsomcvmc3+DlEKivh/WetaICDSxzHu7YQIooihLnQQFoTSHT7riJn3nGlY3nob gjU+6dUesKKHAFy9NDX7GC0pj6eUwrY/64K3vXVHu6axukDvRjRn38GfJa5EIYlZ9Qdg kThQ== X-Gm-Message-State: AOAM5336+xbut5eNu+vmstB+cUinHin10ZWa+X7uP5+CKTeALEcK+Din H68YtikQDvOc3ux/7DlSFStluGIYe4HV7pPW7IUZstHNfZi9rp52R220IMoo+AbKFn8EyncJv41 eUQI97sCNKMa9 X-Received: by 2002:a05:600c:1f18:: with SMTP id bd24mr1593841wmb.174.1640260793172; Thu, 23 Dec 2021 03:59:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/oJ4qDHZs1qmUK48d0flpcHtTo7uhZOdN58vL8y6w/JcRg0Kb4wZpKSYPbM+SK/9h+ecGLw== X-Received: by 2002:a05:600c:1f18:: with SMTP id bd24mr1593821wmb.174.1640260793042; Thu, 23 Dec 2021 03:59:53 -0800 (PST) Received: from x1w.. (33.red-193-152-124.dynamicip.rima-tde.net. [193.152.124.33]) by smtp.gmail.com with ESMTPSA id i4sm7759112wmd.34.2021.12.23.03.59.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Dec 2021 03:59:52 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 17/23] dma: Let st*_dma() propagate MemTxResult Date: Thu, 23 Dec 2021 12:55:48 +0100 Message-Id: <20211223115554.3155328-18-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211223115554.3155328-1-philmd@redhat.com> References: <20211223115554.3155328-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 Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.203, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Peter Maydell , Dmitry Fleytman , "Michael S. Tsirkin" , Jason Wang , Bin Meng , David Hildenbrand , Peter Xu , Gerd Hoffmann , Klaus Jensen , Sven Schnelle , Hannes Reinecke , qemu-block@nongnu.org, Daniel Henrique Barboza , Havard Skinnemoen , Joel Stanley , Marcel Apfelbaum , Stefan Weil , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alistair Francis , Richard Henderson , Greg Kurz , Beniamino Galvani , Eric Auger , qemu-arm@nongnu.org, Jan Kiszka , =?utf-8?q?C=C3=A9dric_?= =?utf-8?q?Le_Goater?= , Keith Busch , John Snow , David Gibson , Eduardo Habkost , Andrew Jeffery , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Andrew Baumann , Tyrone Ting , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-ppc" dma_memory_write() returns a MemTxResult type. Do not discard it, return it to the caller. Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé --- 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 f3cf60d222d..725e8e90f88 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 = 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 val, \ + MemTxAttrs attrs) \ + { \ + val = cpu_to_##_end##_bits(val); \ + return dma_memory_write(as, addr, &val, (_bits) / 8, attrs); \ } static inline uint8_t ldub_dma(AddressSpace *as, dma_addr_t addr, MemTxAttrs attrs) @@ -265,10 +265,10 @@ static inline uint8_t ldub_dma(AddressSpace *as, dma_addr_t addr, MemTxAttrs att return val; } -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); } DEFINE_LDST_DMA(uw, w, 16, le);