public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] posix-clock: drop code duplication using compat_ptr_ioctl
@ 2025-01-20 22:10 Cyrill Gorcunov
  2025-01-20 22:22 ` Thomas Weißschuh
  0 siblings, 1 reply; 7+ messages in thread
From: Cyrill Gorcunov @ 2025-01-20 22:10 UTC (permalink / raw)
  To: LKML; +Cc: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner

The posix_clock_compat_ioctl() is just a clone of posix_clock_ioctl(),
drop the redundance.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Anna-Maria Behnsen <anna-maria@linutronix.de>
Cc: Frederic Weisbecker <frederic@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/time/posix-clock.c |   24 +-----------------------
 1 file changed, 1 insertion(+), 23 deletions(-)

Index: linux-tip.git/kernel/time/posix-clock.c
===================================================================
--- linux-tip.git.orig/kernel/time/posix-clock.c
+++ linux-tip.git/kernel/time/posix-clock.c
@@ -90,26 +90,6 @@ static long posix_clock_ioctl(struct fil
 	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;
@@ -173,9 +153,7 @@ static const struct file_operations posi
 	.unlocked_ioctl	= posix_clock_ioctl,
 	.open		= posix_clock_open,
 	.release	= posix_clock_release,
-#ifdef CONFIG_COMPAT
-	.compat_ioctl	= posix_clock_compat_ioctl,
-#endif
+	.compat_ioctl	= compat_ptr_ioctl,
 };
 
 int posix_clock_register(struct posix_clock *clk, struct device *dev)

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

end of thread, other threads:[~2025-01-21 18:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-20 22:10 [PATCH] posix-clock: drop code duplication using compat_ptr_ioctl Cyrill Gorcunov
2025-01-20 22:22 ` Thomas Weißschuh
2025-01-20 22:30   ` Cyrill Gorcunov
2025-01-20 22:41     ` Thomas Weißschuh
2025-01-21  6:48       ` Cyrill Gorcunov
2025-01-21 12:48         ` Thomas Weißschuh
2025-01-21 18:16           ` Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox