forked from Minki/linux
c39f472e9f
The symlinks were annoying some people, and they're not used anywhere else in the kernel tree. The include directory structure has been changed so that symlinks aren't needed anymore. NVKM has been moved from core/ to nvkm/ to make it more obvious as to what the directory is for, and as some minor prep for when NVKM gets split out into its own module (virt) at a later date. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
25 lines
1.1 KiB
C
25 lines
1.1 KiB
C
#ifndef __NVIF_UNPACK_H__
|
|
#define __NVIF_UNPACK_H__
|
|
|
|
#define nvif_unvers(d) ({ \
|
|
ret = (size == sizeof(d)) ? 0 : -ENOSYS; \
|
|
(ret == 0); \
|
|
})
|
|
|
|
#define nvif_unpack(d,vl,vh,m) ({ \
|
|
if ((vl) == 0 || ret == -ENOSYS) { \
|
|
int _size = sizeof(d); \
|
|
if (_size <= size && (d).version >= (vl) && \
|
|
(d).version <= (vh)) { \
|
|
data = (u8 *)data + _size; \
|
|
size = size - _size; \
|
|
ret = ((m) || !size) ? 0 : -E2BIG; \
|
|
} else { \
|
|
ret = -ENOSYS; \
|
|
} \
|
|
} \
|
|
(ret == 0); \
|
|
})
|
|
|
|
#endif
|