diff options
Diffstat (limited to 'drivers/infiniband/core/uverbs.h')
-rw-r--r-- | drivers/infiniband/core/uverbs.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/infiniband/core/uverbs.h b/drivers/infiniband/core/uverbs.h index bdc842e9faef..a283274a5a09 100644 --- a/drivers/infiniband/core/uverbs.h +++ b/drivers/infiniband/core/uverbs.h | |||
@@ -49,12 +49,20 @@ | |||
49 | 49 | ||
50 | #define INIT_UDATA(udata, ibuf, obuf, ilen, olen) \ | 50 | #define INIT_UDATA(udata, ibuf, obuf, ilen, olen) \ |
51 | do { \ | 51 | do { \ |
52 | (udata)->inbuf = (void __user *) (ibuf); \ | 52 | (udata)->inbuf = (const void __user *) (ibuf); \ |
53 | (udata)->outbuf = (void __user *) (obuf); \ | 53 | (udata)->outbuf = (void __user *) (obuf); \ |
54 | (udata)->inlen = (ilen); \ | 54 | (udata)->inlen = (ilen); \ |
55 | (udata)->outlen = (olen); \ | 55 | (udata)->outlen = (olen); \ |
56 | } while (0) | 56 | } while (0) |
57 | 57 | ||
58 | #define INIT_UDATA_BUF_OR_NULL(udata, ibuf, obuf, ilen, olen) \ | ||
59 | do { \ | ||
60 | (udata)->inbuf = (ilen) ? (const void __user *) (ibuf) : NULL; \ | ||
61 | (udata)->outbuf = (olen) ? (void __user *) (obuf) : NULL; \ | ||
62 | (udata)->inlen = (ilen); \ | ||
63 | (udata)->outlen = (olen); \ | ||
64 | } while (0) | ||
65 | |||
58 | /* | 66 | /* |
59 | * Our lifetime rules for these structs are the following: | 67 | * Our lifetime rules for these structs are the following: |
60 | * | 68 | * |