linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: seanpaul@chromium.org (Sean Paul)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] arm64: Use DMA_ERROR_CODE to denote failed allocation
Date: Wed,  1 Oct 2014 11:31:50 -0400	[thread overview]
Message-ID: <1412177510-26310-1-git-send-email-seanpaul@chromium.org> (raw)
In-Reply-To: <20141001135248.GQ5182@n2100.arm.linux.org.uk>

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 <seanpaul@chromium.org>
---

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;
 }
 
-- 
2.1.1

  reply	other threads:[~2014-10-01 15:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-30 20:15 [PATCH] arm64: Use and error-check DMA_ERROR_CODE Sean Paul
2014-10-01 10:13 ` Will Deacon
2014-10-01 10:56   ` Catalin Marinas
2014-10-01 13:52   ` Russell King - ARM Linux
2014-10-01 15:31     ` Sean Paul [this message]
2014-10-02 10:57       ` [PATCH v2] arm64: Use DMA_ERROR_CODE to denote failed allocation Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1412177510-26310-1-git-send-email-seanpaul@chromium.org \
    --to=seanpaul@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).