From a9a08845e9acbd224e4ee466f5c1275ed50054e8 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 11 Feb 2018 14:34:03 -0800 Subject: vfs: do bulk POLL* -> EPOLL* replacement This is the mindless scripted replacement of kernel use of POLL* variables as described by Al, done by this script: for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'` for f in $L; do sed -i "-es/^\([^\"]*\)\(\\)/\\1E\\2/" $f; done done with de-mangling cleanups yet to come. NOTE! On almost all architectures, the EPOLL* constants have the same values as the POLL* constants do. But they keyword here is "almost". For various bad reasons they aren't the same, and epoll() doesn't actually work quite correctly in some cases due to this on Sparc et al. The next patch from Al will sort out the final differences, and we should be all done. Scripted-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/media/usb/cpia2/cpia2_core.c | 4 ++-- drivers/media/usb/cx231xx/cx231xx-417.c | 4 ++-- drivers/media/usb/cx231xx/cx231xx-video.c | 10 +++++----- drivers/media/usb/gspca/gspca.c | 12 ++++++------ drivers/media/usb/hdpvr/hdpvr-video.c | 4 ++-- drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 6 +++--- drivers/media/usb/stkwebcam/stk-webcam.c | 4 ++-- drivers/media/usb/tm6000/tm6000-video.c | 14 +++++++------- 8 files changed, 29 insertions(+), 29 deletions(-) (limited to 'drivers/media/usb') diff --git a/drivers/media/usb/cpia2/cpia2_core.c b/drivers/media/usb/cpia2/cpia2_core.c index e7524920c618..3dfbb545c0e3 100644 --- a/drivers/media/usb/cpia2/cpia2_core.c +++ b/drivers/media/usb/cpia2/cpia2_core.c @@ -2375,7 +2375,7 @@ __poll_t cpia2_poll(struct camera_data *cam, struct file *filp, { __poll_t status = v4l2_ctrl_poll(filp, wait); - if ((poll_requested_events(wait) & (POLLIN | POLLRDNORM)) && + if ((poll_requested_events(wait) & (EPOLLIN | EPOLLRDNORM)) && !cam->streaming) { /* Start streaming */ cpia2_usb_stream_start(cam, @@ -2385,7 +2385,7 @@ __poll_t cpia2_poll(struct camera_data *cam, struct file *filp, poll_wait(filp, &cam->wq_stream, wait); if (cam->curbuff->status == FRAME_READY) - status |= POLLIN | POLLRDNORM; + status |= EPOLLIN | EPOLLRDNORM; return status; } diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c b/drivers/media/usb/cx231xx/cx231xx-417.c index 103e3299b77f..b80e6857e2eb 100644 --- a/drivers/media/usb/cx231xx/cx231xx-417.c +++ b/drivers/media/usb/cx231xx/cx231xx-417.c @@ -1821,11 +1821,11 @@ static __poll_t mpeg_poll(struct file *file, __poll_t res = 0; if (v4l2_event_pending(&fh->fh)) - res |= POLLPRI; + res |= EPOLLPRI; else poll_wait(file, &fh->fh.wait, wait); - if (!(req_events & (POLLIN | POLLRDNORM))) + if (!(req_events & (EPOLLIN | EPOLLRDNORM))) return res; mutex_lock(&dev->lock); diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c index 271f35208c49..5b321b8ada3a 100644 --- a/drivers/media/usb/cx231xx/cx231xx-video.c +++ b/drivers/media/usb/cx231xx/cx231xx-video.c @@ -2018,19 +2018,19 @@ static __poll_t cx231xx_v4l2_poll(struct file *filp, poll_table *wait) rc = check_dev(dev); if (rc < 0) - return POLLERR; + return EPOLLERR; rc = res_get(fh); if (unlikely(rc < 0)) - return POLLERR; + return EPOLLERR; if (v4l2_event_pending(&fh->fh)) - res |= POLLPRI; + res |= EPOLLPRI; else poll_wait(filp, &fh->fh.wait, wait); - if (!(req_events & (POLLIN | POLLRDNORM))) + if (!(req_events & (EPOLLIN | EPOLLRDNORM))) return res; if ((V4L2_BUF_TYPE_VIDEO_CAPTURE == fh->type) || @@ -2040,7 +2040,7 @@ static __poll_t cx231xx_v4l2_poll(struct file *filp, poll_table *wait) mutex_unlock(&dev->lock); return res; } - return res | POLLERR; + return res | EPOLLERR; } /* diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c index 87e18d0c5766..d29773b8f696 100644 --- a/drivers/media/usb/gspca/gspca.c +++ b/drivers/media/usb/gspca/gspca.c @@ -1877,14 +1877,14 @@ static __poll_t dev_poll(struct file *file, poll_table *wait) gspca_dbg(gspca_dev, D_FRAM, "poll\n"); - if (req_events & POLLPRI) + if (req_events & EPOLLPRI) ret |= v4l2_ctrl_poll(file, wait); - if (req_events & (POLLIN | POLLRDNORM)) { + if (req_events & (EPOLLIN | EPOLLRDNORM)) { /* if reqbufs is not done, the user would use read() */ if (gspca_dev->memory == GSPCA_MEMORY_NO) { if (read_alloc(gspca_dev, file) != 0) { - ret |= POLLERR; + ret |= EPOLLERR; goto out; } } @@ -1893,17 +1893,17 @@ static __poll_t dev_poll(struct file *file, poll_table *wait) /* check if an image has been received */ if (mutex_lock_interruptible(&gspca_dev->queue_lock) != 0) { - ret |= POLLERR; + ret |= EPOLLERR; goto out; } if (gspca_dev->fr_o != atomic_read(&gspca_dev->fr_i)) - ret |= POLLIN | POLLRDNORM; + ret |= EPOLLIN | EPOLLRDNORM; mutex_unlock(&gspca_dev->queue_lock); } out: if (!gspca_dev->present) - ret |= POLLHUP; + ret |= EPOLLHUP; return ret; } diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c index 660d4a65401f..77c3d331ff31 100644 --- a/drivers/media/usb/hdpvr/hdpvr-video.c +++ b/drivers/media/usb/hdpvr/hdpvr-video.c @@ -528,7 +528,7 @@ static __poll_t hdpvr_poll(struct file *filp, poll_table *wait) struct hdpvr_device *dev = video_drvdata(filp); __poll_t mask = v4l2_ctrl_poll(filp, wait); - if (!(req_events & (POLLIN | POLLRDNORM))) + if (!(req_events & (EPOLLIN | EPOLLRDNORM))) return mask; mutex_lock(&dev->io_mutex); @@ -553,7 +553,7 @@ static __poll_t hdpvr_poll(struct file *filp, poll_table *wait) buf = hdpvr_get_next_buffer(dev); } if (buf && buf->status == BUFSTAT_READY) - mask |= POLLIN | POLLRDNORM; + mask |= EPOLLIN | EPOLLRDNORM; return mask; } diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c index ad6290e1b699..9fdc57c1658f 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c @@ -1181,19 +1181,19 @@ static __poll_t pvr2_v4l2_poll(struct file *file, poll_table *wait) int ret; if (fh->fw_mode_flag) { - mask |= POLLIN | POLLRDNORM; + mask |= EPOLLIN | EPOLLRDNORM; return mask; } if (!fh->rhp) { ret = pvr2_v4l2_iosetup(fh); - if (ret) return POLLERR; + if (ret) return EPOLLERR; } poll_wait(file,&fh->wait_data,wait); if (pvr2_ioread_avail(fh->rhp) >= 0) { - mask |= POLLIN | POLLRDNORM; + mask |= EPOLLIN | EPOLLRDNORM; } return mask; diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c index 17ad978c0172..22389b56ec24 100644 --- a/drivers/media/usb/stkwebcam/stk-webcam.c +++ b/drivers/media/usb/stkwebcam/stk-webcam.c @@ -729,10 +729,10 @@ static __poll_t v4l_stk_poll(struct file *fp, poll_table *wait) poll_wait(fp, &dev->wait_frame, wait); if (!is_present(dev)) - return POLLERR; + return EPOLLERR; if (!list_empty(&dev->sio_full)) - return res | POLLIN | POLLRDNORM; + return res | EPOLLIN | EPOLLRDNORM; return res; } diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c index 96266fa4738c..8314d3fa9241 100644 --- a/drivers/media/usb/tm6000/tm6000-video.c +++ b/drivers/media/usb/tm6000/tm6000-video.c @@ -1424,25 +1424,25 @@ __tm6000_poll(struct file *file, struct poll_table_struct *wait) __poll_t res = 0; if (v4l2_event_pending(&fh->fh)) - res = POLLPRI; - else if (req_events & POLLPRI) + res = EPOLLPRI; + else if (req_events & EPOLLPRI) poll_wait(file, &fh->fh.wait, wait); if (V4L2_BUF_TYPE_VIDEO_CAPTURE != fh->type) - return res | POLLERR; + return res | EPOLLERR; if (!!is_res_streaming(fh->dev, fh)) - return res | POLLERR; + return res | EPOLLERR; if (!is_res_read(fh->dev, fh)) { /* streaming capture */ if (list_empty(&fh->vb_vidq.stream)) - return res | POLLERR; + return res | EPOLLERR; buf = list_entry(fh->vb_vidq.stream.next, struct tm6000_buffer, vb.stream); poll_wait(file, &buf->vb.done, wait); if (buf->vb.state == VIDEOBUF_DONE || buf->vb.state == VIDEOBUF_ERROR) - return res | POLLIN | POLLRDNORM; - } else if (req_events & (POLLIN | POLLRDNORM)) { + return res | EPOLLIN | EPOLLRDNORM; + } else if (req_events & (EPOLLIN | EPOLLRDNORM)) { /* read() capture */ return res | videobuf_poll_stream(file, &fh->vb_vidq, wait); } -- cgit v1.2.3