From patchwork Wed Oct 1 15:31:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 5012891 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0FFC99F327 for ; Wed, 1 Oct 2014 15:35:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F44720211 for ; Wed, 1 Oct 2014 15:35:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 52D2E2020F for ; Wed, 1 Oct 2014 15:35:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XZLt7-00081o-Q3; Wed, 01 Oct 2014 15:32:21 +0000 Received: from mail-yk0-x233.google.com ([2607:f8b0:4002:c07::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XZLt5-0007yJ-Ar for linux-arm-kernel@lists.infradead.org; Wed, 01 Oct 2014 15:32:19 +0000 Received: by mail-yk0-f179.google.com with SMTP id 131so205175ykp.10 for ; Wed, 01 Oct 2014 08:31:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pWS30xmw+WuiIjtb/ppAimXPKXe0jguXh4X7jRaem+4=; b=oXsKqIAScCqBgEXWRiUtB5sQZZy7Egd/995o9oDgrqD6QLBHL9ZaqPDxYS6jgxrLOx ticu2p3/U//DBs+U2tlIjhSpPWctsfdoVWPJfrN86kSdsO1vSuiRars7O2etua29ME91 iWOjtVNWD06VFnHWMCdrX7Tgaacpzc6zhpFig= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pWS30xmw+WuiIjtb/ppAimXPKXe0jguXh4X7jRaem+4=; b=QUO5UNpZCQvYks+yTJdT1ptqxkta3vaxcnhrxqXPD7XGaG0Cxa6glpRTdlIU739FnY p7IuPhBGABBdcnuZgdUn+r7U+NYUzwqhs3gDOoBA1qLT1t/NalMxJiiNdV6hVNzsUKZl JBYO436Pcrr4sfO6qzz3j+DrvmKmS91b7IopLkKLXTV8gZlg3LRAM8ggBDcylgIeDkGh 2aubryIp82eByYKWTdmug8f5zMpIF31JdttY3bzU/JQ8m+d2F5DFTZ+1bQGv6+HOOxb4 FPPOg/HFPM0yj0V/7E7sQTJmouqDdeNgqhKj/aGRAi3A7bn4sDcI0SobtwUl/2yULWY7 tDZA== X-Gm-Message-State: ALoCoQlp4Bf0KlQgYGyN3nKa3qZI6afVizZbOqAIAMz7F3iMmorTzMLT0Pc32lbu/l3qtZ8t1d4d X-Received: by 10.236.47.166 with SMTP id t26mr25707923yhb.104.1412177517501; Wed, 01 Oct 2014 08:31:57 -0700 (PDT) Received: from localhost.localdomain (cpe-173-095-180-236.nc.res.rr.com. [173.95.180.236]) by mx.google.com with ESMTPSA id y42sm528249yhy.55.2014.10.01.08.31.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Oct 2014 08:31:56 -0700 (PDT) From: Sean Paul To: catalin.marinas@arm.com, will.deacon@arm.com, lauraa@codeaurora.org, ritesh.harjani@gmail.com, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] arm64: Use DMA_ERROR_CODE to denote failed allocation Date: Wed, 1 Oct 2014 11:31:50 -0400 Message-Id: <1412177510-26310-1-git-send-email-seanpaul@chromium.org> X-Mailer: git-send-email 2.1.1 In-Reply-To: <20141001135248.GQ5182@n2100.arm.linux.org.uk> References: <20141001135248.GQ5182@n2100.arm.linux.org.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141001_083219_436188_EDC0B500 X-CRM114-Status: GOOD ( 11.60 ) X-Spam-Score: -0.1 (/) Cc: olof@lixom.net, seanpaul@chromium.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch replaces the static assignment of ~0 to dma_handle with DMA_ERROR_CODE to be consistent with other platforms. Signed-off-by: Sean Paul --- Changes in v2: - Removed the check for DMA_ERROR_CODE in __dma_free_noncoherent the function shouldn't be called after failed allocation arch/arm64/mm/dma-mapping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index 4164c5a..5687dd4 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c @@ -125,7 +125,7 @@ static void *__dma_alloc_noncoherent(struct device *dev, size_t size, no_map: __dma_free_coherent(dev, size, ptr, *dma_handle, attrs); no_mem: - *dma_handle = ~0; + *dma_handle = DMA_ERROR_CODE; return NULL; }