-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwpthis.h
More file actions
32 lines (23 loc) · 1.12 KB
/
wpthis.h
File metadata and controls
32 lines (23 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#define dmesg printk("wpthis: "); printk
#define get_or_die(target, source) \
target = source; \
if(!target) \
{ \
dmesg("%s = %s == null.\n", #source, #target); \
goto out; \
} \
else if(IS_ERR(target)) \
{ \
dmesg("%s gave us an error for %s: %lu\n", #source, #target, PTR_ERR(target)); \
goto out; \
}
#define print_dev(device) \
dmesg("%s: 0x%.8x (%s)\n", #device, (unsigned int)device, dev_name(device))
#define print_clock(clock) \
dmesg("%s: 0x%.8x (%lu)\n", #clock, (unsigned int)clock, clk_get_rate(clock));
#define assert(eval) \
if(!(eval)) \
{ \
dmesg("assertion failed! !(%s)\n", #eval); \
goto out; \
}