An earlier version of the next patch had a bug that this test catches. Signed-off-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx> --- validation/context-named.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) --- sparse.orig/validation/context-named.c 2008-04-10 14:57:26.000000000 +0200 +++ sparse/validation/context-named.c 2008-04-10 15:23:16.000000000 +0200 @@ -465,6 +465,27 @@ static void warn_exact_fn2(void) r2(); } +#define __acquire(x) __context__(x,1) +#define __release(x) __context__(x,-1) + +#define rl() \ + do { __acquire(RCU); } while (0) + +#define ru() \ + do { __release(RCU); } while (0) + +static void good_mixed_with_if(void) +{ + rl(); + + if (condition) { + a(); + r(); + } + + ru(); +} + /* * check-name: Check -Wcontext with lock names * -- -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html