selftests: x86: fix [-Wstringop-overread] warn in test_process_vm_readv()
authorShuah Khan <skhan@linuxfoundation.org>
Thu, 21 Oct 2021 21:33:33 +0000 (15:33 -0600)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 25 Oct 2021 15:27:20 +0000 (09:27 -0600)
commitdd40f44eabe1e122c6852fabb298aac05b083fce
tree495eea3d68a4206def78b8520ed95a795b7147c0
parentc3867ab5924b7a9a0b4a117902a08669d8be7c21
selftests: x86: fix [-Wstringop-overread] warn in test_process_vm_readv()

Fix the following [-Wstringop-overread] by passing in the variable
instead of the value.

test_vsyscall.c: In function ‘test_process_vm_readv’:
test_vsyscall.c:500:22: warning: ‘__builtin_memcmp_eq’ specified bound 4096 exceeds source size 0 [-Wstringop-overread]
  500 |                 if (!memcmp(buf, (const void *)0xffffffffff600000, 4096)) {
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/x86/test_vsyscall.c