]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gvt: treat intel_gvt_mpt as const in gvt code
authorJulian Stecklina <julian.stecklina@cyberus-technology.de>
Wed, 11 Nov 2020 17:28:11 +0000 (18:28 +0100)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Mon, 23 Nov 2020 09:14:20 +0000 (17:14 +0800)
commitb840e69a6d9629359a03233e998da5b3392bf926
tree54699e6407aab1571da04a326a1e851a675322fc
parentafdb1ccbe5bd95e4afb2bdfa7c7e74e2d4c23b30
drm/i915/gvt: treat intel_gvt_mpt as const in gvt code

The current interface of intel_gvt_register_hypervisor() expects a
non-const pointer to struct intel_gvt_mpt, even though the mediator
never modifies (or should modifiy) the content of this struct.

Change the function signature and relevant struct members to const to
properly express the API's intent and allow instances of intel_gvt_mpt
to be allocated as const.

While I was here, I also made KVM's instance of this struct const to
reduce the number of writable function pointers in the kernel.

Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: intel-gvt-dev@lists.freedesktop.org
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Julian Stecklina <julian.stecklina@cyberus-technology.de>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20201111172811.558443-1-julian.stecklina@cyberus-technology.de
drivers/gpu/drm/i915/gvt/gvt.c
drivers/gpu/drm/i915/gvt/gvt.h
drivers/gpu/drm/i915/gvt/kvmgt.c
drivers/gpu/drm/i915/gvt/mpt.h