util/build-id: Return a pointer rather than copying the data
We're about to use the build-id as the starting point for another SHA1 hash in the Intel Vulkan driver, and returning a pointer is far more convenient. Reviewed-by: Chad Versace <chadversary@chromium.org>
This commit is contained in:
@@ -63,7 +63,7 @@ anv_device_get_cache_uuid(void *uuid)
|
||||
if (len < VK_UUID_SIZE)
|
||||
return false;
|
||||
|
||||
build_id_read(note, uuid, VK_UUID_SIZE);
|
||||
memcpy(uuid, build_id_data(note), VK_UUID_SIZE);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -107,11 +107,10 @@ build_id_length(const struct build_id_note *note)
|
||||
return note->nhdr.n_descsz;
|
||||
}
|
||||
|
||||
void
|
||||
build_id_read(const struct build_id_note *note,
|
||||
unsigned char *build_id, size_t n)
|
||||
const uint8_t *
|
||||
build_id_data(const struct build_id_note *note)
|
||||
{
|
||||
memcpy(build_id, note->build_id, n);
|
||||
return note->build_id;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -31,8 +31,7 @@ build_id_find_nhdr(const char *filename);
|
||||
unsigned
|
||||
build_id_length(const struct build_id_note *note);
|
||||
|
||||
void
|
||||
build_id_read(const struct build_id_note *note,
|
||||
unsigned char *build_id, size_t n);
|
||||
const uint8_t *
|
||||
build_id_data(const struct build_id_note *note);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user