linux-stable/tools/testing
Sean Christopherson 7c329bbd3b 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: dfaf20af76 ("KVM: arm64: selftests: Replace str_with_index with strdup_printf")
Cc: Andrew Jones <ajones@ventanamicro.com>
Cc: Haibo Xu <haibo1.xu@intel.com>
Cc: Anup Patel <anup@brainfault.org>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Tested-by: Andrew Jones <ajones@ventanamicro.com>
Message-Id: <20230914010636.1391735-1-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2023-09-20 12:26:31 -04:00
..
crypto/chacha20-s390
cxl tools/testing/cxl: Remove unused SZ_512G macro 2023-07-20 23:35:22 -06:00
fault-injection
ktest
kunit sound updates for 6.6-rc1 2023-08-30 13:45:05 -07:00
memblock
nvdimm
radix-tree XArray/IDA updates for 6.6 2023-09-08 21:46:26 -07:00
scatterlist
selftests KVM: selftests: Assert that vasprintf() is successful 2023-09-20 12:26:31 -04:00
vsock Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-08-03 14:34:37 -07:00