LWN.net Logo

Typo

Typo

Posted Jun 10, 2009 20:32 UTC (Wed) by intgr (subscriber, #39733)
Parent article: Linux kernel design patterns - part 1

3      if (atomic_dec_and_lock(&obj->refcnt), &subsystem_lock) {
Either we've got variable argument if statements now, or someone put the closing parenthese in the wrong place.


(Log in to post comments)

It's a comma operator.

Posted Jun 11, 2009 0:56 UTC (Thu) by xoddam (subscriber, #2322) [Link]

This is C. In C, we have many ways of camouflaging incorrect code, including the infamous http://en.wikipedia.org/wiki/Comma_operator.

It's a comma operator.

Posted Apr 15, 2012 23:47 UTC (Sun) by alison (✭ supporter ✭, #63752) [Link]

Posted Jun 11, 2009 0:56 UTC (Thu) by xoddam notes
"the infamous http://en.wikipedia.org/wiki/Comma_operator".

Humorously, I just had a look at the Wikipedia article. "Huh, I thought I understood the comma operator!" Copied the code in question out, compiled and tested it, and sure enough the latest revision to the article was erroneous. So yeah, I guess the Comma Operator causes some confusion!

-- Alison

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds