On Saturday 21 March 2009 13:54:39 Johannes Berg wrote: > On Sat, 2009-03-21 at 13:49 +0100, Michael Buesch wrote: > > > > > Well I think it would currently generate lots of errors, because we have > > > > code like this in the kernel: > > > > > > > > if (x) > > > > mutex_lock(); > > > > ... > > > > if (x) > > > > mutex_unlock(); > > > > > > That's sloppy code anyway. Not to be encouraged. > > > > That's not true. Sometimes it is the cleanest way to do things. > > Look at drivers/ssb/main.c. To make this mutex-sparse compliant, we'd > > need to introduce quite a few sub-functions. > > > > It simply is a limitation of sparse. Nothing else. > > No, I still think it's sloppy code; Patches that change the code into code with _better_ style are accepted. However, I don't think introducing more foo(); calls __foo(); style stuff is better. It's just a workaround to sparse. > some future work will in most cases > invariably move the conditions further apart, at which point it becomes > more and more unlikely that the invariant that the "x" doesn't change > inbetween is maintained. Did you look at the example I gave? -- Greetings, Michael. -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html