Coverity doesn't realize idx will never be negative. Throw in some
assert()s to help it out.
(Hopefully assert() isn't getting compiled out for coverity build.. but
there seems to be just one way to find out. We might have to change
these to assume())
Fixes CID
1362442,
1362443
Signed-off-by: Rob Clark <robclark@freedesktop.org>
struct fd_ringbuffer *ring)
{
int idx = pidx(hq->provider->query_type);
+ assert(idx >= 0); /* query never would have been created otherwise */
assert(!hq->period);
ctx->active_providers |= (1 << idx);
hq->period = util_slab_alloc(&ctx->sample_period_pool);
struct fd_ringbuffer *ring)
{
int idx = pidx(hq->provider->query_type);
+ assert(idx >= 0); /* query never would have been created otherwise */
assert(hq->period && !hq->period->end);
assert(ctx->active_providers & (1 << idx));
hq->period->end = get_sample(ctx, ring, hq->base.type);