1 #define __user __attribute__((address_space(1)))
2 
3 typedef __UINTPTR_TYPE__ uintptr_t;
4 typedef unsigned long ulong;
5 typedef struct s obj_t;
6 
expl(ulong u,uintptr_t uip,void * v,obj_t * o,obj_t __user * p)7 static void expl(ulong u, uintptr_t uip, void *v, obj_t *o, obj_t __user *p)
8 {
9 	(obj_t*)(u);
10 	(obj_t __user*)(u);
11 
12 	(obj_t*)(uip);
13 	(obj_t __user*)(uip);
14 
15 	(obj_t*)(v);
16 	(obj_t __user*)(v);
17 
18 	(ulong)(o);
19 	(void *)(o);
20 	(obj_t*)(o);
21 	(obj_t __user*)(o);
22 
23 	(ulong)(p);
24 	(obj_t __user*)(p);
25 
26 }
27 
28 /*
29  * check-name: cast-to-as
30  * check-command: sparse -Wcast-to-as $file
31  *
32  * check-error-start
33 Wcast-to-as.c:16:10: warning: cast adds address space '<asn:1>' to expression
34 Wcast-to-as.c:21:10: warning: cast adds address space '<asn:1>' to expression
35  * check-error-end
36  */
37