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

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

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

#endif