diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-01-31 04:58:07 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-01-31 04:58:07 +0300 |
commit | 168fe32a072a4b8dc81a3aebf0e5e588d38e2955 (patch) | |
tree | 297f0f6192256785979f5ebfb92797f81754548d /drivers/misc | |
parent | 13ddd1667e7f01071cdf120132238ffca004a88e (diff) | |
parent | c71d227fc4133f949dae620ed5e3a250b43f2415 (diff) | |
download | linux-168fe32a072a4b8dc81a3aebf0e5e588d38e2955.tar.xz |
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
...
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/cxl/api.c | 2 | ||||
-rw-r--r-- | drivers/misc/cxl/cxl.h | 2 | ||||
-rw-r--r-- | drivers/misc/cxl/file.c | 4 | ||||
-rw-r--r-- | drivers/misc/hpilo.c | 2 | ||||
-rw-r--r-- | drivers/misc/lis3lv02d/lis3lv02d.c | 2 | ||||
-rw-r--r-- | drivers/misc/mei/main.c | 6 | ||||
-rw-r--r-- | drivers/misc/mic/scif/scif_api.c | 7 | ||||
-rw-r--r-- | drivers/misc/mic/scif/scif_epd.h | 2 | ||||
-rw-r--r-- | drivers/misc/mic/scif/scif_fd.c | 2 | ||||
-rw-r--r-- | drivers/misc/mic/vop/vop_vringh.c | 4 | ||||
-rw-r--r-- | drivers/misc/phantom.c | 4 | ||||
-rw-r--r-- | drivers/misc/vmw_vmci/vmci_host.c | 4 |
12 files changed, 21 insertions, 20 deletions
diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c index 7c11bad5cded..753b1a698fc4 100644 --- a/drivers/misc/cxl/api.c +++ b/drivers/misc/cxl/api.c @@ -427,7 +427,7 @@ int cxl_fd_mmap(struct file *file, struct vm_area_struct *vm) return afu_mmap(file, vm); } EXPORT_SYMBOL_GPL(cxl_fd_mmap); -unsigned int cxl_fd_poll(struct file *file, struct poll_table_struct *poll) +__poll_t cxl_fd_poll(struct file *file, struct poll_table_struct *poll) { return afu_poll(file, poll); } diff --git a/drivers/misc/cxl/cxl.h b/drivers/misc/cxl/cxl.h index e46a4062904a..a798c2ccd67d 100644 --- a/drivers/misc/cxl/cxl.h +++ b/drivers/misc/cxl/cxl.h @@ -1081,7 +1081,7 @@ int afu_open(struct inode *inode, struct file *file); int afu_release(struct inode *inode, struct file *file); long afu_ioctl(struct file *file, unsigned int cmd, unsigned long arg); int afu_mmap(struct file *file, struct vm_area_struct *vm); -unsigned int afu_poll(struct file *file, struct poll_table_struct *poll); +__poll_t afu_poll(struct file *file, struct poll_table_struct *poll); ssize_t afu_read(struct file *file, char __user *buf, size_t count, loff_t *off); extern const struct file_operations afu_fops; diff --git a/drivers/misc/cxl/file.c b/drivers/misc/cxl/file.c index 76c0b0ca9388..90341ccda9bd 100644 --- a/drivers/misc/cxl/file.c +++ b/drivers/misc/cxl/file.c @@ -354,10 +354,10 @@ static inline bool ctx_event_pending(struct cxl_context *ctx) return false; } -unsigned int afu_poll(struct file *file, struct poll_table_struct *poll) +__poll_t afu_poll(struct file *file, struct poll_table_struct *poll) { struct cxl_context *ctx = file->private_data; - int mask = 0; + __poll_t mask = 0; unsigned long flags; diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c index 097e3092c158..95ce3e891b1b 100644 --- a/drivers/misc/hpilo.c +++ b/drivers/misc/hpilo.c @@ -514,7 +514,7 @@ static ssize_t ilo_write(struct file *fp, const char __user *buf, return err ? -EFAULT : len; } -static unsigned int ilo_poll(struct file *fp, poll_table *wait) +static __poll_t ilo_poll(struct file *fp, poll_table *wait) { struct ccb_data *data = fp->private_data; struct ccb *driver_ccb = &data->driver_ccb; diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c index 8d53609861d8..e49888eab87d 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d.c +++ b/drivers/misc/lis3lv02d/lis3lv02d.c @@ -651,7 +651,7 @@ out: return retval; } -static unsigned int lis3lv02d_misc_poll(struct file *file, poll_table *wait) +static __poll_t lis3lv02d_misc_poll(struct file *file, poll_table *wait) { struct lis3lv02d *lis3 = container_of(file->private_data, struct lis3lv02d, miscdev); diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index e825f013e54e..505b710291e6 100644 --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c @@ -542,12 +542,12 @@ static long mei_compat_ioctl(struct file *file, * * Return: poll mask */ -static unsigned int mei_poll(struct file *file, poll_table *wait) +static __poll_t mei_poll(struct file *file, poll_table *wait) { - unsigned long req_events = poll_requested_events(wait); + __poll_t req_events = poll_requested_events(wait); struct mei_cl *cl = file->private_data; struct mei_device *dev; - unsigned int mask = 0; + __poll_t mask = 0; bool notify_en; if (WARN_ON(!cl || !cl->dev)) diff --git a/drivers/misc/mic/scif/scif_api.c b/drivers/misc/mic/scif/scif_api.c index ddc9e4b08b5c..8a3e48ec37dd 100644 --- a/drivers/misc/mic/scif/scif_api.c +++ b/drivers/misc/mic/scif/scif_api.c @@ -1311,10 +1311,10 @@ static inline void _scif_poll_wait(struct file *f, wait_queue_head_t *wq, spin_lock(&ep->lock); } -unsigned int +__poll_t __scif_pollfd(struct file *f, poll_table *wait, struct scif_endpt *ep) { - unsigned int mask = 0; + __poll_t mask = 0; dev_dbg(scif_info.mdev.this_device, "SCIFAPI pollfd: ep %p %s\n", ep, scif_ep_states[ep->state]); @@ -1389,7 +1389,8 @@ scif_poll(struct scif_pollepd *ufds, unsigned int nfds, long timeout_msecs) { struct poll_wqueues table; poll_table *pt; - int i, mask, count = 0, timed_out = timeout_msecs == 0; + int i, count = 0, timed_out = timeout_msecs == 0; + __poll_t mask; u64 timeout = timeout_msecs < 0 ? MAX_SCHEDULE_TIMEOUT : msecs_to_jiffies(timeout_msecs); diff --git a/drivers/misc/mic/scif/scif_epd.h b/drivers/misc/mic/scif/scif_epd.h index 1771d7a9b8d0..f39b663da287 100644 --- a/drivers/misc/mic/scif/scif_epd.h +++ b/drivers/misc/mic/scif/scif_epd.h @@ -203,7 +203,7 @@ void scif_clientrcvd(struct scif_dev *scifdev, struct scifmsg *msg); int __scif_connect(scif_epd_t epd, struct scif_port_id *dst, bool non_block); int __scif_flush(scif_epd_t epd); int scif_mmap(struct vm_area_struct *vma, scif_epd_t epd); -unsigned int __scif_pollfd(struct file *f, poll_table *wait, +__poll_t __scif_pollfd(struct file *f, poll_table *wait, struct scif_endpt *ep); int __scif_pin_pages(void *addr, size_t len, int *out_prot, int map_flags, scif_pinned_pages_t *pages); diff --git a/drivers/misc/mic/scif/scif_fd.c b/drivers/misc/mic/scif/scif_fd.c index f7e826142a72..5c2a57ae4f85 100644 --- a/drivers/misc/mic/scif/scif_fd.c +++ b/drivers/misc/mic/scif/scif_fd.c @@ -41,7 +41,7 @@ static int scif_fdmmap(struct file *f, struct vm_area_struct *vma) return scif_mmap(vma, priv); } -static unsigned int scif_fdpoll(struct file *f, poll_table *wait) +static __poll_t scif_fdpoll(struct file *f, poll_table *wait) { struct scif_endpt *priv = f->private_data; diff --git a/drivers/misc/mic/vop/vop_vringh.c b/drivers/misc/mic/vop/vop_vringh.c index fed992e2c258..4120ed8f0cae 100644 --- a/drivers/misc/mic/vop/vop_vringh.c +++ b/drivers/misc/mic/vop/vop_vringh.c @@ -1023,10 +1023,10 @@ __unlock_ret: * in the card->host (TX) path, when userspace is unblocked by poll it * must drain all available descriptors or it can stall. */ -static unsigned int vop_poll(struct file *f, poll_table *wait) +static __poll_t vop_poll(struct file *f, poll_table *wait) { struct vop_vdev *vdev = f->private_data; - int mask = 0; + __poll_t mask = 0; mutex_lock(&vdev->vdev_mutex); if (vop_vdev_inited(vdev)) { diff --git a/drivers/misc/phantom.c b/drivers/misc/phantom.c index 30754927fd80..8fa68cf308e0 100644 --- a/drivers/misc/phantom.c +++ b/drivers/misc/phantom.c @@ -256,10 +256,10 @@ static int phantom_release(struct inode *inode, struct file *file) return 0; } -static unsigned int phantom_poll(struct file *file, poll_table *wait) +static __poll_t phantom_poll(struct file *file, poll_table *wait) { struct phantom_device *dev = file->private_data; - unsigned int mask = 0; + __poll_t mask = 0; pr_debug("phantom_poll: %d\n", atomic_read(&dev->counter)); poll_wait(file, &dev->wait, wait); diff --git a/drivers/misc/vmw_vmci/vmci_host.c b/drivers/misc/vmw_vmci/vmci_host.c index 8a16a26e9658..6640e7651533 100644 --- a/drivers/misc/vmw_vmci/vmci_host.c +++ b/drivers/misc/vmw_vmci/vmci_host.c @@ -166,11 +166,11 @@ static int vmci_host_close(struct inode *inode, struct file *filp) * This is used to wake up the VMX when a VMCI call arrives, or * to wake up select() or poll() at the next clock tick. */ -static unsigned int vmci_host_poll(struct file *filp, poll_table *wait) +static __poll_t vmci_host_poll(struct file *filp, poll_table *wait) { struct vmci_host_dev *vmci_host_dev = filp->private_data; struct vmci_ctx *context = vmci_host_dev->context; - unsigned int mask = 0; + __poll_t mask = 0; if (vmci_host_dev->ct_type == VMCIOBJ_CONTEXT) { /* Check for VMCI calls to this VM context. */ |