Reducing dependencies on the header linux/kernel.h.
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
---
arch/arm64/include/asm/syscall.h | 2 +-
arch/arm64/kvm/handle_exit.c | 2 +-
drivers/bus/uniphier-system-bus.c | 2 +-
drivers/irqchip/irq-gic-v3-its.c | 1 +
drivers/spi/spi-pci1xxxx.c | 1 +
fs/hfs/hfs_fs.h | 2 +-
fs/hfsplus/hfsplus_fs.h | 2 +-
include/drm/drm_fixed.h | 2 +-
include/linux/dma-fence.h | 2 +-
include/linux/goldfish.h | 2 +-
include/linux/kernel.h | 29 +----------------------------
include/linux/qed/common_hsi.h | 1 +
include/linux/wordpart.h | 28 ++++++++++++++++++++++++++++
include/rdma/uverbs_ioctl.h | 3 ++-
include/soc/fsl/bman.h | 2 ++
include/soc/fsl/qman.h | 1 +
16 files changed, 45 insertions(+), 37 deletions(-)
@@ -8,7 +8,7 @@
#include <uapi/linux/audit.h>
#include <linux/compat.h>
#include <linux/err.h>
-#include <linux/kernel.h> // for lower_32_bits()
+#include <linux/wordpart.h> // for lower_32_bits()
typedef long (*syscall_fn_t)(const struct pt_regs *regs);
@@ -10,7 +10,7 @@
#include <linux/kvm.h>
#include <linux/kvm_host.h>
-#include <linux/kernel.h> // for upper_32_bits(), lower_32_bits()
+#include <linux/wordpart.h> // for lower_32_bits(), upper_32_bits()
#include <asm/esr.h>
#include <asm/exception.h>
@@ -6,7 +6,7 @@
#include <linux/io.h>
#include <linux/kernel.h> // for upper_32_bits(), lower_32_bits()
#include <linux/log2.h>
-#include <linux/kernel.h> // for upper_32_bits()
+#include <linux/wordpart.h> // for upper_32_bits()
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
@@ -30,6 +30,7 @@
#include <linux/percpu.h>
#include <linux/slab.h>
#include <linux/syscore_ops.h>
+#include <linux/wordpart.h> // for lower_32_bits(), upper_32_bits()
#include <linux/irqchip.h>
#include <linux/irqchip/arm-gic-v3.h>
@@ -9,6 +9,7 @@
#include <linux/dma-mapping.h>
#include <linux/iopoll.h>
#include <linux/irq.h>
+#include <linux/kernel.h> // for upper_32_bits(), lower_32_bits()
#include <linux/module.h>
#include <linux/msi.h>
#include <linux/pci_regs.h>
@@ -17,7 +17,7 @@
#include <linux/slab.h>
#include <linux/types.h>
-#include <linux/kernel.h> // for lower_32_bits()
+#include <linux/wordpart.h> // for lower_32_bits()
#include <linux/mutex.h>
#include <linux/buffer_head.h>
#include <linux/fs.h>
@@ -21,7 +21,7 @@
#include <linux/mutex.h>
#include <linux/buffer_head.h>
#include <linux/blkdev.h>
-#include <linux/kernel.h> // for lower_32_bits()
+#include <linux/wordpart.h> // for lower_32_bits()
#include "hfsplus_raw.h"
#define DBG_BNODE_REFS 0x00000001
@@ -25,7 +25,7 @@
#ifndef DRM_FIXED_H
#define DRM_FIXED_H
-#include <linux/kernel.h>
+#include <linux/wordpart.h> // for lower_32_bits()
#include <linux/math64.h>
typedef union dfixed {
@@ -16,7 +16,7 @@
#include <linux/err.h>
#include <linux/list.h>
#include <linux/bitops.h>
-#include <linux/kernel.h> // for lower_32_bits()
+#include <linux/wordpart.h> // for lower_32_bits()
#include <linux/kref.h>
#include <linux/sched.h>
#include <linux/printk.h>
@@ -2,7 +2,7 @@
#ifndef __LINUX_GOLDFISH_H
#define __LINUX_GOLDFISH_H
-#include <linux/kernel.h>
+#include <linux/wordpart.h> // for lower_32_bits(), upper_32_bits()
#include <linux/types.h>
#include <linux/io.h>
@@ -32,6 +32,7 @@
#include <linux/sprintf.h>
#include <linux/static_call_types.h>
#include <linux/instruction_pointer.h>
+#include <linux/wordpart.h>
#include <asm/byteorder.h>
#include <uapi/linux/kernel.h>
@@ -47,34 +48,6 @@
} \
)
-/**
- * upper_32_bits - return bits 32-63 of a number
- * @n: the number we're accessing
- *
- * A basic shift-right of a 64- or 32-bit quantity. Use this to suppress
- * the "right shift count >= width of type" warning when that quantity is
- * 32-bits.
- */
-#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16))
-
-/**
- * lower_32_bits - return bits 0-31 of a number
- * @n: the number we're accessing
- */
-#define lower_32_bits(n) ((u32)((n) & 0xffffffff))
-
-/**
- * upper_16_bits - return bits 16-31 of a number
- * @n: the number we're accessing
- */
-#define upper_16_bits(n) ((u16)((n) >> 16))
-
-/**
- * lower_16_bits - return bits 0-15 of a number
- * @n: the number we're accessing
- */
-#define lower_16_bits(n) ((u16)((n) & 0xffff))
-
void do_exit(long error_code) __noreturn;
extern int get_option(char **str, int *pint);
@@ -11,6 +11,7 @@
#include <asm/byteorder.h>
#include <linux/bitops.h>
#include <linux/slab.h>
+#include <linux/wordpart.h> // for upper_32_bits()
/* dma_addr_t manip */
#define PTR_LO(x) ((u32)(((uintptr_t)(x)) & 0xffffffff))
@@ -10,4 +10,32 @@
*/
#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x))
+/**
+ * upper_32_bits - return bits 32-63 of a number
+ * @n: the number we're accessing
+ *
+ * A basic shift-right of a 64- or 32-bit quantity. Use this to suppress
+ * the "right shift count >= width of type" warning when that quantity is
+ * 32-bits.
+ */
+#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16))
+
+/**
+ * lower_32_bits - return bits 0-31 of a number
+ * @n: the number we're accessing
+ */
+#define lower_32_bits(n) ((u32)((n) & 0xffffffff))
+
+/**
+ * upper_16_bits - return bits 16-31 of a number
+ * @n: the number we're accessing
+ */
+#define upper_16_bits(n) ((u16)((n) >> 16))
+
+/**
+ * lower_16_bits - return bits 0-15 of a number
+ * @n: the number we're accessing
+ */
+#define lower_16_bits(n) ((u16)((n) & 0xffff))
+
#endif // _LINUX_WORDPART_H
@@ -7,8 +7,9 @@
#define _UVERBS_IOCTL_
#include <rdma/uverbs_types.h>
-#include <linux/kernel.h> // for u64_to_user_ptr(), upper_32_bits(), lower_32_bits()
+#include <linux/kernel.h> // for u64_to_user_ptr()
#include <linux/uaccess.h>
+#include <linux/wordpart.h>
#include <rdma/rdma_user_ioctl.h>
#include <rdma/ib_user_ioctl_verbs.h>
#include <rdma/ib_user_ioctl_cmds.h>
@@ -31,6 +31,8 @@
#ifndef __FSL_BMAN_H
#define __FSL_BMAN_H
+#include <linux/wordpart.h> // for upper_32_bits()
+
/* wrapper for 48-bit buffers */
struct bm_buffer {
union {
@@ -33,6 +33,7 @@
#include <linux/bitops.h>
#include <linux/device.h>
+#include <linux/wordpart.h> // for upper_32_bits()
/* Hardware constants */
#define QM_CHANNEL_SWPORTAL0 0