diff mbox

drm/i915: Add a default case in gen7 hwsp switch-case

Message ID 20170829185545.10169-1-michel.thierry@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michel Thierry Aug. 29, 2017, 6:55 p.m. UTC
Gen7 won't get any new engines, and we already added VCS2 there to just
silence gcc's not-handled-in-switch warnings.

Use a default case instead, otherwise we will need to keep adding extra
cases if changes happen in the future.

Signed-off-by: Michel Thierry <michel.thierry@intel.com>
---
 drivers/gpu/drm/i915/intel_ringbuffer.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Chris Wilson Aug. 29, 2017, 7:18 p.m. UTC | #1
Quoting Michel Thierry (2017-08-29 19:55:45)
> Gen7 won't get any new engines, and we already added VCS2 there to just
> silence gcc's not-handled-in-switch warnings.
> 
> Use a default case instead, otherwise we will need to keep adding extra
> cases if changes happen in the future.
> 
> Signed-off-by: Michel Thierry <michel.thierry@intel.com>

Left spray paint behind, so
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

(Not really a case of MISSING_CASE, as it is completely impossible, so
GEM_BUG?)
-Chris
Michel Thierry Aug. 29, 2017, 7:21 p.m. UTC | #2
On 29/08/17 12:18, Chris Wilson wrote:
> Quoting Michel Thierry (2017-08-29 19:55:45)
>> Gen7 won't get any new engines, and we already added VCS2 there to just
>> silence gcc's not-handled-in-switch warnings.
>>
>> Use a default case instead, otherwise we will need to keep adding extra
>> cases if changes happen in the future.
>>
>> Signed-off-by: Michel Thierry <michel.thierry@intel.com>
> 
> Left spray paint behind, so
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> 
> (Not really a case of MISSING_CASE, as it is completely impossible, so
> GEM_BUG?)

True, GEM_BUG makes more sense here.
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index c277a26bbd99..7d57a5971f39 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -409,10 +409,12 @@  static void intel_ring_setup_status_page(struct intel_engine_cs *engine)
 			mmio = BLT_HWS_PGA_GEN7;
 			break;
 		/*
-		 * VCS2 actually doesn't exist on Gen7. Only shut up
+		 * No more rings exist on Gen7. Only shut up
 		 * gcc switch check warning
 		 */
-		case VCS2:
+		default:
+			MISSING_CASE(engine->id);
+			/* fall through */
 		case VCS:
 			mmio = BSD_HWS_PGA_GEN7;
 			break;