lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 1 Mar 2011 22:38:10 +0100 (CET)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	"TK, Pratheesh Gangadhar" <pratheesh@...com>
cc:	"Hans J. Koch" <hjk@...sjkoch.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"gregkh@...e.de" <gregkh@...e.de>,
	"sshtylyov@...sta.com" <sshtylyov@...sta.com>,
	"arnd@...db.de" <arnd@...db.de>,
	"Chatterjee, Amit" <amit.chatterjee@...com>,
	"davinci-linux-open-source@...ux.davincidsp.com" 
	<davinci-linux-open-source@...ux.davincidsp.com>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: RE: [PATCH v6 1/1] PRUSS UIO driver support

On Wed, 2 Mar 2011, TK, Pratheesh Gangadhar wrote:

> Hi,
> > -----Original Message-----
> > From: Hans J. Koch [mailto:hjk@...sjkoch.de]
> > Sent: Wednesday, March 02, 2011 12:04 AM
> > To: TK, Pratheesh Gangadhar
> > Cc: Hans J. Koch; linux-kernel@...r.kernel.org; gregkh@...e.de;
> > tglx@...utronix.de; sshtylyov@...sta.com; arnd@...db.de; Chatterjee, Amit;
> > davinci-linux-open-source@...ux.davincidsp.com; linux-arm-
> > kernel@...ts.infradead.org
> > 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

   spin_lock_init(&lock);

wants to be before it can be possibly used.

So in your case DEFINE_SPINLOCK is the correct solution.

Thanks,

	tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ