[Intel-gfx] [PATCH 2/5] drm/i915/uc: Add intel_uc_fw_type_repr()

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Tue Mar 28 07:07:56 UTC 2017


On ma, 2017-03-27 at 17:20 +0000, Michal Wajdeczko wrote:
> Some of the DRM_NOTE messages are just using "uC" without specifying
> which uc they are related to. We can be more user friendly.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
> Cc: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

<SNIP>

> @@ -44,6 +44,19 @@ const char *intel_uc_fw_status_repr(enum intel_uc_fw_status status)
>  	}
>  }
>  
> +/* User-friendly representation of an enum */
> +const char *intel_uc_fw_type_repr(enum intel_uc_fw_type status)

This could too, be in the header.

> +{
> +	switch (status) {
> +	case INTEL_UC_FW_TYPE_GUC:
> +		return "GuC";
> +	case INTEL_UC_FW_TYPE_HUC:
> +		return "HuC";
> +	default:

Add MISSING_CASE(status) and this is;

Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

> +		return "<invalid>";
> +	}
> +}

<SNIP>
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the Intel-gfx mailing list