Skip to content

Commit 7a6b158

Browse files
t-8chKAGA-KOKO
authored andcommitted
posix-clock: Remove duplicate compat ioctl() handler
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
1 parent f99c5bb commit 7a6b158

1 file changed

Lines changed: 1 addition & 23 deletions

File tree

kernel/time/posix-clock.c

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -90,26 +90,6 @@ static long posix_clock_ioctl(struct file *fp,
9090
return err;
9191
}
9292

93-
#ifdef CONFIG_COMPAT
94-
static long posix_clock_compat_ioctl(struct file *fp,
95-
unsigned int cmd, unsigned long arg)
96-
{
97-
struct posix_clock_context *pccontext = fp->private_data;
98-
struct posix_clock *clk = get_posix_clock(fp);
99-
int err = -ENOTTY;
100-
101-
if (!clk)
102-
return -ENODEV;
103-
104-
if (clk->ops.ioctl)
105-
err = clk->ops.ioctl(pccontext, cmd, arg);
106-
107-
put_posix_clock(clk);
108-
109-
return err;
110-
}
111-
#endif
112-
11393
static int posix_clock_open(struct inode *inode, struct file *fp)
11494
{
11595
int err;
@@ -171,11 +151,9 @@ static const struct file_operations posix_clock_file_operations = {
171151
.read = posix_clock_read,
172152
.poll = posix_clock_poll,
173153
.unlocked_ioctl = posix_clock_ioctl,
154+
.compat_ioctl = posix_clock_ioctl,
174155
.open = posix_clock_open,
175156
.release = posix_clock_release,
176-
#ifdef CONFIG_COMPAT
177-
.compat_ioctl = posix_clock_compat_ioctl,
178-
#endif
179157
};
180158

181159
int posix_clock_register(struct posix_clock *clk, struct device *dev)

0 commit comments

Comments
 (0)