From 699d7a5734c9051d33fb86b57c6d7cd3fb84809b Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 4 Sep 2017 02:37:17 -0400 Subject: um: make sure to have generated headers for target Signed-off-by: Al Viro --- arch/um/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'arch') diff --git a/arch/um/Makefile b/arch/um/Makefile index b76fcce397a1..e54dda8a0363 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -116,8 +116,15 @@ endef KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig archheaders: + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \ + kbuild-file=$(HOST_DIR)/include/asm/Kbuild \ + obj=$(HOST_DIR)/include/generated/asm + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \ + kbuild-file=$(HOST_DIR)/include/uapi/asm/Kbuild \ + obj=$(HOST_DIR)/include/generated/uapi/asm $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders + archprepare: include/generated/user_constants.h LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static -- cgit v1.2.3 From d759be8953febb6e5b5376c7d9bbf568864c6e2d Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 16 Jul 2017 20:14:55 -0400 Subject: switch wrapper poll.h instances to generic-y Signed-off-by: Al Viro --- arch/alpha/include/uapi/asm/Kbuild | 2 ++ arch/alpha/include/uapi/asm/poll.h | 2 -- arch/ia64/include/uapi/asm/Kbuild | 1 + arch/ia64/include/uapi/asm/poll.h | 2 -- arch/m32r/include/uapi/asm/Kbuild | 1 + arch/m32r/include/uapi/asm/poll.h | 2 -- arch/mn10300/include/uapi/asm/Kbuild | 1 + arch/mn10300/include/uapi/asm/poll.h | 2 -- arch/score/include/uapi/asm/Kbuild | 1 + arch/score/include/uapi/asm/poll.h | 7 ------- arch/x86/include/uapi/asm/Kbuild | 1 + arch/x86/include/uapi/asm/poll.h | 1 - 12 files changed, 7 insertions(+), 16 deletions(-) delete mode 100644 arch/alpha/include/uapi/asm/poll.h delete mode 100644 arch/ia64/include/uapi/asm/poll.h delete mode 100644 arch/m32r/include/uapi/asm/poll.h delete mode 100644 arch/mn10300/include/uapi/asm/poll.h delete mode 100644 arch/score/include/uapi/asm/poll.h delete mode 100644 arch/x86/include/uapi/asm/poll.h (limited to 'arch') diff --git a/arch/alpha/include/uapi/asm/Kbuild b/arch/alpha/include/uapi/asm/Kbuild index b15bf6bc0e94..574fe90c8b58 100644 --- a/arch/alpha/include/uapi/asm/Kbuild +++ b/arch/alpha/include/uapi/asm/Kbuild @@ -1,2 +1,4 @@ # UAPI Header export list include include/uapi/asm-generic/Kbuild.asm + +generic-y += poll.h diff --git a/arch/alpha/include/uapi/asm/poll.h b/arch/alpha/include/uapi/asm/poll.h deleted file mode 100644 index b7132a305a47..000000000000 --- a/arch/alpha/include/uapi/asm/poll.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#include diff --git a/arch/ia64/include/uapi/asm/Kbuild b/arch/ia64/include/uapi/asm/Kbuild index 13a97aa2285f..4c9825edd4a3 100644 --- a/arch/ia64/include/uapi/asm/Kbuild +++ b/arch/ia64/include/uapi/asm/Kbuild @@ -2,3 +2,4 @@ include include/uapi/asm-generic/Kbuild.asm generic-y += kvm_para.h +generic-y += poll.h diff --git a/arch/ia64/include/uapi/asm/poll.h b/arch/ia64/include/uapi/asm/poll.h deleted file mode 100644 index b7132a305a47..000000000000 --- a/arch/ia64/include/uapi/asm/poll.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#include diff --git a/arch/m32r/include/uapi/asm/Kbuild b/arch/m32r/include/uapi/asm/Kbuild index 1c44d3b3eba0..21f241553a2e 100644 --- a/arch/m32r/include/uapi/asm/Kbuild +++ b/arch/m32r/include/uapi/asm/Kbuild @@ -2,4 +2,5 @@ include include/uapi/asm-generic/Kbuild.asm generic-y += kvm_para.h +generic-y += poll.h generic-y += siginfo.h diff --git a/arch/m32r/include/uapi/asm/poll.h b/arch/m32r/include/uapi/asm/poll.h deleted file mode 100644 index b7132a305a47..000000000000 --- a/arch/m32r/include/uapi/asm/poll.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#include diff --git a/arch/mn10300/include/uapi/asm/Kbuild b/arch/mn10300/include/uapi/asm/Kbuild index c94ee54210bc..162fbdbb5fd5 100644 --- a/arch/mn10300/include/uapi/asm/Kbuild +++ b/arch/mn10300/include/uapi/asm/Kbuild @@ -1,4 +1,5 @@ # UAPI Header export list include include/uapi/asm-generic/Kbuild.asm +generic-y += poll.h generic-y += siginfo.h diff --git a/arch/mn10300/include/uapi/asm/poll.h b/arch/mn10300/include/uapi/asm/poll.h deleted file mode 100644 index b7132a305a47..000000000000 --- a/arch/mn10300/include/uapi/asm/poll.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#include diff --git a/arch/score/include/uapi/asm/Kbuild b/arch/score/include/uapi/asm/Kbuild index c94ee54210bc..162fbdbb5fd5 100644 --- a/arch/score/include/uapi/asm/Kbuild +++ b/arch/score/include/uapi/asm/Kbuild @@ -1,4 +1,5 @@ # UAPI Header export list include include/uapi/asm-generic/Kbuild.asm +generic-y += poll.h generic-y += siginfo.h diff --git a/arch/score/include/uapi/asm/poll.h b/arch/score/include/uapi/asm/poll.h deleted file mode 100644 index c636b85843cd..000000000000 --- a/arch/score/include/uapi/asm/poll.h +++ /dev/null @@ -1,7 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_SCORE_POLL_H -#define _ASM_SCORE_POLL_H - -#include - -#endif /* _ASM_SCORE_POLL_H */ diff --git a/arch/x86/include/uapi/asm/Kbuild b/arch/x86/include/uapi/asm/Kbuild index da1489cb64dc..e9f6b8e332bd 100644 --- a/arch/x86/include/uapi/asm/Kbuild +++ b/arch/x86/include/uapi/asm/Kbuild @@ -4,3 +4,4 @@ include include/uapi/asm-generic/Kbuild.asm generated-y += unistd_32.h generated-y += unistd_64.h generated-y += unistd_x32.h +generic-y += poll.h diff --git a/arch/x86/include/uapi/asm/poll.h b/arch/x86/include/uapi/asm/poll.h deleted file mode 100644 index c98509d3149e..000000000000 --- a/arch/x86/include/uapi/asm/poll.h +++ /dev/null @@ -1 +0,0 @@ -#include -- cgit v1.2.3 From 8ced390c2b18364af35e3d3f080e06f8ea96be9a Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 2 Jul 2017 22:05:03 -0400 Subject: define __poll_t, annotate constants Signed-off-by: Al Viro --- arch/blackfin/include/uapi/asm/poll.h | 4 ++-- arch/frv/include/uapi/asm/poll.h | 2 +- arch/m68k/include/uapi/asm/poll.h | 2 +- arch/mips/include/uapi/asm/poll.h | 2 +- arch/sparc/include/uapi/asm/poll.h | 8 ++++---- arch/xtensa/include/uapi/asm/poll.h | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) (limited to 'arch') diff --git a/arch/blackfin/include/uapi/asm/poll.h b/arch/blackfin/include/uapi/asm/poll.h index 8b094d43e9b7..961e49056b0a 100644 --- a/arch/blackfin/include/uapi/asm/poll.h +++ b/arch/blackfin/include/uapi/asm/poll.h @@ -9,8 +9,8 @@ #ifndef _UAPI__BFIN_POLL_H #define _UAPI__BFIN_POLL_H -#define POLLWRNORM 4 /* POLLOUT */ -#define POLLWRBAND 256 +#define POLLWRNORM (__force __poll_t)4 /* POLLOUT */ +#define POLLWRBAND (__force __poll_t)256 #include diff --git a/arch/frv/include/uapi/asm/poll.h b/arch/frv/include/uapi/asm/poll.h index 887b67288340..d7053ada7c69 100644 --- a/arch/frv/include/uapi/asm/poll.h +++ b/arch/frv/include/uapi/asm/poll.h @@ -3,7 +3,7 @@ #define _ASM_POLL_H #define POLLWRNORM POLLOUT -#define POLLWRBAND 256 +#define POLLWRBAND (__force __poll_t)256 #include diff --git a/arch/m68k/include/uapi/asm/poll.h b/arch/m68k/include/uapi/asm/poll.h index c3e3fcc15e1d..99314937fe5c 100644 --- a/arch/m68k/include/uapi/asm/poll.h +++ b/arch/m68k/include/uapi/asm/poll.h @@ -3,7 +3,7 @@ #define __m68k_POLL_H #define POLLWRNORM POLLOUT -#define POLLWRBAND 256 +#define POLLWRBAND (__force __poll_t)256 #include diff --git a/arch/mips/include/uapi/asm/poll.h b/arch/mips/include/uapi/asm/poll.h index ad289d7b7434..e937f8b1b007 100644 --- a/arch/mips/include/uapi/asm/poll.h +++ b/arch/mips/include/uapi/asm/poll.h @@ -3,7 +3,7 @@ #define __ASM_POLL_H #define POLLWRNORM POLLOUT -#define POLLWRBAND 0x0100 +#define POLLWRBAND (__force __poll_t)0x0100 #include diff --git a/arch/sparc/include/uapi/asm/poll.h b/arch/sparc/include/uapi/asm/poll.h index 72356c999125..595cb12df1f1 100644 --- a/arch/sparc/include/uapi/asm/poll.h +++ b/arch/sparc/include/uapi/asm/poll.h @@ -3,10 +3,10 @@ #define __SPARC_POLL_H #define POLLWRNORM POLLOUT -#define POLLWRBAND 256 -#define POLLMSG 512 -#define POLLREMOVE 1024 -#define POLLRDHUP 2048 +#define POLLWRBAND (__force __poll_t)256 +#define POLLMSG (__force __poll_t)512 +#define POLLREMOVE (__force __poll_t)1024 +#define POLLRDHUP (__force __poll_t)2048 #include diff --git a/arch/xtensa/include/uapi/asm/poll.h b/arch/xtensa/include/uapi/asm/poll.h index 4d249040b33d..22bbc48b9f85 100644 --- a/arch/xtensa/include/uapi/asm/poll.h +++ b/arch/xtensa/include/uapi/asm/poll.h @@ -13,8 +13,8 @@ #define _XTENSA_POLL_H #define POLLWRNORM POLLOUT -#define POLLWRBAND 0x0100 -#define POLLREMOVE 0x0800 +#define POLLWRBAND (__force __poll_t)0x0100 +#define POLLREMOVE (__force __poll_t)0x0800 #include -- cgit v1.2.3 From 87c1c0935890492fdb240922dd86088c589bae18 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 2 Jul 2017 22:25:05 -0400 Subject: cris: annotate ->poll() instances Signed-off-by: Al Viro --- arch/cris/arch-v10/drivers/gpio.c | 6 +++--- arch/cris/arch-v10/drivers/sync_serial.c | 8 ++++---- arch/cris/arch-v32/drivers/sync_serial.c | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'arch') diff --git a/arch/cris/arch-v10/drivers/gpio.c b/arch/cris/arch-v10/drivers/gpio.c index 68dbe261dc57..a2986c60aaac 100644 --- a/arch/cris/arch-v10/drivers/gpio.c +++ b/arch/cris/arch-v10/drivers/gpio.c @@ -50,7 +50,7 @@ static ssize_t gpio_write(struct file *file, const char __user *buf, size_t count, loff_t *off); static int gpio_open(struct inode *inode, struct file *filp); static int gpio_release(struct inode *inode, struct file *filp); -static unsigned int gpio_poll(struct file *filp, struct poll_table_struct *wait); +static __poll_t gpio_poll(struct file *filp, struct poll_table_struct *wait); /* private data per open() of this driver */ @@ -141,9 +141,9 @@ static unsigned long dir_g_shadow; /* 1=output */ #define USE_PORTS(priv) ((priv)->minor <= GPIO_MINOR_B) -static unsigned int gpio_poll(struct file *file, poll_table *wait) +static __poll_t gpio_poll(struct file *file, poll_table *wait) { - unsigned int mask = 0; + __poll_t mask = 0; struct gpio_private *priv = file->private_data; unsigned long data; unsigned long flags; diff --git a/arch/cris/arch-v10/drivers/sync_serial.c b/arch/cris/arch-v10/drivers/sync_serial.c index cfe9176f2205..177843c64071 100644 --- a/arch/cris/arch-v10/drivers/sync_serial.c +++ b/arch/cris/arch-v10/drivers/sync_serial.c @@ -157,7 +157,7 @@ static inline int sync_data_avail(struct sync_port *port); static int sync_serial_open(struct inode *inode, struct file *file); static int sync_serial_release(struct inode *inode, struct file *file); -static unsigned int sync_serial_poll(struct file *filp, poll_table *wait); +static __poll_t sync_serial_poll(struct file *filp, poll_table *wait); static long sync_serial_ioctl(struct file *file, unsigned int cmd, unsigned long arg); @@ -654,12 +654,12 @@ static int sync_serial_release(struct inode *inode, struct file *file) -static unsigned int sync_serial_poll(struct file *file, poll_table *wait) +static __poll_t sync_serial_poll(struct file *file, poll_table *wait) { int dev = MINOR(file_inode(file)->i_rdev); - unsigned int mask = 0; + __poll_t mask = 0; struct sync_port *port; - DEBUGPOLL(static unsigned int prev_mask = 0); + DEBUGPOLL(static __poll_t prev_mask = 0); port = &ports[dev]; poll_wait(file, &port->out_wait_q, wait); diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c index 8efcc1a899a8..e20e0b9a3a5c 100644 --- a/arch/cris/arch-v32/drivers/sync_serial.c +++ b/arch/cris/arch-v32/drivers/sync_serial.c @@ -178,7 +178,7 @@ static inline int sync_data_avail(struct sync_port *port); static int sync_serial_open(struct inode *, struct file *); static int sync_serial_release(struct inode *, struct file *); -static unsigned int sync_serial_poll(struct file *filp, poll_table *wait); +static __poll_t sync_serial_poll(struct file *filp, poll_table *wait); static long sync_serial_ioctl(struct file *file, unsigned int cmd, unsigned long arg); @@ -555,13 +555,13 @@ static int sync_serial_release(struct inode *inode, struct file *file) return 0; } -static unsigned int sync_serial_poll(struct file *file, poll_table *wait) +static __poll_t sync_serial_poll(struct file *file, poll_table *wait) { int dev = iminor(file_inode(file)); - unsigned int mask = 0; + __poll_t mask = 0; struct sync_port *port; DEBUGPOLL( - static unsigned int prev_mask; + static __poll_t prev_mask; ); port = &ports[dev]; -- cgit v1.2.3 From e720f32fceeaaacf03c977d3bb44892370cf184f Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 2 Jul 2017 22:26:11 -0400 Subject: ia64: annotate ->poll() instances Signed-off-by: Al Viro --- arch/ia64/kernel/perfmon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index 09f86ebfcc7b..c44f002e8f6b 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c @@ -1644,12 +1644,12 @@ pfm_write(struct file *file, const char __user *ubuf, return -EINVAL; } -static unsigned int +static __poll_t pfm_poll(struct file *filp, poll_table * wait) { pfm_context_t *ctx; unsigned long flags; - unsigned int mask = 0; + __poll_t mask = 0; if (PFM_IS_FILE(filp) == 0) { printk(KERN_ERR "perfmon: pfm_poll: bad magic [%d]\n", task_pid_nr(current)); -- cgit v1.2.3 From 8b9aab09aaf390b868359b9365b667cf6506473c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 2 Jul 2017 22:27:13 -0400 Subject: mips: annotate ->poll() instances Signed-off-by: Al Viro --- arch/mips/kernel/rtlx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c index b80dd8b17a76..bbb0f4770c0d 100644 --- a/arch/mips/kernel/rtlx.c +++ b/arch/mips/kernel/rtlx.c @@ -336,10 +336,10 @@ static int file_release(struct inode *inode, struct file *filp) return rtlx_release(iminor(inode)); } -static unsigned int file_poll(struct file *file, poll_table *wait) +static __poll_t file_poll(struct file *file, poll_table *wait) { int minor = iminor(file_inode(file)); - unsigned int mask = 0; + __poll_t mask = 0; poll_wait(file, &channel_wqs[minor].rt_queue, wait); poll_wait(file, &channel_wqs[minor].lx_queue, wait); -- cgit v1.2.3 From 8153a5ead0898ba5a932282e571dfccd61940bba Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 2 Jul 2017 22:33:19 -0400 Subject: ppc: annotate ->poll() instances Signed-off-by: Al Viro --- arch/powerpc/kernel/rtasd.c | 2 +- arch/powerpc/platforms/cell/spufs/backing_ops.c | 6 +++--- arch/powerpc/platforms/cell/spufs/file.c | 16 ++++++++-------- arch/powerpc/platforms/cell/spufs/hw_ops.c | 5 ++--- arch/powerpc/platforms/cell/spufs/spufs.h | 3 +-- arch/powerpc/platforms/powernv/opal-prd.c | 2 +- 6 files changed, 16 insertions(+), 18 deletions(-) (limited to 'arch') diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c index 0f0b1b2f3b60..1da8b7d8c6ca 100644 --- a/arch/powerpc/kernel/rtasd.c +++ b/arch/powerpc/kernel/rtasd.c @@ -388,7 +388,7 @@ out: return error; } -static unsigned int rtas_log_poll(struct file *file, poll_table * wait) +static __poll_t rtas_log_poll(struct file *file, poll_table * wait) { poll_wait(file, &rtas_log_wait, wait); if (rtas_log_size) diff --git a/arch/powerpc/platforms/cell/spufs/backing_ops.c b/arch/powerpc/platforms/cell/spufs/backing_ops.c index 6e8a9ef8590e..1a9a756b0b2f 100644 --- a/arch/powerpc/platforms/cell/spufs/backing_ops.c +++ b/arch/powerpc/platforms/cell/spufs/backing_ops.c @@ -86,10 +86,10 @@ static u32 spu_backing_mbox_stat_read(struct spu_context *ctx) return ctx->csa.prob.mb_stat_R; } -static unsigned int spu_backing_mbox_stat_poll(struct spu_context *ctx, - unsigned int events) +static __poll_t spu_backing_mbox_stat_poll(struct spu_context *ctx, + __poll_t events) { - int ret; + __poll_t ret; u32 stat; ret = 0; diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 5ffcdeb1eb17..fc7772c3d068 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c @@ -762,10 +762,10 @@ out: return count; } -static unsigned int spufs_ibox_poll(struct file *file, poll_table *wait) +static __poll_t spufs_ibox_poll(struct file *file, poll_table *wait) { struct spu_context *ctx = file->private_data; - unsigned int mask; + __poll_t mask; poll_wait(file, &ctx->ibox_wq, wait); @@ -898,10 +898,10 @@ out: return count; } -static unsigned int spufs_wbox_poll(struct file *file, poll_table *wait) +static __poll_t spufs_wbox_poll(struct file *file, poll_table *wait) { struct spu_context *ctx = file->private_data; - unsigned int mask; + __poll_t mask; poll_wait(file, &ctx->wbox_wq, wait); @@ -1690,11 +1690,11 @@ out: return ret; } -static unsigned int spufs_mfc_poll(struct file *file,poll_table *wait) +static __poll_t spufs_mfc_poll(struct file *file,poll_table *wait) { struct spu_context *ctx = file->private_data; u32 free_elements, tagstatus; - unsigned int mask; + __poll_t mask; poll_wait(file, &ctx->mfc_wq, wait); @@ -2455,11 +2455,11 @@ static ssize_t spufs_switch_log_read(struct file *file, char __user *buf, return cnt == 0 ? error : cnt; } -static unsigned int spufs_switch_log_poll(struct file *file, poll_table *wait) +static __poll_t spufs_switch_log_poll(struct file *file, poll_table *wait) { struct inode *inode = file_inode(file); struct spu_context *ctx = SPUFS_I(inode)->i_ctx; - unsigned int mask = 0; + __poll_t mask = 0; int rc; poll_wait(file, &ctx->switch_log->wait, wait); diff --git a/arch/powerpc/platforms/cell/spufs/hw_ops.c b/arch/powerpc/platforms/cell/spufs/hw_ops.c index 8655c4cbefc2..fff58198b5b6 100644 --- a/arch/powerpc/platforms/cell/spufs/hw_ops.c +++ b/arch/powerpc/platforms/cell/spufs/hw_ops.c @@ -56,11 +56,10 @@ static u32 spu_hw_mbox_stat_read(struct spu_context *ctx) return in_be32(&ctx->spu->problem->mb_stat_R); } -static unsigned int spu_hw_mbox_stat_poll(struct spu_context *ctx, - unsigned int events) +static __poll_t spu_hw_mbox_stat_poll(struct spu_context *ctx, __poll_t events) { struct spu *spu = ctx->spu; - int ret = 0; + __poll_t ret = 0; u32 stat; spin_lock_irq(&spu->register_lock); diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h index 5e59f80e95db..2d0479ad3af4 100644 --- a/arch/powerpc/platforms/cell/spufs/spufs.h +++ b/arch/powerpc/platforms/cell/spufs/spufs.h @@ -185,8 +185,7 @@ struct mfc_dma_command { struct spu_context_ops { int (*mbox_read) (struct spu_context * ctx, u32 * data); u32(*mbox_stat_read) (struct spu_context * ctx); - unsigned int (*mbox_stat_poll)(struct spu_context *ctx, - unsigned int events); + __poll_t (*mbox_stat_poll)(struct spu_context *ctx, __poll_t events); int (*ibox_read) (struct spu_context * ctx, u32 * data); int (*wbox_write) (struct spu_context * ctx, u32 data); u32(*signal1_read) (struct spu_context * ctx); diff --git a/arch/powerpc/platforms/powernv/opal-prd.c b/arch/powerpc/platforms/powernv/opal-prd.c index de4dd09f4a15..c18de0a9b1bd 100644 --- a/arch/powerpc/platforms/powernv/opal-prd.c +++ b/arch/powerpc/platforms/powernv/opal-prd.c @@ -147,7 +147,7 @@ static bool opal_msg_queue_empty(void) return ret; } -static unsigned int opal_prd_poll(struct file *file, +static __poll_t opal_prd_poll(struct file *file, struct poll_table_struct *wait) { poll_wait(file, &opal_prd_msg_wait, wait); -- cgit v1.2.3 From 76d2d4a11b877e9f10f3d494180ec9a6f01f0857 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 2 Jul 2017 22:59:49 -0400 Subject: um: annotate ->poll() instances Signed-off-by: Al Viro --- arch/um/drivers/hostaudio_kern.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch') diff --git a/arch/um/drivers/hostaudio_kern.c b/arch/um/drivers/hostaudio_kern.c index 12bdb5996bf5..7f9dbdbc4eb7 100644 --- a/arch/um/drivers/hostaudio_kern.c +++ b/arch/um/drivers/hostaudio_kern.c @@ -119,10 +119,10 @@ static ssize_t hostaudio_write(struct file *file, const char __user *buffer, return err; } -static unsigned int hostaudio_poll(struct file *file, - struct poll_table_struct *wait) +static __poll_t hostaudio_poll(struct file *file, + struct poll_table_struct *wait) { - unsigned int mask = 0; + __poll_t mask = 0; #ifdef DEBUG printk(KERN_DEBUG "hostaudio: poll called (unimplemented)\n"); -- cgit v1.2.3 From b146e2ce804e76cffcfc17393ca7aa5e17e6037c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 2 Jul 2017 23:00:52 -0400 Subject: x86: annotate ->poll() instances Signed-off-by: Al Viro --- arch/x86/kernel/apm_32.c | 2 +- arch/x86/kernel/cpu/mcheck/dev-mcelog.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c index e4b0d92b3ae0..ab1865342002 100644 --- a/arch/x86/kernel/apm_32.c +++ b/arch/x86/kernel/apm_32.c @@ -1506,7 +1506,7 @@ static ssize_t do_read(struct file *fp, char __user *buf, size_t count, loff_t * return 0; } -static unsigned int do_poll(struct file *fp, poll_table *wait) +static __poll_t do_poll(struct file *fp, poll_table *wait) { struct apm_user *as; diff --git a/arch/x86/kernel/cpu/mcheck/dev-mcelog.c b/arch/x86/kernel/cpu/mcheck/dev-mcelog.c index 7f85b76f43bc..213e8c2ca702 100644 --- a/arch/x86/kernel/cpu/mcheck/dev-mcelog.c +++ b/arch/x86/kernel/cpu/mcheck/dev-mcelog.c @@ -243,7 +243,7 @@ out: return err ? err : buf - ubuf; } -static unsigned int mce_chrdev_poll(struct file *file, poll_table *wait) +static __poll_t mce_chrdev_poll(struct file *file, poll_table *wait) { poll_wait(file, &mce_chrdev_wait, wait); if (READ_ONCE(mcelog.next)) -- cgit v1.2.3 From c71d227fc4133f949dae620ed5e3a250b43f2415 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 29 Nov 2017 19:00:41 -0500 Subject: make kernel-side POLL... arch-independent mangle/demangle on the way to/from userland Signed-off-by: Al Viro --- arch/blackfin/include/uapi/asm/poll.h | 19 ++++++++++++++++++- arch/frv/include/uapi/asm/poll.h | 19 +++++++++++++++++-- arch/m68k/include/uapi/asm/poll.h | 17 +++++++++++++++++ arch/mips/include/uapi/asm/poll.h | 17 +++++++++++++++++ arch/sparc/include/uapi/asm/poll.h | 20 ++++++++++++++++++++ arch/xtensa/include/uapi/asm/poll.h | 17 +++++++++++++++++ 6 files changed, 106 insertions(+), 3 deletions(-) (limited to 'arch') diff --git a/arch/blackfin/include/uapi/asm/poll.h b/arch/blackfin/include/uapi/asm/poll.h index 961e49056b0a..3b162f2d2970 100644 --- a/arch/blackfin/include/uapi/asm/poll.h +++ b/arch/blackfin/include/uapi/asm/poll.h @@ -9,8 +9,25 @@ #ifndef _UAPI__BFIN_POLL_H #define _UAPI__BFIN_POLL_H -#define POLLWRNORM (__force __poll_t)4 /* POLLOUT */ +#ifndef __KERNEL__ +#define POLLWRNORM POLLOUT #define POLLWRBAND (__force __poll_t)256 +#else +#define __ARCH_HAS_MANGLED_POLL +static inline __u16 mangle_poll(__poll_t val) +{ + __u16 v = (__force __u16)val; + /* bit 9 -> bit 8, bit 8 -> bit 2 */ + return (v & ~0x300) | ((v & 0x200) >> 1) | ((v & 0x100) >> 6); +} + +static inline __poll_t demangle_poll(__u16 v) +{ + /* bit 8 -> bit 9, bit 2 -> bits 2 and 8 */ + return (__force __poll_t)((v & ~0x100) | ((v & 0x100) << 1) | + ((v & 4) << 6)); +} +#endif #include diff --git a/arch/frv/include/uapi/asm/poll.h b/arch/frv/include/uapi/asm/poll.h index d7053ada7c69..a44c8f0ebee7 100644 --- a/arch/frv/include/uapi/asm/poll.h +++ b/arch/frv/include/uapi/asm/poll.h @@ -2,12 +2,27 @@ #ifndef _ASM_POLL_H #define _ASM_POLL_H +#ifndef __KERNEL__ #define POLLWRNORM POLLOUT #define POLLWRBAND (__force __poll_t)256 +#else +#define __ARCH_HAS_MANGLED_POLL +static inline __u16 mangle_poll(__poll_t val) +{ + __u16 v = (__force __u16)val; + /* bit 9 -> bit 8, bit 8 -> bit 2 */ + return (v & ~0x300) | ((v & 0x200) >> 1) | ((v & 0x100) >> 6); +} -#include +static inline __poll_t demangle_poll(__u16 v) +{ + /* bit 8 -> bit 9, bit 2 -> bits 2 and 8 */ + return (__force __poll_t)((v & ~0x100) | ((v & 0x100) << 1) | + ((v & 4) << 6)); +} +#endif +#include #undef POLLREMOVE #endif - diff --git a/arch/m68k/include/uapi/asm/poll.h b/arch/m68k/include/uapi/asm/poll.h index 99314937fe5c..d8be239e8141 100644 --- a/arch/m68k/include/uapi/asm/poll.h +++ b/arch/m68k/include/uapi/asm/poll.h @@ -2,8 +2,25 @@ #ifndef __m68k_POLL_H #define __m68k_POLL_H +#ifndef __KERNEL__ #define POLLWRNORM POLLOUT #define POLLWRBAND (__force __poll_t)256 +#else +#define __ARCH_HAS_MANGLED_POLL +static inline __u16 mangle_poll(__poll_t val) +{ + __u16 v = (__force __u16)val; + /* bit 9 -> bit 8, bit 8 -> bit 2 */ + return (v & ~0x300) | ((v & 0x200) >> 1) | ((v & 0x100) >> 6); +} + +static inline __poll_t demangle_poll(__u16 v) +{ + /* bit 8 -> bit 9, bit 2 -> bits 2 and 8 */ + return (__force __poll_t)((v & ~0x100) | ((v & 0x100) << 1) | + ((v & 4) << 6)); +} +#endif #include diff --git a/arch/mips/include/uapi/asm/poll.h b/arch/mips/include/uapi/asm/poll.h index e937f8b1b007..3173f8917128 100644 --- a/arch/mips/include/uapi/asm/poll.h +++ b/arch/mips/include/uapi/asm/poll.h @@ -2,8 +2,25 @@ #ifndef __ASM_POLL_H #define __ASM_POLL_H +#ifndef __KERNEL__ #define POLLWRNORM POLLOUT #define POLLWRBAND (__force __poll_t)0x0100 +#else +#define __ARCH_HAS_MANGLED_POLL +static inline __u16 mangle_poll(__poll_t val) +{ + __u16 v = (__force __u16)val; + /* bit 9 -> bit 8, bit 8 -> bit 2 */ + return (v & ~0x300) | ((v & 0x200) >> 1) | ((v & 0x100) >> 6); +} + +static inline __poll_t demangle_poll(__u16 v) +{ + /* bit 8 -> bit 9, bit 2 -> bits 2 and 8 */ + return (__force __poll_t)((v & ~0x100) | ((v & 0x100) << 1) | + ((v & 4) << 6)); +} +#endif #include diff --git a/arch/sparc/include/uapi/asm/poll.h b/arch/sparc/include/uapi/asm/poll.h index 595cb12df1f1..2a81e79aa3ea 100644 --- a/arch/sparc/include/uapi/asm/poll.h +++ b/arch/sparc/include/uapi/asm/poll.h @@ -2,11 +2,31 @@ #ifndef __SPARC_POLL_H #define __SPARC_POLL_H +#ifndef __KERNEL__ #define POLLWRNORM POLLOUT #define POLLWRBAND (__force __poll_t)256 #define POLLMSG (__force __poll_t)512 #define POLLREMOVE (__force __poll_t)1024 #define POLLRDHUP (__force __poll_t)2048 +#else +#define __ARCH_HAS_MANGLED_POLL +static inline __u16 mangle_poll(__poll_t val) +{ + __u16 v = (__force __u16)val; + /* bit 9 -> bit 8, bit 8 -> bit 2, bit 13 -> bit 11 */ + return (v & ~0x300) | ((v & 0x200) >> 1) | ((v & 0x100) >> 6) | + ((v & 0x2000) >> 2); + + +} + +static inline __poll_t demangle_poll(__u16 v) +{ + /* bit 8 -> bit 9, bit 2 -> bits 2 and 8 */ + return (__force __poll_t)((v & ~0x100) | ((v & 0x100) << 1) | + ((v & 4) << 6) | ((v & 0x800) << 2)); +} +#endif #include diff --git a/arch/xtensa/include/uapi/asm/poll.h b/arch/xtensa/include/uapi/asm/poll.h index 22bbc48b9f85..e3246d41182c 100644 --- a/arch/xtensa/include/uapi/asm/poll.h +++ b/arch/xtensa/include/uapi/asm/poll.h @@ -12,9 +12,26 @@ #ifndef _XTENSA_POLL_H #define _XTENSA_POLL_H +#ifndef __KERNEL__ #define POLLWRNORM POLLOUT #define POLLWRBAND (__force __poll_t)0x0100 #define POLLREMOVE (__force __poll_t)0x0800 +#else +#define __ARCH_HAS_MANGLED_POLL +static inline __u16 mangle_poll(__poll_t val) +{ + __u16 v = (__force __u16)val; + /* bit 9 -> bit 8, bit 8 -> bit 2 */ + return (v & ~0x300) | ((v & 0x200) >> 1) | ((v & 0x100) >> 6); +} + +static inline __poll_t demangle_poll(__u16 v) +{ + /* bit 8 -> bit 9, bit 2 -> bits 2 and 8 */ + return (__force __poll_t)((v & ~0x100) | ((v & 0x100) << 1) | + ((v & 4) << 6)); +} +#endif #include -- cgit v1.2.3