aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/ivtv
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-02-11 17:34:03 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-11 17:34:03 -0500
commita9a08845e9acbd224e4ee466f5c1275ed50054e8 (patch)
tree415d6e6a82e001c65e6b161539411f54ba5fe8ce /drivers/media/pci/ivtv
parentee5daa1361fceb6f482c005bcc9ba8d01b92ea5c (diff)
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/^\([^\"]*\)\(\<POLL$V\>\)/\\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 <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/media/pci/ivtv')
-rw-r--r--drivers/media/pci/ivtv/ivtv-fileops.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/media/pci/ivtv/ivtv-fileops.c b/drivers/media/pci/ivtv/ivtv-fileops.c
index 4aa773507201..6196daae4b3e 100644
--- a/drivers/media/pci/ivtv/ivtv-fileops.c
+++ b/drivers/media/pci/ivtv/ivtv-fileops.c
@@ -747,7 +747,7 @@ __poll_t ivtv_v4l2_dec_poll(struct file *filp, poll_table *wait)
747 /* Turn off the old-style vsync events */ 747 /* Turn off the old-style vsync events */
748 clear_bit(IVTV_F_I_EV_VSYNC_ENABLED, &itv->i_flags); 748 clear_bit(IVTV_F_I_EV_VSYNC_ENABLED, &itv->i_flags);
749 if (v4l2_event_pending(&id->fh)) 749 if (v4l2_event_pending(&id->fh))
750 res = POLLPRI; 750 res = EPOLLPRI;
751 } else { 751 } else {
752 /* This is the old-style API which is here only for backwards 752 /* This is the old-style API which is here only for backwards
753 compatibility. */ 753 compatibility. */
@@ -755,12 +755,12 @@ __poll_t ivtv_v4l2_dec_poll(struct file *filp, poll_table *wait)
755 set_bit(IVTV_F_I_EV_VSYNC_ENABLED, &itv->i_flags); 755 set_bit(IVTV_F_I_EV_VSYNC_ENABLED, &itv->i_flags);
756 if (test_bit(IVTV_F_I_EV_VSYNC, &itv->i_flags) || 756 if (test_bit(IVTV_F_I_EV_VSYNC, &itv->i_flags) ||
757 test_bit(IVTV_F_I_EV_DEC_STOPPED, &itv->i_flags)) 757 test_bit(IVTV_F_I_EV_DEC_STOPPED, &itv->i_flags))
758 res = POLLPRI; 758 res = EPOLLPRI;
759 } 759 }
760 760
761 /* Allow write if buffers are available for writing */ 761 /* Allow write if buffers are available for writing */
762 if (s->q_free.buffers) 762 if (s->q_free.buffers)
763 res |= POLLOUT | POLLWRNORM; 763 res |= EPOLLOUT | EPOLLWRNORM;
764 return res; 764 return res;
765} 765}
766 766
@@ -776,7 +776,7 @@ __poll_t ivtv_v4l2_enc_poll(struct file *filp, poll_table *wait)
776 /* Start a capture if there is none */ 776 /* Start a capture if there is none */
777 if (!eof && !test_bit(IVTV_F_S_STREAMING, &s->s_flags) && 777 if (!eof && !test_bit(IVTV_F_S_STREAMING, &s->s_flags) &&
778 s->type != IVTV_ENC_STREAM_TYPE_RAD && 778 s->type != IVTV_ENC_STREAM_TYPE_RAD &&
779 (req_events & (POLLIN | POLLRDNORM))) { 779 (req_events & (EPOLLIN | EPOLLRDNORM))) {
780 int rc; 780 int rc;
781 781
782 mutex_lock(&itv->serialize_lock); 782 mutex_lock(&itv->serialize_lock);
@@ -785,7 +785,7 @@ __poll_t ivtv_v4l2_enc_poll(struct file *filp, poll_table *wait)
785 if (rc) { 785 if (rc) {
786 IVTV_DEBUG_INFO("Could not start capture for %s (%d)\n", 786 IVTV_DEBUG_INFO("Could not start capture for %s (%d)\n",
787 s->name, rc); 787 s->name, rc);
788 return POLLERR; 788 return EPOLLERR;
789 } 789 }
790 IVTV_DEBUG_FILE("Encoder poll started capture\n"); 790 IVTV_DEBUG_FILE("Encoder poll started capture\n");
791 } 791 }
@@ -794,14 +794,14 @@ __poll_t ivtv_v4l2_enc_poll(struct file *filp, poll_table *wait)
794 IVTV_DEBUG_HI_FILE("Encoder poll\n"); 794 IVTV_DEBUG_HI_FILE("Encoder poll\n");
795 poll_wait(filp, &s->waitq, wait); 795 poll_wait(filp, &s->waitq, wait);
796 if (v4l2_event_pending(&id->fh)) 796 if (v4l2_event_pending(&id->fh))
797 res |= POLLPRI; 797 res |= EPOLLPRI;
798 else 798 else
799 poll_wait(filp, &id->fh.wait, wait); 799 poll_wait(filp, &id->fh.wait, wait);
800 800
801 if (s->q_full.length || s->q_io.length) 801 if (s->q_full.length || s->q_io.length)
802 return res | POLLIN | POLLRDNORM; 802 return res | EPOLLIN | EPOLLRDNORM;
803 if (eof) 803 if (eof)
804 return res | POLLHUP; 804 return res | EPOLLHUP;
805 return res; 805 return res;
806} 806}
807 807