lkml.org 
[lkml]   [2011]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] gma500: fix compiler warnings and format string
This patch fixes these compiler warnings:

CC drivers/staging/gma500/psb_gtt.o
drivers/staging/gma500/psb_gtt.c: In function ‘psb_gtt_insert’:
drivers/staging/gma500/psb_gtt.c:81:33: warning: unused variable ‘dev_priv’ [-Wunused-variable]
drivers/staging/gma500/psb_gtt.c: In function ‘psb_gtt_pin’:
drivers/staging/gma500/psb_gtt.c:237:2: warning: ‘ret’ may be used uninitialized in this function [-Wuninitialized]

It also fixes up the format string used in DRM_DEBUG() in
drivers/staging/gma500/psb_gtt.c:psb_gtt_init() - the string required
two arguments but only one was supplied.

While reading through the file I also deleted what trailing whitespace
I encountered.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
drivers/staging/gma500/psb_gtt.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/gma500/psb_gtt.c b/drivers/staging/gma500/psb_gtt.c
index 74c5a65..398df80 100644
--- a/drivers/staging/gma500/psb_gtt.c
+++ b/drivers/staging/gma500/psb_gtt.c
@@ -52,7 +52,7 @@ static inline uint32_t psb_gtt_mask_pte(uint32_t pfn, int type)
* psb_gtt_entry - find the GART entries for a gtt_range
* @dev: our DRM device
* @r: our GTT range
- *
+ *
* Given a gtt_range object return the GART offset of the page table
* entries for this gtt_range
*/
@@ -78,7 +78,6 @@ u32 *psb_gtt_entry(struct drm_device *dev, struct gtt_range *r)
*/
static int psb_gtt_insert(struct drm_device *dev, struct gtt_range *r)
{
- struct drm_psb_private *dev_priv = dev->dev_private;
u32 *gtt_slot, pte;
int numpages = (r->resource.end + 1 - r->resource.start) >> PAGE_SHIFT;
struct page **pages;
@@ -104,7 +103,7 @@ static int psb_gtt_insert(struct drm_device *dev, struct gtt_range *r)
}
/* Make sure all the entries are set before we return */
ioread32(gtt_slot - 1);
-
+
return 0;
}

@@ -215,7 +214,7 @@ static void psb_gtt_detach_pages(struct gtt_range *gt)
*/
int psb_gtt_pin(struct gtt_range *gt)
{
- int ret;
+ int ret = 0;
struct drm_device *dev = gt->gem.dev;
struct drm_psb_private *dev_priv = dev->dev_private;

@@ -264,7 +263,7 @@ void psb_gtt_unpin(struct gtt_range *gt)
}
mutex_unlock(&dev_priv->gtt_mutex);
}
-
+
/*
* GTT resource allocator - allocate and manage GTT address space
*/
@@ -291,7 +290,7 @@ struct gtt_range *psb_gtt_alloc_range(struct drm_device *dev, int len,
struct resource *r = dev_priv->gtt_mem;
int ret;
unsigned long start, end;
-
+
if (backed) {
/* The start of the GTT is the stolen pages */
start = r->start;
@@ -490,7 +489,7 @@ int psb_gtt_init(struct drm_device *dev, int resume)
goto out_err;
}

- DRM_DEBUG("%s: vram kernel virtual address %p\n", dev_priv->vram_addr);
+ DRM_DEBUG("vram kernel virtual address: %p\n", dev_priv->vram_addr);

tt_pages = (pg->gatt_pages < PSB_TT_PRIV0_PLIMIT) ?
(pg->gatt_pages) : PSB_TT_PRIV0_PLIMIT;
--
1.7.6

--
Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.
\
 
 \ /
  Last update: 2011-07-03 09:27    [W:0.031 / U:4.912 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site