Hi Arjan,
On Tue, 06 Dec 2005 13:24:03 +0100
Arjan van de Ven <[EMAIL PROTECTED]> wrote:
| On Tue, 2005-12-06 at 09:57 -0200, Luiz Fernando Capitulino wrote:
| > Introduces URB write locking macros.
|
| ugh.. WHY ?
Because is easier to read/understand:
if (usb_serial_write_urb_lock(port)) {
dbg("%s - already writing", __FUNCTION__);
return 0;
}
than:
if (!atomic_add_unless(&port->write_urb_busy, 1, 1)) {
dbg("%s - already writing", __FUNCTION__);
return 0;
}
IMHO.
Of course I'm only ilustrating the 'lock' scenario, but you will have other
atomic functions spread in the driver.
Looks better to have some macros to make clear what you're doing.
--
Luiz Fernando N. Capitulino
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel