m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/util.h
blob: 7a64462c0b4312c2638dd23b660e5185d1daa826 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef UTIL_H
#define UTIL_H

#define ORFAIL(cond, label) \
({ \
	err = (cond); \
	if (err < 0) { \
		goto label; \
	} \
})

#define ORFAIL_PTR(ptr, label) \
({ \
	if (IS_ERR(ptr)) { \
		err = PTR_ERR(ptr); \
		goto label; \
	} \
})
	

#endif