From: Madhavan Srinivasan <ma...@linux.ibm.com>

powerpc: Fix struct termio related ioctl macros

Since termio interface is now obsolete, include/uapi/asm/ioctls.h
has some constant macros referring to "struct termio", this caused
build failure at userspace.

In file included from /usr/include/asm/ioctl.h:12,
                 from /usr/include/asm/ioctls.h:5,
                 from tst-ioctls.c:3:
tst-ioctls.c: In function 'get_TCGETA':
tst-ioctls.c:12:10: error: invalid application of 'sizeof' to incomplete type 
'struct termio'
   12 |   return TCGETA;
      |          ^~~~~~

Even though termios.h provides "struct termio", trying to juggle definitions 
around to
make it compile could introduce regressions. So better to open code it.

Reported-by: Tulio Magno <tul...@ascii.art.br>
Closes: https://lore.kernel.org/linuxppc-dev/8734dji5wl....@ascii.art.br/
Suggested-by: Nicholas Piggin <npig...@gmail.com>
Signed-off-by: Madhavan Srinivasan <ma...@linux.ibm.com>

diff --git a/arch/powerpc/include/uapi/asm/ioctls.h 
b/arch/powerpc/include/uapi/asm/ioctls.h
index blahblah..blahblah 100644
--- a/arch/powerpc/include/uapi/asm/ioctls.h
+++ b/arch/powerpc/include/uapi/asm/ioctls.h
@@ -23,10 +23,10 @@
 #define TCSETSW                _IOW('t', 21, struct termios)
 #define TCSETSF                _IOW('t', 22, struct termios)
 
-#define TCGETA         _IOR('t', 23, struct termio)
-#define TCSETA         _IOW('t', 24, struct termio)
-#define TCSETAW                _IOW('t', 25, struct termio)
-#define TCSETAF                _IOW('t', 28, struct termio)
+#define TCGETA         0x40147417 /* _IOR('t', 23, struct termio) */
+#define TCSETA         0x80147418 /* _IOW('t', 24, struct termio) */
+#define TCSETAW                0x80147419 /* _IOW('t', 25, struct termio) */
+#define TCSETAF                0x8014741c /* _IOW('t', 28, struct termio) */
 
 #define TCSBRK         _IO('t', 29)
 #define TCXONC         _IO('t', 30)

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3872

-- 
_______________________________________________
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to