returns: add a check for __inline_fn
[smatch.git] / validation / sm_check_kunmap.c
blob4b206a8c4a36bd0e733d099cbde7b4cfaca65b6b
1 void something();
3 int kmap(int p);
4 int kunmap(int p);
5 int kmap_atomic(int p);
6 int kunmap_atomic(int p);
8 void func(void)
10 int page;
11 int x;
12 int y;
13 int z;
15 x = kmap(page);
16 kunmap(page);
17 kunmap(x);
18 y = kmap_atomic(z);
19 kunmap_atomic(y);
20 kunmap_atomic(z);
23 * check-name: smatch check kunmap
24 * check-command: smatch -p=kernel sm_check_kunmap.c
26 * check-output-start
27 sm_check_kunmap.c:17 func() warn: passing the wrong stuff kunmap()
28 sm_check_kunmap.c:20 func() warn: passing the wrong stuff to kmap_atomic()
29 * check-output-end