nv50/query: fix stringop-overflow gcc warning
gcc warning:
../src/gallium/drivers/nouveau/nv50/nv50_query_hw_metric.c: In function ‘nv50_hw_metric_get_query_result’:
../src/gallium/drivers/nouveau/nv50/nv50_query_hw_metric.c:140:26: warning: ‘sm11_hw_metric_calc_result’ accessing 64 bytes in a region of size 32 [-Wstringop-overflow=]
140 | *(uint64_t *)result = sm11_hw_metric_calc_result(hq, res64);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/gallium/drivers/nouveau/nv50/nv50_query_hw_metric.c:140:26: note: referencing argument 2 of type ‘uint64_t *’ {aka ‘long unsigned int *’}
../src/gallium/drivers/nouveau/nv50/nv50_query_hw_metric.c:105:1: note: in a call to function ‘sm11_hw_metric_calc_result’
105 | sm11_hw_metric_calc_result(struct nv50_hw_query *hq, uint64_t res64[8])
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10544>
This commit is contained in:
@@ -102,7 +102,7 @@ nv50_hw_metric_end_query(struct nv50_context *nv50, struct nv50_hw_query *hq)
|
||||
}
|
||||
|
||||
static uint64_t
|
||||
sm11_hw_metric_calc_result(struct nv50_hw_query *hq, uint64_t res64[8])
|
||||
sm11_hw_metric_calc_result(struct nv50_hw_query *hq, uint64_t res64[4])
|
||||
{
|
||||
switch (hq->base.type - NV50_HW_METRIC_QUERY(0)) {
|
||||
case NV50_HW_METRIC_QUERY_BRANCH_EFFICIENCY:
|
||||
|
||||
Reference in New Issue
Block a user