Skip to content

Commit

Permalink
IB/core: const'ify inbuf in struct ib_udata
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yann Droneaud authored and Roland Dreier committed Dec 16, 2013
1 parent 374b105 commit 309243e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/infiniband/core/uverbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

#define INIT_UDATA(udata, ibuf, obuf, ilen, olen) \
do { \
(udata)->inbuf = (void __user *) (ibuf); \
(udata)->inbuf = (const void __user *) (ibuf); \
(udata)->outbuf = (void __user *) (obuf); \
(udata)->inlen = (ilen); \
(udata)->outlen = (olen); \
Expand Down
2 changes: 1 addition & 1 deletion include/rdma/ib_verbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ struct ib_uobject {
};

struct ib_udata {
void __user *inbuf;
const void __user *inbuf;
void __user *outbuf;
size_t inlen;
size_t outlen;
Expand Down

0 comments on commit 309243e

Please sign in to comment.