From patchwork Sat Dec 18 14:51:10 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: 1570519 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=FwM9MmGZ; 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 4JGTMp4b07z9sRR for ; Sun, 19 Dec 2021 01:52:06 +1100 (AEDT) Received: from localhost ([::1]:50954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1myb48-00066A-FK for incoming@patchwork.ozlabs.org; Sat, 18 Dec 2021 09:52:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myb3e-0005gI-J5 for qemu-ppc@nongnu.org; Sat, 18 Dec 2021 09:51:36 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:33765) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myb3d-0001B5-0t for qemu-ppc@nongnu.org; Sat, 18 Dec 2021 09:51:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639839092; 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=Z0wxGg120YyeF7AD5AshLrhx/8IEHK5hXeX4znVMwbA=; b=FwM9MmGZrsbf/A0zSa+oD58I8Yk6zNKOTiz5/dWG8vPm94/eyj8oN8St68CShrXDM626xX kGIQ3vDYh5bEEfWl20Ay12AFx0tCilSN4JxVlLs1U7hftTw1bpOAVFBPIo8Qp9fbPbsiq5 Xx+2zbXhHrVKGB0lhnZInHlubFLxSmY= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-382-aId2F0-NPj-DYOuCs5_x8Q-1; Sat, 18 Dec 2021 09:51:29 -0500 X-MC-Unique: aId2F0-NPj-DYOuCs5_x8Q-1 Received: by mail-wr1-f69.google.com with SMTP id k11-20020adfc70b000000b001a2333d9406so1491933wrg.3 for ; Sat, 18 Dec 2021 06:51:29 -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=Z0wxGg120YyeF7AD5AshLrhx/8IEHK5hXeX4znVMwbA=; b=Foa7bS3qvoMcLxT0PRcvyozhUYoTud73VkoTlXJ9sSZvyHDVLCF6gBkktVMkXSLnio OvmrT/XK81+D35L6cAdABaHG+ie8vqDNabxT3v811H61L4/fZv6EgxrZQlOF2735jeAR iXCAAibwvt3fMGbwOTErLZ3ow0rc12FwkjkBfILzO7503CPDypATTBrb7v5CvUwMM5pk 301L4f9C6Mf3iwnTHxU+jUbFXZsipjRc0086jL37Pkwo/EhiYRWIV0OAt7fQJ9Q1h4ct YiChoUvWGxQtJ4JatBDbPdRU2IVagOZf8DbzmEB7hRNQNj29ePbaZ3KpN7rZueyo9/SS 7fHg== X-Gm-Message-State: AOAM533ng2y4KZLIllA92j6npxaqSCiEGHNNV7Cc3pDeZ7s2+Bsvqph0 4qvbXbho84/410KzEqifdXsxhmy5U/PXNV5OB/OQBqZedBuNmo9uk+hRfdVrpe69x4lxHLoZLFY nqkHJAZ8TSFpj X-Received: by 2002:a5d:460d:: with SMTP id t13mr6667409wrq.44.1639839088222; Sat, 18 Dec 2021 06:51:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTUALNby17VArSwVhgi2Rd5e5bePTtubSqB/nhxUQypN3GuJLWE13uk2WnAO47OERY/aFYUg== X-Received: by 2002:a5d:460d:: with SMTP id t13mr6667399wrq.44.1639839088080; Sat, 18 Dec 2021 06:51:28 -0800 (PST) Received: from x1w.. (174.red-83-50-185.dynamicip.rima-tde.net. [83.50.185.174]) by smtp.gmail.com with ESMTPSA id o64sm10566299wme.28.2021.12.18.06.51.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Dec 2021 06:51:27 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 3/4] dma: Let st*_dma() propagate MemTxResult Date: Sat, 18 Dec 2021 15:51:10 +0100 Message-Id: <20211218145111.1540114-4-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211218145111.1540114-1-philmd@redhat.com> References: <20211218145111.1540114-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: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.718, 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: Daniel Henrique Barboza , "Michael S. Tsirkin" , David Hildenbrand , Li Qiang , Qiuhao Li , Peter Xu , Greg Kurz , Alexander Bulekov , qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dr?= =?utf-8?q?ic_Le_Goater?= , Marcel Apfelbaum , Paolo Bonzini , David Gibson , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Gerd Hoffmann 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. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater --- 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 b711d390a4f..191cf0b271a 100644 --- a/include/sysemu/dma.h +++ b/include/sysemu/dma.h @@ -249,13 +249,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) @@ -266,10 +266,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);