On 02-02-2023 12:13, Luca Vizzarro wrote:
In order to avoid ambiguity or problems arising from a change of the underlying interfaces, an explicit casting to int to a new variable argi has been added.
This commit updates all the fcntl commandsi, that take an int arg
s/commandsi/commands
as per the fcntl API specification, to use the argi variable instead of performing an implicit casting by using the generic arg.
s/casting/cast
I think it makes more sense for this patch to be the first in the series. In this way, this patch would introduce the new variable argi (as you actually mention in the commit message), and also would justify having the argi variable at the scope of the entire function.
Thanks, Tudor
Signed-off-by: Luca Vizzarro Luca.Vizzarro@arm.com
fs/fcntl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/fs/fcntl.c b/fs/fcntl.c index f9b7dd020bc9..87bad11433d6 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -322,23 +322,23 @@ static long do_fcntl(int fd, unsigned int cmd, user_uintptr_t arg, switch (cmd) { case F_DUPFD:
err = f_dupfd(arg, filp, 0);
break; case F_DUPFD_CLOEXEC:err = f_dupfd(argi, filp, 0);
err = f_dupfd(arg, filp, O_CLOEXEC);
break; case F_GETFD: err = get_close_on_exec(fd) ? FD_CLOEXEC : 0; break; case F_SETFD: err = 0;err = f_dupfd(argi, filp, O_CLOEXEC);
set_close_on_exec(fd, arg & FD_CLOEXEC);
break; case F_GETFL: err = filp->f_flags; break; case F_SETFL:set_close_on_exec(fd, argi & FD_CLOEXEC);
err = setfl(fd, filp, arg);
break; #if BITS_PER_LONG != 32 /* 32-bit arches must use fcntl64() */err = setfl(fd, filp, argi);
@@ -375,7 +375,7 @@ static long do_fcntl(int fd, unsigned int cmd, user_uintptr_t arg, force_successful_syscall_return(); break; case F_SETOWN:
err = f_setown(filp, arg, 1);
break; case F_GETOWN_EX: err = f_getown_ex(filp, arg);err = f_setown(filp, argi, 1);
@@ -404,7 +404,7 @@ static long do_fcntl(int fd, unsigned int cmd, user_uintptr_t arg, err = fcntl_setlease(fd, filp, argi); break; case F_NOTIFY:
err = fcntl_dirnotify(fd, filp, arg);
break; case F_SETPIPE_SZ: case F_GETPIPE_SZ:err = fcntl_dirnotify(fd, filp, argi);