isapnp driver semaphore to mutex
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 1 line · Daniel Walker
Changed the isapnp semaphore to a mutex.
cool - i'll give it a whirl.
small immaterial nit:
Quoted 1 line
Signed-off-by Daniel Walker <[email protected]>
it's Signed-off-by (note the capitalization). Having this consistent makes scripting around patches a tiny bit easier.
Ingo
Quoted 4 lines · Ingo Molnar
Quoted 1 line · Daniel Walker
Changed the isapnp semaphore to a mutex.
Quoted 8 lines
cool - i'll give it a whirl.
small immaterial nit:
Quoted 1 line
Signed-off-by Daniel Walker <[email protected]>it's Signed-off-by (note the capitalization). Having this consistent makes scripting around patches a tiny bit easier.
Yeah, I know about it but sometimes still slips by..
Daniel
Quoted 7 lines · Daniel Walker
Quoted 6 lines · Ingo Molnar
Quoted 1 line · Daniel Walker
Changed the isapnp semaphore to a mutex.
cool - i'll give it a whirl.
Quoted 8 lines
Quoted 6 lines
small immaterial nit:
Quoted 1 line
Signed-off-by Daniel Walker <[email protected]>it's Signed-off-by (note the capitalization). Having this consistent makes scripting around patches a tiny bit easier.
Yeah, I know about it but sometimes still slips by..
it's worth automating these repetative bits. I use small templates when creating patches. Also, it's worth running patches through scripts/checkpatch.pl - it has a check for exactly this typo. [ Not a big issue at all, i just mentioned it in case you get a taste for sending more sem2mutex patches :-) ]
Ingo
Quoted 16 lines · Ingo Molnar
Quoted 14 lines · Daniel Walker
Quoted 12 lines · Ingo Molnar
Quoted 1 line · Daniel Walker
Changed the isapnp semaphore to a mutex.
cool - i'll give it a whirl.
small immaterial nit:
Quoted 1 line
Signed-off-by Daniel Walker <[email protected]>it's Signed-off-by (note the capitalization). Having this consistent makes scripting around patches a tiny bit easier.
Quoted 8 lines
Quoted 1 line
Yeah, I know about it but sometimes still slips by..
it's worth automating these repetative bits. I use small templates when creating patches. Also, it's worth running patches through
scripts/checkpatch.pl- it has a check for exactly this typo. [ Not a big issue at all, i just mentioned it in case you get a taste for sending more sem2mutex patches :-) ]
Speaking of automating.. I created a little .vimrc add-on which helps doing sem2mutex type changes. Here's the chunk I added,
function Semtomutex( lo )
exe '%s/down(&'.a:lo.')/mutex_lock\(\&'.a:lo.'\)/g'
exe '%s/down_trylock(&'.a:lo.')/mutex_trylock\(\&'.a:lo.'\)/g'
exe '%s/up(&'.a:lo.')/mutex_unlock\(\&'.a:lo.'\)/g'
exe '%s/DECLARE_MUTEX('.a:lo.')/DEFINE_MUTEX\('.a:lo.'\)/g'
endfunction
map <C-\>o :call Semtomutex("<c-r><c-w>")<CR>I just finished this about 30 seconds ago, and although I tested it once I would guess it might have some bugs.. If you add it to your .vimrc , then you move your cursor over the lock name and hit Ctrl-\-o ,it will convert all the calls for that lock name.. The list of calls it converts isn't complete tho (down, down_trylock, and up) ..
I hope people still review the lock usage tho, since it's critical.
Daniel
Dne Mon, 03 Dec 2007 10:35:01 -0800
Daniel Walker <[email protected]> napsal(a):
Quoted 8 lines
Speaking of automating.. I created a little .vimrc add-on which helps doing sem2mutex type changes. Here's the chunk I added,
function Semtomutex( lo ) exe '%s/down(&'.a:lo.')/mutex_lock\(\&'.a:lo.'\)/g' exe '%s/down_trylock(&'.a:lo.')/mutex_trylock\(\&'.a:lo.'\)/g'From the comment above
mutex_trylock():
* NOTE: this function follows the spin_trylock() convention, so
* it is negated to the down_trylock() return values! Be careful
* about this when converting semaphore users to mutexes.
Michal
Quoted 10 lines · Michal Schmidt
Dne Mon, 03 Dec 2007 10:35:01 -0800
Daniel Walker <[email protected]> napsal(a):Quoted 6 lines
Speaking of automating.. I created a little .vimrc add-on which helps doing sem2mutex type changes. Here's the chunk I added,
function Semtomutex( lo ) exe '%s/down(&'.a:lo.')/mutex_lock\(\&'.a:lo.'\)/g' exe '%s/down_trylock(&'.a:lo.')/mutex_trylock\(\&'.a:lo.'\)/g'
Quoted 6 lines
From the comment above
mutex_trylock():
* NOTE: this function follows thespin_trylock()convention, so
* it is negated to thedown_trylock()return values! Be careful
* about this when converting semaphore users to mutexes.Michal
Thanks, I didn't notice this .. I've only run into one tho..
Daniel
Quoted 16 lines · Ingo Molnar
Quoted 14 lines · Daniel Walker
Quoted 12 lines · Ingo Molnar
Quoted 1 line · Daniel Walker
Changed the isapnp semaphore to a mutex.
cool - i'll give it a whirl.
small immaterial nit:
Quoted 1 line
Signed-off-by Daniel Walker <[email protected]>it's Signed-off-by (note the capitalization). Having this consistent makes scripting around patches a tiny bit easier.
Quoted 7 lines
Quoted 1 line
Yeah, I know about it but sometimes still slips by..
it's worth automating these repetative bits. I use small templates when creating patches. Also, it's worth running patches through
scripts/checkpatch.pl- it has a check for exactly this typo. [ Not a big issue at all, i just mentioned it in case you get a taste for sending more sem2mutex patches :-) ]
These are the patches, and files I've touched so far in case anyone is working on this .. These are all to be submitted.
unix98-semaphore-to-mutex.patch
linux-2.6.23/drivers/char/tty_io.c spi-semaphore-to-mutex.patch linux-2.6.23/drivers/spi/spi.c au1000-semaphore-to-mutex.patch linux-2.6.23/drivers/pcmcia/au1000_generic.c soc_common-semaphore-to-mutex.patch linux-2.6.23/drivers/pcmcia/soc_common.c linux-2.6.23/drivers/pcmcia/soc_common.h qla2xxx-semaphore-to-mutex.patch linux-2.6.23/drivers/scsi/qla2xxx/qla_os.c bcm43xx-semaphore-to-mutex.patch linux-2.6.23/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c adb_handler_sem-to-mutex.patch linux-2.6.23/drivers/macintosh/adb.c
Daniel