You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull poll annotations from Al Viro: "This introduces a __bitwise type for POLL### bitmap, and propagates the annotations through the tree. Most of that stuff is as simple as 'make ->poll() instances return __poll_t and do the same to local variables used to hold the future return value'. Some of the obvious brainos found in process are fixed (e.g. POLLIN misspelled as POLL_IN). At that point the amount of sparse warnings is low and most of them are for genuine bugs - e.g. ->poll() instance deciding to return -EINVAL instead of a bitmap. I hadn't touched those in this series - it's large enough as it is. Another problem it has caught was eventpoll() ABI mess; select.c and eventpoll.c assumed that corresponding POLL### and EPOLL### were equal. That's true for some, but not all of them - EPOLL### are arch-independent, but POLL### are not. The last commit in this series separates userland POLL### values from the (now arch-independent) kernel-side ones, converting between them in the few places where they are copied to/from userland. AFAICS, this is the least disruptive fix preserving poll(2) ABI and making epoll() work on all architectures. As it is, it's simply broken on sparc - try to give it EPOLLWRNORM and it will trigger only on what would've triggered EPOLLWRBAND on other architectures. EPOLLWRBAND and EPOLLRDHUP, OTOH, are never triggered at all on sparc. With this patch they should work consistently on all architectures" * 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (37 commits) make kernel-side POLL... arch-independent eventpoll: no need to mask the result of epi_item_poll() again eventpoll: constify struct epoll_event pointers debugging printk in sg_poll() uses %x to print POLL... bitmap annotate poll(2) guts 9p: untangle ->poll() mess ->si_band gets POLL... bitmap stored into a user-visible long field ring_buffer_poll_wait() return value used as return value of ->poll() the rest of drivers/*: annotate ->poll() instances media: annotate ->poll() instances fs: annotate ->poll() instances ipc, kernel, mm: annotate ->poll() instances net: annotate ->poll() instances apparmor: annotate ->poll() instances tomoyo: annotate ->poll() instances sound: annotate ->poll() instances acpi: annotate ->poll() instances crypto: annotate ->poll() instances block: annotate ->poll() instances x86: annotate ->poll() instances ...
This commit is contained in:
@@ -2,3 +2,4 @@
|
||||
include include/uapi/asm-generic/Kbuild.asm
|
||||
|
||||
generic-y += bpf_perf_event.h
|
||||
generic-y += poll.h
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
#include <asm-generic/poll.h>
|
||||
@@ -9,8 +9,25 @@
|
||||
#ifndef _UAPI__BFIN_POLL_H
|
||||
#define _UAPI__BFIN_POLL_H
|
||||
|
||||
#define POLLWRNORM 4 /* POLLOUT */
|
||||
#define POLLWRBAND 256
|
||||
#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 <asm-generic/poll.h>
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -2,12 +2,27 @@
|
||||
#ifndef _ASM_POLL_H
|
||||
#define _ASM_POLL_H
|
||||
|
||||
#ifndef __KERNEL__
|
||||
#define POLLWRNORM POLLOUT
|
||||
#define POLLWRBAND 256
|
||||
#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 <asm-generic/poll.h>
|
||||
|
||||
#undef POLLREMOVE
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -3,3 +3,4 @@ include include/uapi/asm-generic/Kbuild.asm
|
||||
|
||||
generic-y += bpf_perf_event.h
|
||||
generic-y += kvm_para.h
|
||||
generic-y += poll.h
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
#include <asm-generic/poll.h>
|
||||
@@ -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));
|
||||
|
||||
@@ -3,4 +3,5 @@ include include/uapi/asm-generic/Kbuild.asm
|
||||
|
||||
generic-y += bpf_perf_event.h
|
||||
generic-y += kvm_para.h
|
||||
generic-y += poll.h
|
||||
generic-y += siginfo.h
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
#include <asm-generic/poll.h>
|
||||
@@ -2,8 +2,25 @@
|
||||
#ifndef __m68k_POLL_H
|
||||
#define __m68k_POLL_H
|
||||
|
||||
#ifndef __KERNEL__
|
||||
#define POLLWRNORM POLLOUT
|
||||
#define POLLWRBAND 256
|
||||
#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 <asm-generic/poll.h>
|
||||
|
||||
|
||||
@@ -2,8 +2,25 @@
|
||||
#ifndef __ASM_POLL_H
|
||||
#define __ASM_POLL_H
|
||||
|
||||
#ifndef __KERNEL__
|
||||
#define POLLWRNORM POLLOUT
|
||||
#define POLLWRBAND 0x0100
|
||||
#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 <asm-generic/poll.h>
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -2,4 +2,5 @@
|
||||
include include/uapi/asm-generic/Kbuild.asm
|
||||
|
||||
generic-y += bpf_perf_event.h
|
||||
generic-y += poll.h
|
||||
generic-y += siginfo.h
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
#include <asm-generic/poll.h>
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user