misc: tizen-inform-reboot: Use ksys_open() and ksys_close() wrappers
authorJunghoon Kim <jhoon20.kim@samsung.com>
Mon, 29 Apr 2019 22:43:58 +0000 (07:43 +0900)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Thu, 3 Aug 2023 08:43:00 +0000 (17:43 +0900)
Using ksys_open() and ksys_close() wrappers allow us to avoid the
in-kernel calls to the sys_open() and sys_close() syscalls.

Change-Id: Iea33654daef917f88cede31675c66e8b5becad77
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
drivers/misc/tizen-inform-reboot.c

index f724e7e..6cd7ce2 100644 (file)
@@ -29,7 +29,7 @@ static int inform_reboot_notifier(struct notifier_block *nb,
 
        set_fs(KERNEL_DS);
 
-       fd = sys_open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0644);
+       fd = ksys_open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0644);
        if (fd >= 0) {
                file = fget(fd);
                if (file) {
@@ -55,7 +55,7 @@ static int inform_reboot_notifier(struct notifier_block *nb,
 
                        fput(file);
                }
-               sys_close(fd);
+               ksys_close(fd);
        } else {
                pr_err("Reboot parameter passing is failed.\n"
                                "Inform file path should be described correctly in config.\n");