]> git.baikalelectronics.ru Git - kernel.git/commit
IB/uverbs: clean up INIT_UDATA() macro usage
authorArnd Bergmann <arnd@arndb.de>
Wed, 6 Sep 2017 21:34:26 +0000 (23:34 +0200)
committerDoug Ledford <dledford@redhat.com>
Wed, 27 Sep 2017 12:54:19 +0000 (08:54 -0400)
commit5c737c8d0e4273e5eb36cd50cad20d7ffd440db3
tree4d59b97985094f95b2a18fb2ce5e22759155f606
parent5ce9f5916201964a195562651c995bba9a1f39d7
IB/uverbs: clean up INIT_UDATA() macro usage

After changing INIT_UDATA_BUF_OR_NULL() to an inline function,
this does the same change to INIT_UDATA for consistency.
I'm keeping it separate as this part is much larger and
we wouldn't want to backport this to stable kernels if we
ever want to address the gcc warnings by backporting the
first patch.

Again, using an inline function gives us better type
safety here among other issues with macros. I'm using
u64_to_user_ptr() to convert the user pointer to simplify
the logic rather than adding lots of new type casts.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/uverbs.h
drivers/infiniband/core/uverbs_cmd.c