cxl/mbox: Move cxl_mem_command construction to helper funcs
authorAlison Schofield <alison.schofield@intel.com>
Thu, 31 Mar 2022 01:27:11 +0000 (18:27 -0700)
committerDan Williams <dan.j.williams@intel.com>
Tue, 12 Apr 2022 23:07:00 +0000 (16:07 -0700)
commit6dd0e5cc87b33aee9cfe4d485c4d8b8382701558
tree52748b66f2c77de4d011decb96951e2cfe469dc1
parentce522ba9ef7e2d9fb22a39eb3371c0c64e2a433e
cxl/mbox: Move cxl_mem_command construction to helper funcs

Sanitizing and constructing a cxl_mem_command from a userspace
command is part of the validation process prior to submitting
the command to a CXL device. Move this work to helper functions:
cxl_to_mem_cmd(), cxl_to_mem_cmd_raw().

This declutters cxl_validate_cmd_from_user() in preparation for
adding new validation steps.

Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Link: https://lore.kernel.org/r/7d9b826f29262e3a484cb4bb7b63872134d60bd7.1648687552.git.alison.schofield@intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core/mbox.c