Re: [PATCH 1/3] Maple bus support for the Sega Dreamcast

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Adrian McMenamin <lkmladrian@...>
Cc: Paul Mundt <lethal@...>, <linuxsh-dev@...>, <linux-kernel@...>
Date: Sunday, September 9, 2007 - 2:28 pm

On Sun, 9 Sep 2007 17:46:54 +0100
"Adrian McMenamin" <lkmladrian@gmail.com> wrote:


Hi,

in general the code looks clean; great job on that.
A few suggestions and comments to hopefully help this driver to become
even better:

First of all, I'm a little concerned about the lack of locking that
this driver seems to have; what guarantees the integrity of the lists
used in the driver?

Second, you have a lot of use of likely() and unlikely(); so much that I think it's waaaay overkill. The code it's in generally isn't hotpath, and gcc also does a pretty decent job without giving these hints in general.




for example this list.. what makes sure that no 2 pieces of code muck with it at the same time?





this unlikely isn't needed; gcc basically assumes that NULL pointer checks are unlikely anyway...




this is I think a small bug; it is for sure unsafe against jiffies wrapping... please consider using the time_before() and time_after() helpers which will make this comparison safe wrt jiffies wrapping. The same is true for all other jiffies use in the driver...



I wonder if you want to at least check if the work was really for you before returning IRQ_HANDLED....
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/3] Maple bus support for the Sega Dreamcast, Adrian McMenamin, (Sun Sep 9, 12:46 pm)
Re: [PATCH 1/3] Maple bus support for the Sega Dreamcast, Arjan van de Ven, (Sun Sep 9, 2:28 pm)
Re: [PATCH 1/3] Maple bus support for the Sega Dreamcast, Adrian McMenamin, (Sun Sep 9, 2:36 pm)
Re: [PATCH 1/3] Maple bus support for the Sega Dreamcast, Arjan van de Ven, (Sun Sep 9, 2:44 pm)