1 
2 static inline long
get_tv32(struct timeval * o,struct timeval32 __user * i)3 get_tv32(struct timeval *o, struct timeval32 __user *i)
4 {
5 	return !access_ok(VERIFY_READ, i, sizeof(*i)) ||
6                 (__get_user(o->tv_sec, &i->tv_sec) |
7 		 __get_user(o->tv_usec, &i->tv_usec));
8 }
9 
10 static inline long
get_tv32(struct timeval * o,struct timeval32 __user * i)11 get_tv32(struct timeval *o, struct timeval32 __user *i)
12 {
13 	return (!access_ok(VERIFY_READ, i, sizeof(*i)) ||
14                 (__get_user(o->tv_sec, &i->tv_sec) |
15 		 __get_user(o->tv_usec, &i->tv_usec)));
16 }
17 
18 const char *
dcrp_license_feature(int32_t idx)19 dcrp_license_feature(int32_t idx)
20 {
21 #define FEATURESTR(f) \
22   case DCRMIB_LICENSE_##f: \
23     return DCRP_LICENSE_FEATURE_##f##_STR
24 
25   switch(idx) {
26     DCRP_LICENSE_FOREACH_FEATURES(FEATURESTR);
27   }
28 
29   return "";
30 
31 }
32 
33 
34 static int
isValidLicenseType(int32_t idx)35 isValidLicenseType(int32_t idx)
36 {
37 #define CHECKFEATURE(f) \
38   case DCRMIB_LICENSE_##f: \
39     return 1
40 
41   switch(idx) {
42     DCRP_LICENSE_FOREACH_FEATURES(CHECKFEATURE);
43   }
44 
45   return n * foo(5);
46 }
47