]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
posix-clock: Remove duplicate compat ioctl() handler
authorThomas Weißschuh <linux@weissschuh.net>
Tue, 25 Feb 2025 17:00:47 +0000 (18:00 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 26 Feb 2025 15:53:58 +0000 (16:53 +0100)
The normal and compat ioctl handlers are identical,
which is fine as compat ioctls are detected and handled dynamically
inside the underlying clock implementation.
The duplicate definition however is unnecessary.

Just reuse the regular ioctl handler also for compat ioctls.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Cyrill Gorcunov <gorcunov@gmail.com>
Link: https://lore.kernel.org/all/20250225-posix-clock-compat-cleanup-v2-1-30de86457a2b@weissschuh.net
kernel/time/posix-clock.c

index 1af0bb2cc45c0aab843f77eb156992de469c8fb9..7f4e4fb7381ef05e5f4766181abd0a9887f53c19 100644 (file)
@@ -90,26 +90,6 @@ static long posix_clock_ioctl(struct file *fp,
        return err;
 }
 
-#ifdef CONFIG_COMPAT
-static long posix_clock_compat_ioctl(struct file *fp,
-                                    unsigned int cmd, unsigned long arg)
-{
-       struct posix_clock_context *pccontext = fp->private_data;
-       struct posix_clock *clk = get_posix_clock(fp);
-       int err = -ENOTTY;
-
-       if (!clk)
-               return -ENODEV;
-
-       if (clk->ops.ioctl)
-               err = clk->ops.ioctl(pccontext, cmd, arg);
-
-       put_posix_clock(clk);
-
-       return err;
-}
-#endif
-
 static int posix_clock_open(struct inode *inode, struct file *fp)
 {
        int err;
@@ -171,11 +151,9 @@ static const struct file_operations posix_clock_file_operations = {
        .read           = posix_clock_read,
        .poll           = posix_clock_poll,
        .unlocked_ioctl = posix_clock_ioctl,
+       .compat_ioctl   = posix_clock_ioctl,
        .open           = posix_clock_open,
        .release        = posix_clock_release,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = posix_clock_compat_ioctl,
-#endif
 };
 
 int posix_clock_register(struct posix_clock *clk, struct device *dev)