Skip to content

Commit 5611d7a

Browse files
committed
stress-uprobe: fold nested if statements into one if statement
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
1 parent 2caa59a commit 5611d7a

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

stress-uprobe.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,12 @@ static void *stress_uprobe_libc_start(const pid_t pid, char *libc_path)
112112
/*
113113
* name /libc-*.so or /libc.so found?
114114
*/
115-
if ((n == 8) && !shim_strncmp(perm, "r-xp", 4) &&
116-
shim_strstr(libc_path, ".so")) {
117-
if (shim_strstr(libc_path, "/libc-") ||
118-
shim_strstr(libc_path, "/libc.so")) {
119-
addr = (void *)(intptr_t)(start - offset);
120-
break;
121-
}
115+
if (((n == 8) && !shim_strncmp(perm, "r-xp", 4) &&
116+
shim_strstr(libc_path, ".so")) &&
117+
(shim_strstr(libc_path, "/libc-") ||
118+
shim_strstr(libc_path, "/libc.so"))) {
119+
addr = (void *)(intptr_t)(start - offset);
120+
break;
122121
}
123122
}
124123
(void)fclose(fp);

0 commit comments

Comments
 (0)