Skip to contentSkip to conversation

drm/i915/uc: Drop use of MISSING_CASE on trivial enums

PATCH In review Michal Wajdeczko 3 participants 4 messages Mar 31, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915/uc: Drop use of MISSING_CASE on trivial enums

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

Cc Chris Wilson <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Joonas Lahtinen <[email protected]>
---
 drivers/gpu/drm/i915/intel_uc.h | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_uc.h +2 -6
index d2dcde7..4b7f73a 100644
@@ -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";
 }
 
 /*
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✓ Fi.CI.BAT: success for drm/i915/uc: Drop use of MISSING_CASE on trivial enums

== Series Details ==

== 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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

Re: ✓ Fi.CI.BAT: success for drm/i915/uc: Drop use of MISSING_CASE on trivial enums

Quoted 10 lines · Patchwork

== 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

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#3 lore raw
In reply to Michal Wajdeczko
Quoted 7 lines · Michal Wajdeczko

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

Cc Chris Wilson <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Joonas Lahtinen <[email protected]>

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) {

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx