summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-06-04 09:18:29 +0200
committerThierry Reding <treding@nvidia.com>2014-06-04 12:12:32 +0200
commit992d3b4292e891c3d36a6fe3ad6e8d6b59cd0ecb (patch)
tree4b506d48b7740da9112124cfabe01416a9b741b4
parentc69a9d51c1b3896d211d7d1c713babccd5c860ae (diff)
drm/prime: Use unsigned type for number of pages
The number of pages can never be negative, so an unsigned type is enough. This also matches the type of the n_pages argument of the sg_alloc_table_from_pages() function. Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--drivers/gpu/drm/drm_prime.c2
-rw-r--r--include/drm/drmP.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index 99d578bad17..83cf6a22f78 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -666,7 +666,7 @@ int drm_prime_fd_to_handle_ioctl(struct drm_device *dev, void *data,
* the driver is responsible for mapping the pages into the
* importers address space for use with dma_buf itself.
*/
-struct sg_table *drm_prime_pages_to_sg(struct page **pages, int nr_pages)
+struct sg_table *drm_prime_pages_to_sg(struct page **pages, unsigned int nr_pages)
{
struct sg_table *sg = NULL;
int ret;
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 904f93bc70f..72691ffeeaa 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1482,7 +1482,7 @@ extern int drm_prime_fd_to_handle_ioctl(struct drm_device *dev, void *data,
extern int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, struct page **pages,
dma_addr_t *addrs, int max_pages);
-extern struct sg_table *drm_prime_pages_to_sg(struct page **pages, int nr_pages);
+extern struct sg_table *drm_prime_pages_to_sg(struct page **pages, unsigned int nr_pages);
extern void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *sg);
int drm_gem_dumb_destroy(struct drm_file *file,