drm/i915/gvt: removed unnecessary boundary check
authorXinyun Liu <xinyun.liu@intel.com>
Thu, 7 Jun 2018 14:48:41 +0000 (22:48 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Mon, 11 Jun 2018 07:04:32 +0000 (15:04 +0800)
type is already checked in the function entry. So it is unnecessary
to check it again.

Signed-off-by: Xinyun Liu <xinyun.liu@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/gtt.c

index 78e55aa..49400ab 100644 (file)
@@ -1972,7 +1972,7 @@ static int alloc_scratch_pages(struct intel_vgpu *vgpu,
         * GTT_TYPE_PPGTT_PDE_PT level pt, that means this scratch_pt it self
         * is GTT_TYPE_PPGTT_PTE_PT, and full filled by scratch page mfn.
         */
-       if (type > GTT_TYPE_PPGTT_PTE_PT && type < GTT_TYPE_MAX) {
+       if (type > GTT_TYPE_PPGTT_PTE_PT) {
                struct intel_gvt_gtt_entry se;
 
                memset(&se, 0, sizeof(struct intel_gvt_gtt_entry));