All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/uc: Drop use of MISSING_CASE on trivial enums
@ 2017-03-31 10:26 Michal Wajdeczko
  2017-03-31 12:41 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-03-31 13:42 ` [PATCH] " Chris Wilson
  0 siblings, 2 replies; 4+ messages in thread
From: Michal Wajdeczko @ 2017-03-31 10:26 UTC (permalink / raw)
  To: intel-gfx; +Cc: Jani Nikula

We can rely on compiler to notify us if we miss any case.
This approach may also reduce driver size (reported ~4K).

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_uc.h | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_uc.h b/drivers/gpu/drm/i915/intel_uc.h
index d2dcde7..4b7f73a 100644
--- a/drivers/gpu/drm/i915/intel_uc.h
+++ b/drivers/gpu/drm/i915/intel_uc.h
@@ -114,10 +114,8 @@ const char *intel_uc_fw_status_repr(enum intel_uc_fw_status status)
 		return "PENDING";
 	case INTEL_UC_FIRMWARE_SUCCESS:
 		return "SUCCESS";
-	default:
-		MISSING_CASE(status);
-		return "<invalid>";
 	}
+	return "<invalid>";
 }
 
 enum intel_uc_fw_type {
@@ -133,10 +131,8 @@ static inline const char *intel_uc_fw_type_repr(enum intel_uc_fw_type type)
 		return "GuC";
 	case INTEL_UC_FW_TYPE_HUC:
 		return "HuC";
-	default:
-		MISSING_CASE(type);
-		return "<invalid>";
 	}
+	return "uC";
 }
 
 /*
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915/uc: Drop use of MISSING_CASE on trivial enums
  2017-03-31 10:26 [PATCH] drm/i915/uc: Drop use of MISSING_CASE on trivial enums Michal Wajdeczko
@ 2017-03-31 12:41 ` Patchwork
  2017-03-31 20:12   ` Chris Wilson
  2017-03-31 13:42 ` [PATCH] " Chris Wilson
  1 sibling, 1 reply; 4+ messages in thread
From: Patchwork @ 2017-03-31 12:41 UTC (permalink / raw)
  To: Michal Wajdeczko; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/uc: Drop use of MISSING_CASE on trivial enums
URL   : https://patchwork.freedesktop.org/series/22274/
State : success

== Summary ==

Series 22274v1 drm/i915/uc: Drop use of MISSING_CASE on trivial enums
https://patchwork.freedesktop.org/api/1.0/series/22274/revisions/1/mbox/

fi-bdw-5557u     total:278  pass:267  dwarn:0   dfail:0   fail:0   skip:11  time: 431s
fi-bdw-gvtdvm    total:278  pass:256  dwarn:8   dfail:0   fail:0   skip:14  time: 429s
fi-bsw-n3050     total:278  pass:239  dwarn:0   dfail:0   fail:0   skip:39  time: 570s
fi-bxt-j4205     total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19  time: 508s
fi-bxt-t5700     total:278  pass:258  dwarn:0   dfail:0   fail:0   skip:20  time: 555s
fi-byt-j1900     total:278  pass:251  dwarn:0   dfail:0   fail:0   skip:27  time: 486s
fi-byt-n2820     total:278  pass:247  dwarn:0   dfail:0   fail:0   skip:31  time: 485s
fi-hsw-4770      total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time: 405s
fi-hsw-4770r     total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time: 411s
fi-ilk-650       total:278  pass:228  dwarn:0   dfail:0   fail:0   skip:50  time: 423s
fi-ivb-3520m     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time: 485s
fi-ivb-3770      total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time: 459s
fi-kbl-7500u     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time: 455s
fi-kbl-7560u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time: 569s
fi-skl-6260u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time: 442s
fi-skl-6700hq    total:278  pass:261  dwarn:0   dfail:0   fail:0   skip:17  time: 572s
fi-skl-6700k     total:278  pass:256  dwarn:4   dfail:0   fail:0   skip:18  time: 454s
fi-skl-6770hq    total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time: 486s
fi-skl-gvtdvm    total:278  pass:265  dwarn:0   dfail:0   fail:0   skip:13  time: 431s
fi-snb-2520m     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time: 532s
fi-snb-2600      total:278  pass:249  dwarn:0   dfail:0   fail:0   skip:29  time: 403s

d083fa23d514574a26bfcf91aa5e1de4e6262cd9 drm-tip: 2017y-03m-31d-11h-25m-25s UTC integration manifest
7f850a7 drm/i915/uc: Drop use of MISSING_CASE on trivial enums

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4371/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915/uc: Drop use of MISSING_CASE on trivial enums
  2017-03-31 10:26 [PATCH] drm/i915/uc: Drop use of MISSING_CASE on trivial enums Michal Wajdeczko
  2017-03-31 12:41 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-03-31 13:42 ` Chris Wilson
  1 sibling, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2017-03-31 13:42 UTC (permalink / raw)
  To: Michal Wajdeczko; +Cc: Jani Nikula, intel-gfx

On Fri, Mar 31, 2017 at 10:26:52AM +0000, Michal Wajdeczko wrote:
> We can rely on compiler to notify us if we miss any case.
> This approach may also reduce driver size (reported ~4K).
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

With the default compile flags,

drivers/gpu/drm/i915/intel_uc.h: In function ‘intel_uc_fw_type_repr’:
drivers/gpu/drm/i915/intel_uc.h:130:2: warning: enumeration value ‘THIS_DOES_NOT_EXIST’ not handled in switch [-Wswitch]
  switch (type) {

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ✓ Fi.CI.BAT: success for drm/i915/uc: Drop use of MISSING_CASE on trivial enums
  2017-03-31 12:41 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-03-31 20:12   ` Chris Wilson
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2017-03-31 20:12 UTC (permalink / raw)
  To: intel-gfx

On Fri, Mar 31, 2017 at 12:41:41PM -0000, Patchwork wrote:
> == Series Details ==
> 
> Series: drm/i915/uc: Drop use of MISSING_CASE on trivial enums
> URL   : https://patchwork.freedesktop.org/series/22274/
> State : success
> 
> == Summary ==
> 
> Series 22274v1 drm/i915/uc: Drop use of MISSING_CASE on trivial enums
> https://patchwork.freedesktop.org/api/1.0/series/22274/revisions/1/mbox/

And pushed. Thanks,
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-31 20:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-31 10:26 [PATCH] drm/i915/uc: Drop use of MISSING_CASE on trivial enums Michal Wajdeczko
2017-03-31 12:41 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-03-31 20:12   ` Chris Wilson
2017-03-31 13:42 ` [PATCH] " Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.