[PATCH 23/23] agp/generic: Set the dma_addr[i] to DMA_ERROR_CODE

From: Konrad Rzeszutek Wilk
Date: Mon Dec 06 2010 - 18:25:25 EST


Set the dma_addr[i] to DMA_ERROR_CODE so it will be the
responsibility of the caller to set the dma_addr[i] to the right
value. Currently the callers that would utililize this are then ones
that set the type to AGP_USER_TYPES are the TTM and DRM APIs.


Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
drivers/char/agp/generic.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
index 534dccb..77ff3bd 100644
--- a/drivers/char/agp/generic.c
+++ b/drivers/char/agp/generic.c
@@ -1221,8 +1221,10 @@ struct agp_memory *agp_generic_alloc_user(size_t page_count, int type)
if (new == NULL)
return NULL;

- for (i = 0; i < page_count; i++)
+ for (i = 0; i < page_count; i++) {
new->pages[i] = NULL;
+ new->dma_addr[i] = DMA_ERROR_CODE;
+ }
new->page_count = 0;
new->type = type;
new->num_scratch_pages = pages;
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/