m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/util.h
blob: 8c56f67619303597e2c2cf8ed7bab15ba839bcde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#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