<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 12, 2016 at 12:41 PM, Joonas Lahtinen <span dir="ltr"><<a href="mailto:joonas.lahtinen@linux.intel.com" target="_blank">joonas.lahtinen@linux.intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On ti, 2016-10-11 at 12:03 -0700, Robert Bragg wrote:<br>
> > > +               case DRM_I915_PERF_PROP_MAX:<br>
> > > +                       BUG();<br>
> ><br>
> > We already handle this case above, but I guess we still need this in<br>
> > order to silence gcc...<br>
><br>
> right, and preferable to having a default: case, for the future compiler warning to handle any new properties here.<br>
<br>
</span>Please, do use MISSING_CASE instead. Daniel is known to get upset for<br>
far less ;)<br>
<br>
Generally consensus is that BUG() is used only when there're no other options to back out.<br></blockquote><div><br></div><div>thanks for this pointer.<br><br></div><div>I'll add a default: with MISSING_CASE as that looks like an i915-specific convention; though it seems like a real shame to defer missing case issues to runtime errors instead of taking advantage of the compiler complaining at build time that a case has been forgotten.<br></div><div><br></div><div>Thanks,<br></div><div>- Robert<br></div><div><br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Regards, Joonas<br>
<span class="HOEnZb"><font color="#888888">--<br>
Joonas Lahtinen<br>
Open Source Technology Center<br>
Intel Corporation<br>
</font></span></blockquote></div><br></div></div>