[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250225-posix-clock-compat-cleanup-v2-1-30de86457a2b@weissschuh.net>
Date: Tue, 25 Feb 2025 18:00:47 +0100
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Anna-Maria Behnsen <anna-maria@...utronix.de>,
Frederic Weisbecker <frederic@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>
Cc: linux-kernel@...r.kernel.org,
Richard Cochran <richardcochran@...il.com>, Arnd Bergmann <arnd@...db.de>,
Cyrill Gorcunov <gorcunov@...il.com>,
Thomas Weißschuh <linux@...ssschuh.net>
Subject: [PATCH v2] posix-clock: Remove duplicate 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@...ssschuh.net>
Reviewed-by: Cyrill Gorcunov <gorcunov@...il.com>
---
Changes in v2:
- Drop #ifdef and move .compat_ioctl next to .unlocked_ioctl
- Pick up review tag
- Rebase onto latest mainline
- Link to v1: https://lore.kernel.org/r/20250125-posix-clock-compat-cleanup-v1-1-c8b0f377905b@weissschuh.net
---
kernel/time/posix-clock.c | 24 +-----------------------
1 file changed, 1 insertion(+), 23 deletions(-)
diff --git a/kernel/time/posix-clock.c b/kernel/time/posix-clock.c
index 1af0bb2cc45c0aab843f77eb156992de469c8fb9..7f4e4fb7381ef05e5f4766181abd0a9887f53c19 100644
--- a/kernel/time/posix-clock.c
+++ b/kernel/time/posix-clock.c
@@ -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)
---
base-commit: d082ecbc71e9e0bf49883ee4afd435a77a5101b6
change-id: 20250125-posix-clock-compat-cleanup-c2b8d0aefa31
Best regards,
--
Thomas Weißschuh <linux@...ssschuh.net>
Powered by blists - more mailing lists