diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/debug_fifo.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/debug_fifo.c b/drivers/gpu/nvgpu/common/linux/debug_fifo.c index b2a87e0d..f2aaef58 100644 --- a/drivers/gpu/nvgpu/common/linux/debug_fifo.c +++ b/drivers/gpu/nvgpu/common/linux/debug_fifo.c | |||
@@ -222,10 +222,11 @@ static unsigned int __gk20a_fifo_create_stats(struct gk20a *g, | |||
222 | __profile_cmp, NULL); | 222 | __profile_cmp, NULL); |
223 | 223 | ||
224 | /* build ranges */ | 224 | /* build ranges */ |
225 | for (index = 0; index < PERCENTILE_RANGES; index++) | 225 | for (index = 0; index < PERCENTILE_RANGES; index++) { |
226 | percentiles[index] = | 226 | percentiles[index] = nelem < PERCENTILE_RANGES ? 0 : |
227 | g->fifo.profile.sorted[(PERCENTILE_WIDTH * (index + 1) * | 227 | g->fifo.profile.sorted[(PERCENTILE_WIDTH * (index + 1) * |
228 | nelem)/100 - 1]; | 228 | nelem)/100 - 1]; |
229 | } | ||
229 | return nelem; | 230 | return nelem; |
230 | } | 231 | } |
231 | 232 | ||