diff mbox series

[v4,1/6] drm/xe: Add XE_MISSING_CASE macro

Message ID 20230904182258.2291881-2-badal.nilawar@intel.com (mailing list archive)
State Handled Elsewhere
Headers show
Series Add HWMON support for DGFX | expand

Commit Message

Nilawar, Badal Sept. 4, 2023, 6:22 p.m. UTC
Add XE_MISSING_CASE macro to handle missing switch case

Cc: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Badal Nilawar <badal.nilawar@intel.com>
---
 drivers/gpu/drm/xe/xe_macros.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Nilawar, Badal Sept. 6, 2023, 11:13 a.m. UTC | #1
Hi Andi

On 04-09-2023 23:52, Badal Nilawar wrote:
> Add XE_MISSING_CASE macro to handle missing switch case
> 
> Cc: Andi Shyti <andi.shyti@linux.intel.com>
> Signed-off-by: Badal Nilawar <badal.nilawar@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_macros.h | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_macros.h b/drivers/gpu/drm/xe/xe_macros.h
> index daf56c846d03..21ba859d5f80 100644
> --- a/drivers/gpu/drm/xe/xe_macros.h
> +++ b/drivers/gpu/drm/xe/xe_macros.h
> @@ -15,4 +15,7 @@
>   			    "Ioctl argument check failed at %s:%d: %s", \
>   			    __FILE__, __LINE__, #cond), 1))
>   
> +#define XE_MISSING_CASE(x) WARN(1, "Missing case (%s == %ld)\n", \
> +				__stringify(x), (long)(x))
You suggested to reuse MISSING_CASE from i915 but I couldn't find common 
place to move it so defined new macro.

Regards,
Badal
> +
>   #endif
diff mbox series

Patch

diff --git a/drivers/gpu/drm/xe/xe_macros.h b/drivers/gpu/drm/xe/xe_macros.h
index daf56c846d03..21ba859d5f80 100644
--- a/drivers/gpu/drm/xe/xe_macros.h
+++ b/drivers/gpu/drm/xe/xe_macros.h
@@ -15,4 +15,7 @@ 
 			    "Ioctl argument check failed at %s:%d: %s", \
 			    __FILE__, __LINE__, #cond), 1))
 
+#define XE_MISSING_CASE(x) WARN(1, "Missing case (%s == %ld)\n", \
+				__stringify(x), (long)(x))
+
 #endif