[lkml]   [2011]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRE: [PATCH v6 1/1] PRUSS UIO driver support
On Wed, 2 Mar 2011, TK, Pratheesh Gangadhar wrote:

> Hi,
> > -----Original Message-----
> > From: Hans J. Koch []
> > Sent: Wednesday, March 02, 2011 12:04 AM
> > To: TK, Pratheesh Gangadhar
> > Cc: Hans J. Koch;;;
> >;;; Chatterjee, Amit;
> >; linux-arm-
> >
> > Subject: Re: [PATCH v6 1/1] PRUSS UIO driver support

Sigh, can you please use a mailer which does not repeat the headers
for no value and just has a single line like this:

> > On Tue, Mar 01, 2011 at 10:15:27AM +0530, TK, Pratheesh Gangadhar wrote:
> > Anyway, please don't use that kind of argumentation. The next newbie
> > developer might copy your work as a basis for his new driver, and there
> > it probably won't work.
> >
> > Simply put the spin_lock_init before the loop.
> >
> Agree, will fix this in next version.

As I said before, we want stuff initialized when it is possibly
used. But first of all we ant people to use the proper mechanisms to
achive that.

If that's a module global lock then it needs to be instantiated by

static DEFINE_SPINLOCK(lock);

which implies the initialization of the lock.

If it's a lock which is in allocated memory then the


wants to be before it can be possibly used.

So in your case DEFINE_SPINLOCK is the correct solution.



 \ /
  Last update: 2011-03-01 23:17    [W:0.116 / U:5.900 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site