[PATCH -mm] proc: fixup read test even more

From: Alexey Dobriyan
Date: Sat Mar 17 2018 - 12:49:26 EST


/proc/sysrq-trigger lives on the ground floor so to speak.

Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
---

FOLD INTO proc-shotgun-test-read-readdir-readlink-a-little-write-fix.patch

tools/testing/selftests/proc/read.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

--- a/tools/testing/selftests/proc/read.c
+++ b/tools/testing/selftests/proc/read.c
@@ -106,10 +106,10 @@ static void f(DIR *d, unsigned int level)
int fd;

case DT_REG:
- if (level == 1 && streq(de->d_name, "clear_refs")) {
- f_reg_write(d, de->d_name, "1", 1);
- } else if (level == 1 && streq(de->d_name, "sysrq-trigger")) {
+ if (level == 0 && streq(de->d_name, "sysrq-trigger")) {
f_reg_write(d, de->d_name, "h", 1);
+ } else if (level == 1 && streq(de->d_name, "clear_refs")) {
+ f_reg_write(d, de->d_name, "1", 1);
} else if (level == 3 && streq(de->d_name, "clear_refs")) {
f_reg_write(d, de->d_name, "1", 1);
} else {