All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] posix-clock: Remove duplicate ioctl handler
@ 2025-01-25 10:20 Thomas Weißschuh
  2025-01-25 12:25 ` Cyrill Gorcunov
  2025-01-25 14:28 ` Arnd Bergmann
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2025-01-25 10:20 UTC (permalink / raw)
  To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner
  Cc: linux-kernel, Richard Cochran, Arnd Bergmann, Cyrill Gorcunov,
	Thomas Weißschuh

The normal and compat ioctl handlers are identical,
which is fine as compat ioctls are detected and handled dynamically [0].
The duplicate definition however is unnecessary.
Just reuse the regular ioctl handler also for compat ioctls.

[0] https://lore.kernel.org/lkml/20250125-posix-clock-compat_ioctl-v2-1-11c865c500eb@weissschuh.net/

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 kernel/time/posix-clock.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/kernel/time/posix-clock.c b/kernel/time/posix-clock.c
index 1af0bb2cc45c0aab843f77eb156992de469c8fb9..353dddea0dd0cb2b0b76b5d5c5c2e4c232006c37 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;
@@ -174,7 +154,7 @@ static const struct file_operations posix_clock_file_operations = {
 	.open		= posix_clock_open,
 	.release	= posix_clock_release,
 #ifdef CONFIG_COMPAT
-	.compat_ioctl	= posix_clock_compat_ioctl,
+	.compat_ioctl	= posix_clock_ioctl,
 #endif
 };
 

---
base-commit: b46c89c08f4146e7987fc355941a93b12e2c03ef
change-id: 20250125-posix-clock-compat-cleanup-c2b8d0aefa31

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-01-26 17:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-25 10:20 [PATCH] posix-clock: Remove duplicate ioctl handler Thomas Weißschuh
2025-01-25 12:25 ` Cyrill Gorcunov
2025-01-25 14:28 ` Arnd Bergmann
2025-01-26 17:20   ` Thomas Weißschuh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.