From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Bragg Subject: Re: [PATCH] drm/i915: Add i915 perf infrastructure Date: Wed, 19 Oct 2016 17:35:47 +0100 Message-ID: References: <20160914153256.4121-1-robert@sixbynine.org> <1476272477.2817.21.camel@linux.intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0656967968==" Return-path: In-Reply-To: <1476272477.2817.21.camel@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Joonas Lahtinen Cc: David Airlie , Intel Graphics Development , ML dri-devel , Sourab Gupta , Daniel Vetter List-Id: dri-devel@lists.freedesktop.org --===============0656967968== Content-Type: multipart/alternative; boundary=001a114782dcecdeb6053f3a6727 --001a114782dcecdeb6053f3a6727 Content-Type: text/plain; charset=UTF-8 On Wed, Oct 12, 2016 at 12:41 PM, Joonas Lahtinen < joonas.lahtinen@linux.intel.com> wrote: > On ti, 2016-10-11 at 12:03 -0700, Robert Bragg wrote: > > > > + case DRM_I915_PERF_PROP_MAX: > > > > + BUG(); > > > > > > We already handle this case above, but I guess we still need this in > > > order to silence gcc... > > > > right, and preferable to having a default: case, for the future compiler > warning to handle any new properties here. > > Please, do use MISSING_CASE instead. Daniel is known to get upset for > far less ;) > > Generally consensus is that BUG() is used only when there're no other > options to back out. > thanks for this pointer. 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. Thanks, - Robert > > Regards, Joonas > -- > Joonas Lahtinen > Open Source Technology Center > Intel Corporation > --001a114782dcecdeb6053f3a6727 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Wed, Oct 12, 2016 at 12:41 PM, Joonas Lahtinen <= ;joona= s.lahtinen@linux.intel.com> wrote:
On ti, 2016-10-11 at 12:03 -0700, Robert Bragg wro= te:
> > > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case= DRM_I915_PERF_PROP_MAX:
> > > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0BUG();
> >
> > We already handle this case above, but I guess we still need this= in
> > order to silence gcc...
>
> right, and preferable to having a default: case, for the future compil= er warning to handle any new properties here.

Please, do use MISSING_CASE instead. Daniel is known to get upset fo= r
far less ;)

Generally consensus is that BUG() is used only when there're no other o= ptions to back out.

thanks for this poi= nter.

I'll add a default: with MISSING_CASE as that l= ooks 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.
=

Thanks,
- Robert

= =C2=A0

Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation

--001a114782dcecdeb6053f3a6727-- --===============0656967968== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============0656967968==--