]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gvt: Remove typedef and let the enumeration starts from zero
authorAleksei Gimbitskii <aleksei.gimbitskii@intel.com>
Tue, 23 Apr 2019 12:04:08 +0000 (15:04 +0300)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Thu, 25 Apr 2019 07:32:10 +0000 (15:32 +0800)
commit672d32e0b5101f300d78e226b9e2e994a452a3d2
treee12f4c946a9676515368c98099f399a4cb65dad0
parenta37bdf518e022c29e94542ae838ab8d61a4ed1d0
drm/i915/gvt: Remove typedef and let the enumeration starts from zero

Typedef is not recommended in the Linux kernel.The klocwork static code
analyzer takes the enumeration as the full range of intel_gvt_gtt_type_t.
But the intel_gvt_gtt_type_t will never be used in full range. For
example, the GTT_TYPE_INVALID will never be used as an index of an array.
Remove the typedef and let the enumeration starts from zero to pass
klocwork analysis.

This patch fixed the critial issues #483, #551, #665 reported by
klockwork.

v3:
- Remove the typedef and let the enumeration starts from zero.

Signed-off-by: Aleksei Gimbitskii <aleksei.gimbitskii@intel.com>
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: Zhi Wang <zhi.a.wang@intel.com>
CC: Colin Xu <colin.xu@intel.com>
Reviewed-by: Colin Xu <colin.xu@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/gtt.c
drivers/gpu/drm/i915/gvt/gtt.h
drivers/gpu/drm/i915/gvt/handlers.c
drivers/gpu/drm/i915/gvt/scheduler.c