[PATCH] uapi: remove a few asm/ioctl.h includes

From: Thomas Martitz
Date: Fri Aug 14 2020 - 08:57:27 EST


We found the following warnings when build userspace for our MIPS-based boards:

include/asm-generic/ioctl.h:65: warning: "_IOC" redefined

It appears that asm/ioctl.h does not play well when compiling against musl libc.
Since almost all other uapi headers that wrap _IOC() and friends do *not*
include asm/ioctl.h itself, lets follow this route for sickios.h and atmioc.h.

The userspace is required to include <sys/ioctl.h> anyway when it wants
to call ioctl() for any macro provided by the affected headers.
---
arch/mips/include/uapi/asm/sockios.h | 2 --
arch/xtensa/include/uapi/asm/sockios.h | 2 --
include/uapi/linux/atmioc.h | 3 ---
3 files changed, 7 deletions(-)

diff --git a/arch/mips/include/uapi/asm/sockios.h b/arch/mips/include/uapi/asm/sockios.h
index 66f60234f290b..a96f3ea5430f5 100644
--- a/arch/mips/include/uapi/asm/sockios.h
+++ b/arch/mips/include/uapi/asm/sockios.h
@@ -11,8 +11,6 @@
#ifndef _ASM_SOCKIOS_H
#define _ASM_SOCKIOS_H

-#include <asm/ioctl.h>
-
/* Socket-level I/O control calls. */
#define FIOGETOWN _IOR('f', 123, int)
#define FIOSETOWN _IOW('f', 124, int)
diff --git a/arch/xtensa/include/uapi/asm/sockios.h b/arch/xtensa/include/uapi/asm/sockios.h
index 1a1f58f4b75a2..71d05c88b8178 100644
--- a/arch/xtensa/include/uapi/asm/sockios.h
+++ b/arch/xtensa/include/uapi/asm/sockios.h
@@ -15,8 +15,6 @@
#ifndef _XTENSA_SOCKIOS_H
#define _XTENSA_SOCKIOS_H

-#include <asm/ioctl.h>
-
/* Socket-level I/O control calls. */

#define FIOGETOWN _IOR('f', 123, int)
diff --git a/include/uapi/linux/atmioc.h b/include/uapi/linux/atmioc.h
index cd7655e40c77a..36a51ca18ea3c 100644
--- a/include/uapi/linux/atmioc.h
+++ b/include/uapi/linux/atmioc.h
@@ -13,9 +13,6 @@
#ifndef _LINUX_ATMIOC_H
#define _LINUX_ATMIOC_H

-#include <asm/ioctl.h>
- /* everybody including atmioc.h will also need _IO{,R,W,WR} */
-
#define ATMIOC_PHYCOM 0x00 /* PHY device common ioctls, globally unique */
#define ATMIOC_PHYCOM_END 0x0f
#define ATMIOC_PHYTYP 0x10 /* PHY dev type ioctls, unique per PHY type */
--
2.25.1