blob: 67666d6c0000f8ebe770c9306825cdc655ae1d7a [file] [log] [blame]
From: Amer Al Shanawany <amer.shanawany@gmail.com>
Subject: selftests: proc: remove unreached code and fix build warning
Date: Mon, 3 Jun 2024 14:42:20 +0200
fix the following warning:
proc-empty-vm.c:385:17: warning: ignoring return value of `write'
declared with attribute `warn_unused_result' [-Wunused-result]
385 | write(1, buf, rv);
| ^~~~~~~~~~~~~~~~~
Link: https://lkml.kernel.org/r/20240603124220.33778-1-amer.shanawany@gmail.com
Signed-off-by: Amer Al Shanawany <amer.shanawany@gmail.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/r/202404010211.ygidvMwa-lkp@intel.com/
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Swarup Laxman Kotiaklapudi <swarupkotikalapudi@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
tools/testing/selftests/proc/proc-empty-vm.c | 3 ---
1 file changed, 3 deletions(-)
--- a/tools/testing/selftests/proc/proc-empty-vm.c~selftests-proc-remove-unreached-code-and-fix-build-warning
+++ a/tools/testing/selftests/proc/proc-empty-vm.c
@@ -381,9 +381,6 @@ static int test_proc_pid_statm(pid_t pid
assert(rv >= 0);
assert(rv <= sizeof(buf));
- if (0) {
- write(1, buf, rv);
- }
const char *p = buf;
const char *const end = p + rv;
_