Commit 309243ec14fde1149e1c66f19746e239e86caf39

Authored by Yann Droneaud
Committed by Roland Dreier
1 parent 374b105797

IB/core: const'ify inbuf in struct ib_udata

Userspace input buffer is not modified by kernel, so it can be 'const'.

This is also a prerequisite to remove the implicit cast
from INIT_UDATA().

Link: http://marc.info/?i=cover.1386798254.git.ydroneaud@opteya.com>
Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>

Showing 2 changed files with 2 additions and 2 deletions Side-by-side Diff

drivers/infiniband/core/uverbs.h
... ... @@ -49,7 +49,7 @@
49 49  
50 50 #define INIT_UDATA(udata, ibuf, obuf, ilen, olen) \
51 51 do { \
52   - (udata)->inbuf = (void __user *) (ibuf); \
  52 + (udata)->inbuf = (const void __user *) (ibuf); \
53 53 (udata)->outbuf = (void __user *) (obuf); \
54 54 (udata)->inlen = (ilen); \
55 55 (udata)->outlen = (olen); \
include/rdma/ib_verbs.h
... ... @@ -978,7 +978,7 @@
978 978 };
979 979  
980 980 struct ib_udata {
981   - void __user *inbuf;
  981 + const void __user *inbuf;
982 982 void __user *outbuf;
983 983 size_t inlen;
984 984 size_t outlen;