[PATCH 4/3] inlined call bugfix & test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch fixes an oversight in my other patches, inlined
calls weren't checked for context properly. Also adds a test
case for this.

Signed-off-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>
---
I'll roll this into the other patches if wanted.

 sparse.c                   |    1 +
 validation/context-named.c |   12 ++++++++++++
 2 files changed, 13 insertions(+)

--- sparse.orig/sparse.c	2008-04-11 12:42:49.000000000 +0200
+++ sparse/sparse.c	2008-04-11 12:43:44.000000000 +0200
@@ -137,6 +137,7 @@ static int check_bb_context(struct entry
 		if (!insn->bb)
 			continue;
 		switch (insn->opcode) {
+		case OP_INLINED_CALL:
 		case OP_CALL:
 			if (!insn->func || !insn->func->sym || insn->func->type != PSEUDO_SYM)
 				break;
--- sparse.orig/validation/context-named.c	2008-04-11 12:42:49.000000000 +0200
+++ sparse/validation/context-named.c	2008-04-11 12:46:36.000000000 +0200
@@ -465,6 +465,17 @@ static void warn_exact_fn2(void)
     r2();
 }
 
+static inline void need_lock3(void) __attribute__((context(TEST,1,1)))
+{
+}
+
+static void warn_fn3(void)
+{
+    a2();
+    need_lock3();
+    r2();
+}
+
 #define __acquire(x)	__context__(x,1)
 #define __release(x)	__context__(x,-1)
 
@@ -513,5 +524,6 @@ context-named.c:434:14: warning: context
 context-named.c:441:15: warning: context problem in 'warn_fn2' - function 'need_lock2' expected different context
 context-named.c:456:20: warning: context problem in 'warn_exact_fn1' - function 'need_lock_exact' expected different context
 context-named.c:464:20: warning: context problem in 'warn_exact_fn2' - function 'need_lock_exact' expected different context
+context-named.c:475:15: warning: context problem in 'warn_fn3' - function 'need_lock3' expected different context
  * check-error-end
  */


--
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

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux