diff options
author | Sean Christopherson <[email protected]> | 2023-09-13 18:06:36 -0700 |
---|---|---|
committer | Paolo Bonzini <[email protected]> | 2023-09-20 12:26:31 -0400 |
commit | 7c329bbd3bb87ddb5843853f6e08f97d2f271496 (patch) | |
tree | 6048b6b6d61f005614603c88929554e6c5a4ebbc /tools/perf/scripts/python/compaction-times.py | |
parent | 7c7cce2cf7ee2ac54851ba1fbcf0e968932e32b9 (diff) |
KVM: selftests: Assert that vasprintf() is successful
Assert that vasprintf() succeeds as the "returned" string is undefined
on failure. Checking the result also eliminates the only warning with
default options in KVM selftests, i.e. is the only thing getting in the
way of compile with -Werror.
lib/test_util.c: In function ‘strdup_printf’:
lib/test_util.c:390:9: error: ignoring return value of ‘vasprintf’
declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
390 | vasprintf(&str, fmt, ap);
| ^~~~~~~~~~~~~~~~~~~~~~~~
Don't bother capturing the return value, allegedly vasprintf() can only
fail due to a memory allocation failure.
Fixes: dfaf20af7649 ("KVM: arm64: selftests: Replace str_with_index with strdup_printf")
Cc: Andrew Jones <[email protected]>
Cc: Haibo Xu <[email protected]>
Cc: Anup Patel <[email protected]>
Signed-off-by: Sean Christopherson <[email protected]>
Reviewed-by: Andrew Jones <[email protected]>
Tested-by: Andrew Jones <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/compaction-times.py')
0 files changed, 0 insertions, 0 deletions