Re: [PATCH 1/2 v2] Driver for Freescale 8610 and 5121 DIU

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: York Sun <yorksun@...>
Cc: <linux-kernel@...>, <linuxppc-dev@...>, <galak@...>, <linux-fbdev-devel@...>, <yorksun@...>, <timur@...>, Peter Zijlstra <a.p.zijlstra@...>
Date: Thursday, March 20, 2008 - 6:27 pm

On Wed, 19 Mar 2008 13:50:26 -0500
York Sun <yorksun@freescale.com> wrote:


I'm not clear on what's supposed to happen with __SPIN_LOCK_UNLOCKED().  I
do know that its documentation is crap.

I guess you should have used SPIN_LOCK_UNLOCKED there rather than
open-coding its equivalent.  And SPIN_LOCK_UNLOCKED _is_ documented.  It
says "don't use this".

Now, s/documentation/guesswork-and-grep/ says that you're supposed to pick
a tree-wide-unique string here as your lockdep key.

So I did this:

--- a/drivers/video/fsl-diu-fb.c~fbdev-driver-for-freescale-8610-and-5121-diu-fix
+++ a/drivers/video/fsl-diu-fb.c
@@ -274,7 +274,7 @@ static struct mfb_info mfb_template[] = 
 
 static struct diu_hw dr = {
 	.mode = MFB_MODE1,
-	.reg_lock = __SPIN_LOCK_UNLOCKED(old_style_spin_init),
+	.reg_lock = __SPIN_LOCK_UNLOCKED(diu_hw.reg_lock),
 };
 
 static struct diu_pool pool;


GFP_DMA implies GFP_ATOMIC, but it's appropriate for documentation purposes.


Could have used __GFP_ZERO, I guess.


hm, I'd have expected checkpatch to whine about the space after the cast
there.  Whatever.

checkpatch does turn up some significant problems:

WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h>
#205: FILE: drivers/video/fsl-diu-fb.c:32:
+#include <asm/uaccess.h>

WARNING: consider using strict_strtoul in preference to simple_strtoul
#1599: FILE: drivers/video/fsl-diu-fb.c:1426:
+       val = simple_strtoul(buf, last, 0);

WARNING: consider using strict_strtoul in preference to simple_strtoul
#1821: FILE: drivers/video/fsl-diu-fb.c:1648:
+                       val = simple_strtoul(opt + 8, NULL, 0);

WARNING: consider using strict_strtoul in preference to simple_strtoul
#1825: FILE: drivers/video/fsl-diu-fb.c:1652:
+                       default_bpp = simple_strtoul(opt + 4, NULL, 0);


please take a look, and please use checkpatch on all future patches.


Like this:

static int fsl_diu_check_var(struct fb_var_screeninfo *var,
				struct fb_info *info)

please.


we already did that at compile-time?


The request_irq() return value gets dropped on the floor.


and the free_irq() will go splat?


Conventionally we'll do

#else
#define fsl_diu_suspend NULL
#define fsl_diu_resume NULL

here, then remove the ifdefs from fsl_diu_driver.


__GFP_ZERO?


Please use ARRAY_SIZE() here, and in all the other places which open-code
it.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
v2 patch for Freescale DIU driver, York Sun, (Wed Mar 19, 2:50 pm)
Re: [PATCH 1/2 v2] Driver for Freescale 8610 and 5121 DIU, Andrew Morton, (Thu Mar 20, 6:27 pm)
Re: [PATCH 1/2 v2] Driver for Freescale 8610 and 5121 DIU, Andrew Morton, (Fri Mar 21, 2:12 pm)
Re: [PATCH 1/2 v2] Driver for Freescale 8610 and 5121 DIU, Andrew Morton, (Mon Mar 24, 2:47 pm)
Re: [PATCH 1/2 v2] Driver for Freescale 8610 and 5121 DIU, Peter Zijlstra, (Thu Mar 20, 7:02 pm)
Re: [PATCH 2/2 v2] Add DIU platform code for MPC8610HPCD, Andrew Morton, (Thu Mar 20, 6:33 pm)
Re: [PATCH 2/2 v2] Add DIU platform code for MPC8610HPCD, Andy Whitcroft, (Tue Mar 25, 8:43 am)
Re: [PATCH 2/2 v2] Add DIU platform code for MPC8610HPCD, Andrew Morton, (Tue Mar 25, 3:18 pm)