diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-01-30 17:58:07 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-01-30 17:58:07 -0800 |
commit | 168fe32a072a4b8dc81a3aebf0e5e588d38e2955 (patch) | |
tree | 297f0f6192256785979f5ebfb92797f81754548d /drivers/media/usb | |
parent | 13ddd1667e7f01071cdf120132238ffca004a88e (diff) | |
parent | c71d227fc4133f949dae620ed5e3a250b43f2415 (diff) |
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/media/usb')
-rw-r--r-- | drivers/media/usb/cpia2/cpia2.h | 2 | ||||
-rw-r--r-- | drivers/media/usb/cpia2/cpia2_core.c | 4 | ||||
-rw-r--r-- | drivers/media/usb/cpia2/cpia2_v4l.c | 4 | ||||
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-417.c | 6 | ||||
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-video.c | 6 | ||||
-rw-r--r-- | drivers/media/usb/gspca/gspca.c | 6 | ||||
-rw-r--r-- | drivers/media/usb/hdpvr/hdpvr-video.c | 6 | ||||
-rw-r--r-- | drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 4 | ||||
-rw-r--r-- | drivers/media/usb/stkwebcam/stk-webcam.c | 4 | ||||
-rw-r--r-- | drivers/media/usb/tm6000/tm6000-video.c | 10 | ||||
-rw-r--r-- | drivers/media/usb/uvc/uvc_queue.c | 4 | ||||
-rw-r--r-- | drivers/media/usb/uvc/uvc_v4l2.c | 2 | ||||
-rw-r--r-- | drivers/media/usb/uvc/uvcvideo.h | 2 | ||||
-rw-r--r-- | drivers/media/usb/zr364xx/zr364xx.c | 4 |
14 files changed, 32 insertions, 32 deletions
diff --git a/drivers/media/usb/cpia2/cpia2.h b/drivers/media/usb/cpia2/cpia2.h index 81f72c0b561f..ab238ac8bfc0 100644 --- a/drivers/media/usb/cpia2/cpia2.h +++ b/drivers/media/usb/cpia2/cpia2.h @@ -444,7 +444,7 @@ int cpia2_allocate_buffers(struct camera_data *cam); void cpia2_free_buffers(struct camera_data *cam); long cpia2_read(struct camera_data *cam, char __user *buf, unsigned long count, int noblock); -unsigned int cpia2_poll(struct camera_data *cam, +__poll_t cpia2_poll(struct camera_data *cam, struct file *filp, poll_table *wait); int cpia2_remap_buffer(struct camera_data *cam, struct vm_area_struct *vma); void cpia2_set_property_flip(struct camera_data *cam, int prop_val); diff --git a/drivers/media/usb/cpia2/cpia2_core.c b/drivers/media/usb/cpia2/cpia2_core.c index 0efba0da0a45..e7524920c618 100644 --- a/drivers/media/usb/cpia2/cpia2_core.c +++ b/drivers/media/usb/cpia2/cpia2_core.c @@ -2370,10 +2370,10 @@ long cpia2_read(struct camera_data *cam, * cpia2_poll * *****************************************************************************/ -unsigned int cpia2_poll(struct camera_data *cam, struct file *filp, +__poll_t cpia2_poll(struct camera_data *cam, struct file *filp, poll_table *wait) { - unsigned int status = v4l2_ctrl_poll(filp, wait); + __poll_t status = v4l2_ctrl_poll(filp, wait); if ((poll_requested_events(wait) & (POLLIN | POLLRDNORM)) && !cam->streaming) { diff --git a/drivers/media/usb/cpia2/cpia2_v4l.c b/drivers/media/usb/cpia2/cpia2_v4l.c index 3dedd83f0b19..74c97565ccc6 100644 --- a/drivers/media/usb/cpia2/cpia2_v4l.c +++ b/drivers/media/usb/cpia2/cpia2_v4l.c @@ -169,10 +169,10 @@ static ssize_t cpia2_v4l_read(struct file *file, char __user *buf, size_t count, * cpia2_v4l_poll * *****************************************************************************/ -static unsigned int cpia2_v4l_poll(struct file *filp, struct poll_table_struct *wait) +static __poll_t cpia2_v4l_poll(struct file *filp, struct poll_table_struct *wait) { struct camera_data *cam = video_drvdata(filp); - unsigned int res; + __poll_t res; mutex_lock(&cam->v4l2_lock); res = cpia2_poll(cam, filp, wait); diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c b/drivers/media/usb/cx231xx/cx231xx-417.c index d538fa407742..103e3299b77f 100644 --- a/drivers/media/usb/cx231xx/cx231xx-417.c +++ b/drivers/media/usb/cx231xx/cx231xx-417.c @@ -1812,13 +1812,13 @@ static ssize_t mpeg_read(struct file *file, char __user *data, file->f_flags & O_NONBLOCK); } -static unsigned int mpeg_poll(struct file *file, +static __poll_t mpeg_poll(struct file *file, struct poll_table_struct *wait) { - unsigned long req_events = poll_requested_events(wait); + __poll_t req_events = poll_requested_events(wait); struct cx231xx_fh *fh = file->private_data; struct cx231xx *dev = fh->dev; - unsigned int res = 0; + __poll_t res = 0; if (v4l2_event_pending(&fh->fh)) res |= POLLPRI; diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c index 226059fc672b..d7b2e694bbb9 100644 --- a/drivers/media/usb/cx231xx/cx231xx-video.c +++ b/drivers/media/usb/cx231xx/cx231xx-video.c @@ -2006,12 +2006,12 @@ cx231xx_v4l2_read(struct file *filp, char __user *buf, size_t count, * cx231xx_v4l2_poll() * will allocate buffers when called for the first time */ -static unsigned int cx231xx_v4l2_poll(struct file *filp, poll_table *wait) +static __poll_t cx231xx_v4l2_poll(struct file *filp, poll_table *wait) { - unsigned long req_events = poll_requested_events(wait); + __poll_t req_events = poll_requested_events(wait); struct cx231xx_fh *fh = filp->private_data; struct cx231xx *dev = fh->dev; - unsigned res = 0; + __poll_t res = 0; int rc; rc = check_dev(dev); diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c index 961343873fd0..b72d02e225fd 100644 --- a/drivers/media/usb/gspca/gspca.c +++ b/drivers/media/usb/gspca/gspca.c @@ -1862,11 +1862,11 @@ out: return ret; } -static unsigned int dev_poll(struct file *file, poll_table *wait) +static __poll_t dev_poll(struct file *file, poll_table *wait) { struct gspca_dev *gspca_dev = video_drvdata(file); - unsigned long req_events = poll_requested_events(wait); - int ret = 0; + __poll_t req_events = poll_requested_events(wait); + __poll_t ret = 0; PDEBUG(D_FRAM, "poll"); diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c index 7fb036d6a86e..d0d638c2e900 100644 --- a/drivers/media/usb/hdpvr/hdpvr-video.c +++ b/drivers/media/usb/hdpvr/hdpvr-video.c @@ -521,12 +521,12 @@ err: return ret; } -static unsigned int hdpvr_poll(struct file *filp, poll_table *wait) +static __poll_t hdpvr_poll(struct file *filp, poll_table *wait) { - unsigned long req_events = poll_requested_events(wait); + __poll_t req_events = poll_requested_events(wait); struct hdpvr_buffer *buf = NULL; struct hdpvr_device *dev = video_drvdata(filp); - unsigned int mask = v4l2_ctrl_poll(filp, wait); + __poll_t mask = v4l2_ctrl_poll(filp, wait); if (!(req_events & (POLLIN | POLLRDNORM))) return mask; diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c index 4320bda9352d..11cdfe356801 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c @@ -1190,9 +1190,9 @@ static ssize_t pvr2_v4l2_read(struct file *file, } -static unsigned int pvr2_v4l2_poll(struct file *file, poll_table *wait) +static __poll_t pvr2_v4l2_poll(struct file *file, poll_table *wait) { - unsigned int mask = 0; + __poll_t mask = 0; struct pvr2_v4l2_fh *fh = file->private_data; int ret; diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c index c0bba773db25..cba0916d33e5 100644 --- a/drivers/media/usb/stkwebcam/stk-webcam.c +++ b/drivers/media/usb/stkwebcam/stk-webcam.c @@ -721,10 +721,10 @@ static ssize_t v4l_stk_read(struct file *fp, char __user *buf, return ret; } -static unsigned int v4l_stk_poll(struct file *fp, poll_table *wait) +static __poll_t v4l_stk_poll(struct file *fp, poll_table *wait) { struct stk_camera *dev = video_drvdata(fp); - unsigned res = v4l2_ctrl_poll(fp, wait); + __poll_t res = v4l2_ctrl_poll(fp, wait); poll_wait(fp, &dev->wait_frame, wait); diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c index 9fa25de6b5a9..317bf5a3933e 100644 --- a/drivers/media/usb/tm6000/tm6000-video.c +++ b/drivers/media/usb/tm6000/tm6000-video.c @@ -1423,13 +1423,13 @@ tm6000_read(struct file *file, char __user *data, size_t count, loff_t *pos) return 0; } -static unsigned int +static __poll_t __tm6000_poll(struct file *file, struct poll_table_struct *wait) { - unsigned long req_events = poll_requested_events(wait); + __poll_t req_events = poll_requested_events(wait); struct tm6000_fh *fh = file->private_data; struct tm6000_buffer *buf; - int res = 0; + __poll_t res = 0; if (v4l2_event_pending(&fh->fh)) res = POLLPRI; @@ -1457,11 +1457,11 @@ __tm6000_poll(struct file *file, struct poll_table_struct *wait) return res; } -static unsigned int tm6000_poll(struct file *file, struct poll_table_struct *wait) +static __poll_t tm6000_poll(struct file *file, struct poll_table_struct *wait) { struct tm6000_fh *fh = file->private_data; struct tm6000_core *dev = fh->dev; - unsigned int res; + __poll_t res; mutex_lock(&dev->lock); res = __tm6000_poll(file, wait); diff --git a/drivers/media/usb/uvc/uvc_queue.c b/drivers/media/usb/uvc/uvc_queue.c index c8d78b2f3de4..692c463f14f7 100644 --- a/drivers/media/usb/uvc/uvc_queue.c +++ b/drivers/media/usb/uvc/uvc_queue.c @@ -340,10 +340,10 @@ unsigned long uvc_queue_get_unmapped_area(struct uvc_video_queue *queue, } #endif -unsigned int uvc_queue_poll(struct uvc_video_queue *queue, struct file *file, +__poll_t uvc_queue_poll(struct uvc_video_queue *queue, struct file *file, poll_table *wait) { - unsigned int ret; + __poll_t ret; mutex_lock(&queue->mutex); ret = vb2_poll(&queue->queue, file, wait); diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c index 3e7e283a44a8..ed3bf05e2462 100644 --- a/drivers/media/usb/uvc/uvc_v4l2.c +++ b/drivers/media/usb/uvc/uvc_v4l2.c @@ -1423,7 +1423,7 @@ static int uvc_v4l2_mmap(struct file *file, struct vm_area_struct *vma) return uvc_queue_mmap(&stream->queue, vma); } -static unsigned int uvc_v4l2_poll(struct file *file, poll_table *wait) +static __poll_t uvc_v4l2_poll(struct file *file, poll_table *wait) { struct uvc_fh *handle = file->private_data; struct uvc_streaming *stream = handle->stream; diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h index 05398784d1c8..9b44a7cd5ec1 100644 --- a/drivers/media/usb/uvc/uvcvideo.h +++ b/drivers/media/usb/uvc/uvcvideo.h @@ -678,7 +678,7 @@ extern struct uvc_buffer *uvc_queue_next_buffer(struct uvc_video_queue *queue, struct uvc_buffer *buf); extern int uvc_queue_mmap(struct uvc_video_queue *queue, struct vm_area_struct *vma); -extern unsigned int uvc_queue_poll(struct uvc_video_queue *queue, +extern __poll_t uvc_queue_poll(struct uvc_video_queue *queue, struct file *file, poll_table *wait); #ifndef CONFIG_MMU extern unsigned long uvc_queue_get_unmapped_area(struct uvc_video_queue *queue, diff --git a/drivers/media/usb/zr364xx/zr364xx.c b/drivers/media/usb/zr364xx/zr364xx.c index 1d888661fd03..8b7c19943d46 100644 --- a/drivers/media/usb/zr364xx/zr364xx.c +++ b/drivers/media/usb/zr364xx/zr364xx.c @@ -1287,12 +1287,12 @@ static int zr364xx_mmap(struct file *file, struct vm_area_struct *vma) return ret; } -static unsigned int zr364xx_poll(struct file *file, +static __poll_t zr364xx_poll(struct file *file, struct poll_table_struct *wait) { struct zr364xx_camera *cam = video_drvdata(file); struct videobuf_queue *q = &cam->vb_vidq; - unsigned res = v4l2_ctrl_poll(file, wait); + __poll_t res = v4l2_ctrl_poll(file, wait); _DBG("%s\n", __func__); |