From: Peter Zijlstra on 10 Jun 2010 08:40 On Wed, 2010-06-09 at 17:39 -0400, Jason Baron wrote: > -#define JUMP_LABEL(tag, label, cond) \ > +#define JUMP_LABEL(key, label) \ > do { \ > - if (unlikely(cond)) \ > + if (unlikely(*key)) \ > goto label; \ > } while (0) s/key/cond_var/ or something like that? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Peter Zijlstra on 10 Jun 2010 08:50 On Wed, 2010-06-09 at 17:39 -0400, Jason Baron wrote: > -static inline int enable_jump_label(const char *name) > -{ > - return 0; > -} > - > -static inline int disable_jump_label(const char *name) > -{ > - return 0; > -} > +#define enable_jump_label(key) > +#define disable_jump_label(key) I would expect enable_jump_label() to look something like: #define enable_jump_label(cond_var) \ do { \ *(cond_var) = 1; \ } while (0) That way the HAVE_JUMP_LABEL and !HAVE_JUMP_LABEL code has similar effects. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Jason Baron on 10 Jun 2010 10:00 On Thu, Jun 10, 2010 at 02:43:46PM +0200, Peter Zijlstra wrote: > On Wed, 2010-06-09 at 17:39 -0400, Jason Baron wrote: > > -static inline int enable_jump_label(const char *name) > > -{ > > - return 0; > > -} > > - > > -static inline int disable_jump_label(const char *name) > > -{ > > - return 0; > > -} > > +#define enable_jump_label(key) > > +#define disable_jump_label(key) > > I would expect enable_jump_label() to look something like: > > #define enable_jump_label(cond_var) \ > do { \ > *(cond_var) = 1; \ > } while (0) > > That way the HAVE_JUMP_LABEL and !HAVE_JUMP_LABEL code has similar > effects. right. I was going to clean that up in a followup. But you are right - I think it makes the code much clearer. will fix. thanks, -Jason -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Peter Zijlstra on 10 Jun 2010 10:50 On Thu, 2010-06-10 at 09:57 -0400, Jason Baron wrote: > right. I was going to clean that up in a followup. But you are right - I > think it makes the code much clearer. will fix. Please fold this patch into the previous patches. That makes the series much more readable. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|
Pages: 1 Prev: jump label v9: tracepoint support Next: fsfreeze: fix sb vs bdev freeze/thaw b0rkage |