From: tip-bot for FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
jbarnes@virtuousgeek.org, fujita.tomonori@lab.ntt.co.jp,
tglx@linutronix.de, mingo@elte.hu
Subject: [tip:core/iommu] x86: Calgary: Remove unnecessary DMA_ERROR_CODE usage
Date: Tue, 17 Nov 2009 08:25:22 GMT [thread overview]
Message-ID: <tip-1f7564ca831a00b21bb493ef174c845b2ba9e64d@git.kernel.org> (raw)
In-Reply-To: <1258287594-8777-4-git-send-email-fujita.tomonori@lab.ntt.co.jp>
Commit-ID: 1f7564ca831a00b21bb493ef174c845b2ba9e64d
Gitweb: http://git.kernel.org/tip/1f7564ca831a00b21bb493ef174c845b2ba9e64d
Author: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
AuthorDate: Sun, 15 Nov 2009 21:19:54 +0900
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Tue, 17 Nov 2009 07:53:21 +0100
x86: Calgary: Remove unnecessary DMA_ERROR_CODE usage
This cleans up iommu_alloc() a bit and removes unnecessary
DMA_ERROR_CODE usage.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: muli@il.ibm.com
Cc: joerg.roedel@amd.com
LKML-Reference: <1258287594-8777-4-git-send-email-fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
arch/x86/kernel/pci-calgary_64.c | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c
index af9f436..849a099 100644
--- a/arch/x86/kernel/pci-calgary_64.c
+++ b/arch/x86/kernel/pci-calgary_64.c
@@ -261,12 +261,15 @@ static dma_addr_t iommu_alloc(struct device *dev, struct iommu_table *tbl,
void *vaddr, unsigned int npages, int direction)
{
unsigned long entry;
- dma_addr_t ret = DMA_ERROR_CODE;
+ dma_addr_t ret;
entry = iommu_range_alloc(dev, tbl, npages);
- if (unlikely(entry == DMA_ERROR_CODE))
- goto error;
+ if (unlikely(entry == DMA_ERROR_CODE)) {
+ printk(KERN_WARNING "Calgary: failed to allocate %u pages in "
+ "iommu %p\n", npages, tbl);
+ return DMA_ERROR_CODE;
+ }
/* set the return dma address */
ret = (entry << PAGE_SHIFT) | ((unsigned long)vaddr & ~PAGE_MASK);
@@ -274,13 +277,7 @@ static dma_addr_t iommu_alloc(struct device *dev, struct iommu_table *tbl,
/* put the TCEs in the HW table */
tce_build(tbl, entry, npages, (unsigned long)vaddr & PAGE_MASK,
direction);
-
return ret;
-
-error:
- printk(KERN_WARNING "Calgary: failed to allocate %u pages in "
- "iommu %p\n", npages, tbl);
- return DMA_ERROR_CODE;
}
static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
prev parent reply other threads:[~2009-11-17 8:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-15 12:19 [PATCH 0/3] x86: kill global bad_dma_address variable FUJITA Tomonori
2009-11-15 12:19 ` [PATCH 1/3] gart: add own dma_mapping_error function FUJITA Tomonori
2009-11-17 8:24 ` [tip:core/iommu] x86: gart: Add " tip-bot for FUJITA Tomonori
2009-11-17 8:25 ` [tip:core/iommu] x86: gart: Clean up the code a bit tip-bot for Ingo Molnar
2009-11-15 12:19 ` [PATCH 2/3] x86: kill bad_dma_address variable FUJITA Tomonori
2009-11-17 8:25 ` [tip:core/iommu] x86: Kill " tip-bot for FUJITA Tomonori
2009-11-15 12:19 ` [PATCH 3/3] Calgary: remove unnecessary DMA_ERROR_CODE usage FUJITA Tomonori
2009-11-17 8:25 ` tip-bot for FUJITA Tomonori [this message]
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=tip-1f7564ca831a00b21bb493ef174c845b2ba9e64d@git.kernel.org \
--to=fujita.tomonori@lab.ntt.co.jp \
--cc=hpa@zytor.com \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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