]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gvt: replace idr_init() by idr_init_base()
authorDeepak R Varma <mh12gx2825@gmail.com>
Wed, 4 Nov 2020 12:15:32 +0000 (17:45 +0530)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Wed, 11 Nov 2020 02:30:07 +0000 (10:30 +0800)
commit7406cb1a5dddc7b05d8f2fa2de0e11adc6058564
tree37a8d160bd16f2f58f141f8cca4ace5230632aff
parent4dc4ca5185b9b3016fdc12396b1a3ca3dfa7464b
drm/i915/gvt: replace idr_init() by idr_init_base()

idr_init() uses base 0 which is an invalid identifier. The new function
idr_init_base allows IDR to set the ID lookup from base 1. This avoids
all lookups that otherwise starts from 0 since 0 is always unused.

References: commit 3c95a175db44 ("idr: Make 1-based IDRs more efficient")

Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20201104121532.GA48202@localhost
drivers/gpu/drm/i915/gvt/gvt.c
drivers/gpu/drm/i915/gvt/vgpu.c