[Mesa-dev] [PATCH 4/4] mesa/main: drop needless condition check in _mesa_GetPerfCounterInfoINTEL
Rob Herring
robh at kernel.org
Wed May 31 21:38:16 UTC 2017
On Wed, May 31, 2017 at 1:35 AM, Lionel Landwerlin
<lionel.g.landwerlin at intel.com> wrote:
> On 31/05/17 02:04, Ian Romanick wrote:
>
> I've seen this warning a million times, and I always talk myself out of
> fixing it. If the type of counterIndex ever changes to int (or another
> signed type), this will break. It may not be obvious at the time of the
> break that it happened, and it will likely be annoying to debug.
>
> I'm not NAKing it, but it makes me nervous. What do other folks think?
>
>
> Spec says :
>
> "
>
> Performance counter id 0
> is reserved as an invalid counter.
>
> "
>
> Maybe we should change counterid_to_index() to return a signed integer?
> What are the chances to have more than 1^31 counters?
Just changing counterIndex from unsigned to int should be enough.
Rob
More information about the mesa-dev
mailing list