From 953b8e240af8aff130f13077641cf4b4849468b5 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 22 May 2015 15:29:19 +0100 Subject: [PATCH] syscall_fs2: kill redundant itmp --- Kernel/syscall_fs2.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Kernel/syscall_fs2.c b/Kernel/syscall_fs2.c index c7d154b0..71bd7c04 100644 --- a/Kernel/syscall_fs2.c +++ b/Kernel/syscall_fs2.c @@ -431,7 +431,6 @@ arg_t _open(void) int8_t uindex; int8_t oftindex; staticfast inoptr ino; - inoptr itmp; int16_t perm; staticfast inoptr parent; char fname[FILENAME_LEN + 1]; @@ -503,18 +502,18 @@ arg_t _open(void) } if (isdevice(ino)) { - itmp = ino; + inoptr *iptr = &of_tab[oftindex].o_inode; /* d_open may block and thus ino may become invalid as may parent (but we don't need it again). It may also be changed by the call to dev_openi */ - if (dev_openi(&itmp, flag) != 0) + if (dev_openi(iptr, flag) != 0) goto cantopen; - /* get the static pointer back */ - ino = itmp; /* May have changed */ - of_tab[oftindex].o_inode = ino; + /* get the static pointer back in case it changed via dev + usage or just because we blocked */ + ino = *iptr; } if (trunc && getmode(ino) == F_REG) { -- 2.34.1