From: Amer Al Shanawany Date: Mon, 3 Jun 2024 12:42:20 +0000 (+0200) Subject: selftests: proc: remove unreached code and fix build warning X-Git-Tag: v6.11-rc1~84^2~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d87af0666d0b5838e3e3e6430c6498df8bf6ad5;p=thirdparty%2Flinux.git selftests: proc: remove unreached code and fix build warning 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 Reported-by: kernel test robot Closes: https://lore.kernel.org/r/202404010211.ygidvMwa-lkp@intel.com/ Cc: Alexey Dobriyan Cc: Hugh Dickins Cc: Javier Carrasco Cc: Shuah Khan Cc: Swarup Laxman Kotiaklapudi Signed-off-by: Andrew Morton --- diff --git a/tools/testing/selftests/proc/proc-empty-vm.c b/tools/testing/selftests/proc/proc-empty-vm.c index 56198d4ca2bf8..b3f898aab4ab3 100644 --- a/tools/testing/selftests/proc/proc-empty-vm.c +++ b/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;