mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] gma500: fix compiler warnings and format string
@ 2011-07-03  7:16 Jesper Juhl
  2011-07-03 12:37 ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Jesper Juhl @ 2011-07-03  7:16 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Hellstrom, Alan Cox, Greg Kroah-Hartman, devel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 3097 bytes --]

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gma500: fix compiler warnings and format string
  2011-07-03  7:16 [PATCH] gma500: fix compiler warnings and format string Jesper Juhl
@ 2011-07-03 12:37 ` Alan Cox
  2011-07-04  9:10   ` Jesper Juhl
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2011-07-03 12:37 UTC (permalink / raw)
  To: Jesper Juhl
  Cc: linux-kernel, Thomas Hellstrom, Alan Cox, Greg Kroah-Hartman, devel

On Sun, 3 Jul 2011 09:16:13 +0200 (CEST)
Jesper Juhl <jj@chaosbits.net> wrote:

> 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.

Unfortunately this file doesn't even exist in the working tree any more.
Please wait until Greg has taken the patch set I sent him to replace the
one that didn't apply, and the patch series after that (and quite
possibly the one after that assuming I can get Cedartrail to work next
week).

Alan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gma500: fix compiler warnings and format string
  2011-07-03 12:37 ` Alan Cox
@ 2011-07-04  9:10   ` Jesper Juhl
  0 siblings, 0 replies; 3+ messages in thread
From: Jesper Juhl @ 2011-07-04  9:10 UTC (permalink / raw)
  To: Alan Cox
  Cc: linux-kernel, Thomas Hellstrom, Alan Cox, Greg Kroah-Hartman, devel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1402 bytes --]

On Sun, 3 Jul 2011, Alan Cox wrote:

> On Sun, 3 Jul 2011 09:16:13 +0200 (CEST)
> Jesper Juhl <jj@chaosbits.net> wrote:
> 
> > 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.
> 
> Unfortunately this file doesn't even exist in the working tree any more.
> Please wait until Greg has taken the patch set I sent him to replace the
> one that didn't apply, and the patch series after that (and quite
> possibly the one after that assuming I can get Cedartrail to work next
> week).
> 
Ok. Thank you for the info. I'll leave gma500 alone for a couple of weeks.

-- 
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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-04  9:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-03  7:16 [PATCH] gma500: fix compiler warnings and format string Jesper Juhl
2011-07-03 12:37 ` Alan Cox
2011-07-04  9:10   ` Jesper Juhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®