[Intel-gfx] [bug report] drm/i915: Introduce concept of a sub-platform

Dan Carpenter dan.carpenter at oracle.com
Wed Apr 3 05:58:40 UTC 2019


Hello Tvrtko Ursulin,

The patch 805446c8347c: "drm/i915: Introduce concept of a
sub-platform" from Mar 27, 2019, leads to the following static
checker warning:

	drivers/gpu/drm/i915/intel_device_info.c:807 intel_device_info_subplatform_init()
	error: uninitialized symbol 'mask'.

drivers/gpu/drm/i915/intel_device_info.c
    774 void intel_device_info_subplatform_init(struct drm_i915_private *i915)
    775 {
    776 	const struct intel_device_info *info = INTEL_INFO(i915);
    777 	const struct intel_runtime_info *rinfo = RUNTIME_INFO(i915);
    778 	const unsigned int pi = __platform_mask_index(rinfo, info->platform);
    779 	const unsigned int pb = __platform_mask_bit(rinfo, info->platform);
    780 	u16 devid = INTEL_DEVID(i915);
    781 	u32 mask;
    782 
    783 	/* Make sure IS_<platform> checks are working. */
    784 	RUNTIME_INFO(i915)->platform_mask[pi] = BIT(pb);
    785 
    786 	/* Find and mark subplatform bits based on the PCI device id. */
    787 	if (find_devid(devid, subplatform_ult_ids,
    788 		       ARRAY_SIZE(subplatform_ult_ids))) {
    789 		mask = BIT(INTEL_SUBPLATFORM_ULT);
    790 	} else if (find_devid(devid, subplatform_ulx_ids,
    791 			      ARRAY_SIZE(subplatform_ulx_ids))) {
    792 		mask = BIT(INTEL_SUBPLATFORM_ULX);
    793 		if (IS_HASWELL(i915) || IS_BROADWELL(i915)) {
    794 			/* ULX machines are also considered ULT. */
    795 			mask |= BIT(INTEL_SUBPLATFORM_ULT);
    796 		}
    797 	} else if (find_devid(devid, subplatform_aml_ids,
    798 			      ARRAY_SIZE(subplatform_aml_ids))) {
    799 		mask = BIT(INTEL_SUBPLATFORM_AML);
    800 	} else if (find_devid(devid, subplatform_portf_ids,
    801 			      ARRAY_SIZE(subplatform_portf_ids))) {
    802 		mask = BIT(INTEL_SUBPLATFORM_PORTF);
    803 	}

No else statement

    804 
    805 	GEM_BUG_ON(mask & ~INTEL_SUBPLATFORM_BITS);
    806 
--> 807 	RUNTIME_INFO(i915)->platform_mask[pi] |= mask;
                                                         ^^^^

    808 }

regards,
dan carpenter


More information about the Intel-gfx mailing list