nv50/query: fix stringop-overflow gcc warning
authorKarol Herbst <kherbst@redhat.com>
Fri, 30 Apr 2021 11:00:40 +0000 (13:00 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 3 May 2021 10:21:05 +0000 (10:21 +0000)
commit99d4b13a324971d6c29fdbc8d14b40fbd7a8386e
tree45f5f8f8b710aff0e9d85780668e04c28cc5d3c7
parent64246c3ae49d4bcde7a73585a8ee7470d20398ab
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>
src/gallium/drivers/nouveau/nv50/nv50_query_hw_metric.c