Re: [PATCH] posix-clock: Remove duplicate ioctl handler

From: Thomas Weißschuh
Date: Sun Jan 26 2025 - 12:20:56 EST


Hi Arnd,

On 2025-01-25 15:28:29+0100, Arnd Bergmann wrote:
> On Sat, Jan 25, 2025, at 11:20, Thomas Weißschuh wrote:
> > 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
>
> I would remove the #ifdef/#endif as well here. I would also suggest
> using compat_ptr_ioctl(), so on s390 the pointers get converted
> correctly, even if it clears the upper bit on the integer arguments.

Using compat_ptr_ioctl() here will break the logic from the closely
related fix to the PTP ioctl handler [0].
There is no other posix_clock_file_operations implementer than PTP.

I can drop the #ifdef.


Thomas

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