Re: [PATCH 07/33] tty: vt: use _IO() to define ioctl numbers
From: Greg KH <gregkh@linuxfoundation.org>
Date: 2025-08-01 07:38:45
Also in:
linux-serial, lkml
On Fri, Aug 01, 2025 at 06:47:46AM +0200, Jiri Slaby wrote:
On 31. 07. 25, 22:58, Nicolas Pitre wrote:quoted
On Thu, 31 Jul 2025, Christophe Leroy wrote:quoted
Le 31/07/2025 à 16:35, Christophe Leroy a écrit :quoted
Hi Jiri, Le 11/06/2025 à 12:02, Jiri Slaby (SUSE) a écrit :quoted
_IO*() is the proper way of defining ioctl numbers. All these vt numbers were synthetically built up the same way the _IO() macro does. So instead of implicit hex numbers, use _IO() properly. To not change the pre-existing numbers, use only _IO() (and not _IOR() or _IOW()). The latter would change the numbers indeed.On powerpc your assumption is wrong, because _IOC_NONE is not 0: $ git grep _IOC_NONE arch/powerpc/ arch/powerpc/include/uapi/asm/ioctl.h:#define _IOC_NONE 1U Therefore the value changes even with _IO(), leading to failure of Xorg as reported by Christian.And is likely an issue on the 4 following architectures: $ git grep _IOC_NONE arch/ | grep 1U arch/alpha/include/uapi/asm/ioctl.h:#define _IOC_NONE 1U arch/mips/include/uapi/asm/ioctl.h:#define _IOC_NONE 1U arch/powerpc/include/uapi/asm/ioctl.h:#define _IOC_NONE 1U arch/sparc/include/uapi/asm/ioctl.h:#define _IOC_NONE 1UIMHO this one patch could simply be reverted and the "old" code let be.Oh, right -- it's easy to revert (no conflicts). We could use _IOC(0, 'V', number, 0) directly, but I am not sure, that's worth it.
Great, can someone send me a revert? thanks, greg k-h