On Saturday 21 March 2009 12:34:26 Johannes Berg wrote: > On Sat, 2009-03-21 at 12:20 +0100, Michael Buesch wrote: > > > > > > +#if 0 > > > > > +#include <linux/mutex.h> > > > > > +#define mutex_lock(m) do { mutex_lock(m); __acquire(m); } while (0) > > > > > +#define mutex_unlock(m) do { mutex_unlock(m); __release(m); } while (0) > > > > > +#endif > > > > > + > > > > > +#endif /* __USB_H */ > > > > > > > > Whoops, debugging code? :) > > > > > > sparse, for some reason mutex operations aren't annotated... Probably > > > because Ingo wrote the code... > > > > 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. -- 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