[Mesa-dev] [PATCH 08/12] intel: aubinator: mark *res as MAYBE_UNUSED in get_ggtt_batch_bo
Kai Wasserbäch
kai at dev.carbon-project.org
Sat Aug 18 11:16:12 UTC 2018
Only used, when asserts are enabled.
Fixes an unused-variable warning with GCC 8:
../../../src/intel/tools/aubinator.c: In function 'get_ggtt_batch_bo':
../../../src/intel/tools/aubinator.c:322:13: warning: unused variable 'res' [-Wunused-variable]
void *res = mmap((uint8_t *)bo.map + map_offset, 4096, PROT_READ,
^~~
Signed-off-by: Kai Wasserbäch <kai at dev.carbon-project.org>
---
src/intel/tools/aubinator.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c
index 66a7db1043..96ac39248d 100644
--- a/src/intel/tools/aubinator.c
+++ b/src/intel/tools/aubinator.c
@@ -319,8 +319,9 @@ get_ggtt_batch_bo(void *user_data, uint64_t address)
continue;
uint32_t map_offset = i->virt_addr - address;
- void *res = mmap((uint8_t *)bo.map + map_offset, 4096, PROT_READ,
- MAP_SHARED | MAP_FIXED, mem_fd, phys_mem->fd_offset);
+ MAYBE_UNUSED void *res = mmap((uint8_t *)bo.map + map_offset, 4096,
+ PROT_READ, MAP_SHARED | MAP_FIXED, mem_fd,
+ phys_mem->fd_offset);
assert(res != MAP_FAILED);
}
--
2.18.0
More information about the mesa-dev
mailing list