ARM: pmu: add support for interrupt-affinity property
[linux/fpc-iii.git] / drivers / gpu / drm / nouveau / include / nvif / unpack.h
blob5933188b4a77f8a01a5b206dc3dc14c2a75f1321
1 #ifndef __NVIF_UNPACK_H__
2 #define __NVIF_UNPACK_H__
4 #define nvif_unvers(d) ({ \
5 ret = (size == sizeof(d)) ? 0 : -ENOSYS; \
6 (ret == 0); \
7 })
9 #define nvif_unpack(d,vl,vh,m) ({ \
10 if ((vl) == 0 || ret == -ENOSYS) { \
11 int _size = sizeof(d); \
12 if (_size <= size && (d).version >= (vl) && \
13 (d).version <= (vh)) { \
14 data = (u8 *)data + _size; \
15 size = size - _size; \
16 ret = ((m) || !size) ? 0 : -E2BIG; \
17 } else { \
18 ret = -ENOSYS; \
19 } \
20 } \
21 (ret == 0); \
24 #endif