aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-01-30 20:58:07 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-01-30 20:58:07 -0500
commit168fe32a072a4b8dc81a3aebf0e5e588d38e2955 (patch)
tree297f0f6192256785979f5ebfb92797f81754548d
parent13ddd1667e7f01071cdf120132238ffca004a88e (diff)
parentc71d227fc4133f949dae620ed5e3a250b43f2415 (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 ...
-rw-r--r--arch/alpha/include/uapi/asm/Kbuild1
-rw-r--r--arch/alpha/include/uapi/asm/poll.h2
-rw-r--r--arch/blackfin/include/uapi/asm/poll.h21
-rw-r--r--arch/cris/arch-v10/drivers/gpio.c6
-rw-r--r--arch/cris/arch-v10/drivers/sync_serial.c8
-rw-r--r--arch/cris/arch-v32/drivers/sync_serial.c8
-rw-r--r--arch/frv/include/uapi/asm/poll.h21
-rw-r--r--arch/ia64/include/uapi/asm/Kbuild1
-rw-r--r--arch/ia64/include/uapi/asm/poll.h2
-rw-r--r--arch/ia64/kernel/perfmon.c4
-rw-r--r--arch/m32r/include/uapi/asm/Kbuild1
-rw-r--r--arch/m32r/include/uapi/asm/poll.h2
-rw-r--r--arch/m68k/include/uapi/asm/poll.h19
-rw-r--r--arch/mips/include/uapi/asm/poll.h19
-rw-r--r--arch/mips/kernel/rtlx.c4
-rw-r--r--arch/mn10300/include/uapi/asm/Kbuild1
-rw-r--r--arch/mn10300/include/uapi/asm/poll.h2
-rw-r--r--arch/powerpc/kernel/rtasd.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/backing_ops.c6
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c16
-rw-r--r--arch/powerpc/platforms/cell/spufs/hw_ops.c5
-rw-r--r--arch/powerpc/platforms/cell/spufs/spufs.h3
-rw-r--r--arch/powerpc/platforms/powernv/opal-prd.c2
-rw-r--r--arch/score/include/uapi/asm/Kbuild1
-rw-r--r--arch/score/include/uapi/asm/poll.h7
-rw-r--r--arch/sparc/include/uapi/asm/poll.h28
-rw-r--r--arch/um/Makefile7
-rw-r--r--arch/um/drivers/hostaudio_kern.c6
-rw-r--r--arch/x86/include/uapi/asm/Kbuild1
-rw-r--r--arch/x86/include/uapi/asm/poll.h1
-rw-r--r--arch/x86/kernel/apm_32.c2
-rw-r--r--arch/x86/kernel/cpu/mcheck/dev-mcelog.c2
-rw-r--r--arch/xtensa/include/uapi/asm/poll.h21
-rw-r--r--block/bsg.c4
-rw-r--r--crypto/af_alg.c4
-rw-r--r--crypto/algif_skcipher.c1
-rw-r--r--drivers/acpi/acpi_dbg.c4
-rw-r--r--drivers/android/binder.c2
-rw-r--r--drivers/bluetooth/hci_ldisc.c2
-rw-r--r--drivers/bluetooth/hci_vhci.c2
-rw-r--r--drivers/char/apm-emulation.c2
-rw-r--r--drivers/char/dsp56k.c2
-rw-r--r--drivers/char/dtlk.c6
-rw-r--r--drivers/char/hpet.c2
-rw-r--r--drivers/char/ipmi/bt-bmc.c4
-rw-r--r--drivers/char/ipmi/ipmi_devintf.c4
-rw-r--r--drivers/char/ipmi/ipmi_watchdog.c4
-rw-r--r--drivers/char/pcmcia/cm4040_cs.c4
-rw-r--r--drivers/char/ppdev.c4
-rw-r--r--drivers/char/random.c4
-rw-r--r--drivers/char/rtc.c4
-rw-r--r--drivers/char/snsc.c4
-rw-r--r--drivers/char/sonypi.c2
-rw-r--r--drivers/char/tpm/tpm_vtpm_proxy.c4
-rw-r--r--drivers/char/virtio_console.c4
-rw-r--r--drivers/char/xillybus/xillybus_core.c4
-rw-r--r--drivers/dma-buf/dma-buf.c6
-rw-r--r--drivers/dma-buf/sync_file.c2
-rw-r--r--drivers/firewire/core-cdev.c4
-rw-r--r--drivers/firewire/nosy.c4
-rw-r--r--drivers/gpio/gpiolib.c4
-rw-r--r--drivers/gpu/drm/drm_file.c4
-rw-r--r--drivers/gpu/drm/i915/i915_perf.c8
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_drv.h2
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c2
-rw-r--r--drivers/gpu/vga/vgaarb.c2
-rw-r--r--drivers/hid/hid-debug.c2
-rw-r--r--drivers/hid/hid-roccat.c2
-rw-r--r--drivers/hid/hid-sensor-custom.c4
-rw-r--r--drivers/hid/hidraw.c2
-rw-r--r--drivers/hid/uhid.c2
-rw-r--r--drivers/hid/usbhid/hiddev.c2
-rw-r--r--drivers/hsi/clients/cmt_speech.c4
-rw-r--r--drivers/hv/hv_utils_transport.c2
-rw-r--r--drivers/iio/iio_core.h2
-rw-r--r--drivers/iio/industrialio-buffer.c2
-rw-r--r--drivers/iio/industrialio-event.c4
-rw-r--r--drivers/infiniband/core/ucm.c4
-rw-r--r--drivers/infiniband/core/ucma.c4
-rw-r--r--drivers/infiniband/core/user_mad.c4
-rw-r--r--drivers/infiniband/core/uverbs_main.c8
-rw-r--r--drivers/infiniband/hw/hfi1/file_ops.c18
-rw-r--r--drivers/infiniband/hw/qib/qib_file_ops.c14
-rw-r--r--drivers/input/evdev.c4
-rw-r--r--drivers/input/input.c2
-rw-r--r--drivers/input/joydev.c2
-rw-r--r--drivers/input/misc/hp_sdc_rtc.c2
-rw-r--r--drivers/input/misc/uinput.c2
-rw-r--r--drivers/input/mousedev.c4
-rw-r--r--drivers/input/serio/serio_raw.c4
-rw-r--r--drivers/input/serio/userio.c2
-rw-r--r--drivers/isdn/capi/capi.c4
-rw-r--r--drivers/isdn/divert/divert_procfs.c4
-rw-r--r--drivers/isdn/hardware/eicon/divamnt.c4
-rw-r--r--drivers/isdn/hardware/eicon/divasi.c4
-rw-r--r--drivers/isdn/hardware/eicon/divasmain.c2
-rw-r--r--drivers/isdn/hardware/eicon/divasproc.c2
-rw-r--r--drivers/isdn/hysdn/hysdn_proclog.c4
-rw-r--r--drivers/isdn/i4l/isdn_common.c4
-rw-r--r--drivers/isdn/i4l/isdn_ppp.c4
-rw-r--r--drivers/isdn/i4l/isdn_ppp.h2
-rw-r--r--drivers/isdn/mISDN/timerdev.c4
-rw-r--r--drivers/leds/uleds.c2
-rw-r--r--drivers/macintosh/smu.c4
-rw-r--r--drivers/macintosh/via-pmu.c4
-rw-r--r--drivers/mailbox/mailbox-test.c2
-rw-r--r--drivers/md/dm-ioctl.c4
-rw-r--r--drivers/md/md.c4
-rw-r--r--drivers/media/cec/cec-api.c4
-rw-r--r--drivers/media/common/saa7146/saa7146_fops.c8
-rw-r--r--drivers/media/common/siano/smsdvb-debugfs.c7
-rw-r--r--drivers/media/dvb-core/dmxdev.c8
-rw-r--r--drivers/media/dvb-core/dvb_ca_en50221.c4
-rw-r--r--drivers/media/dvb-core/dvb_frontend.c2
-rw-r--r--drivers/media/firewire/firedtv-ci.c2
-rw-r--r--drivers/media/media-devnode.c2
-rw-r--r--drivers/media/pci/bt8xx/bttv-driver.c12
-rw-r--r--drivers/media/pci/cx18/cx18-fileops.c8
-rw-r--r--drivers/media/pci/cx18/cx18-fileops.h2
-rw-r--r--drivers/media/pci/ddbridge/ddbridge-core.c4
-rw-r--r--drivers/media/pci/ivtv/ivtv-fileops.c10
-rw-r--r--drivers/media/pci/ivtv/ivtv-fileops.h4
-rw-r--r--drivers/media/pci/meye/meye.c4
-rw-r--r--drivers/media/pci/saa7134/saa7134-video.c4
-rw-r--r--drivers/media/pci/saa7164/saa7164-encoder.c6
-rw-r--r--drivers/media/pci/saa7164/saa7164-vbi.c4
-rw-r--r--drivers/media/pci/ttpci/av7110_av.c8
-rw-r--r--drivers/media/pci/ttpci/av7110_ca.c4
-rw-r--r--drivers/media/pci/zoran/zoran_driver.c4
-rw-r--r--drivers/media/platform/davinci/vpfe_capture.c2
-rw-r--r--drivers/media/platform/exynos-gsc/gsc-m2m.c4
-rw-r--r--drivers/media/platform/fsl-viu.c6
-rw-r--r--drivers/media/platform/m2m-deinterlace.c4
-rw-r--r--drivers/media/platform/mx2_emmaprp.c4
-rw-r--r--drivers/media/platform/omap/omap_vout.c2
-rw-r--r--drivers/media/platform/omap3isp/ispvideo.c4
-rw-r--r--drivers/media/platform/s3c-camif/camif-capture.c4
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc.c4
-rw-r--r--drivers/media/platform/sh_veu.c2
-rw-r--r--drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c2
-rw-r--r--drivers/media/platform/soc_camera/soc_camera.c4
-rw-r--r--drivers/media/platform/via-camera.c2
-rw-r--r--drivers/media/platform/vivid/vivid-core.c2
-rw-r--r--drivers/media/platform/vivid/vivid-radio-rx.c2
-rw-r--r--drivers/media/platform/vivid/vivid-radio-rx.h2
-rw-r--r--drivers/media/platform/vivid/vivid-radio-tx.c2
-rw-r--r--drivers/media/platform/vivid/vivid-radio-tx.h2
-rw-r--r--drivers/media/radio/radio-cadet.c6
-rw-r--r--drivers/media/radio/radio-si476x.c6
-rw-r--r--drivers/media/radio/radio-wl1273.c2
-rw-r--r--drivers/media/radio/si470x/radio-si470x-common.c6
-rw-r--r--drivers/media/radio/wl128x/fmdrv_v4l2.c2
-rw-r--r--drivers/media/rc/lirc_dev.c4
-rw-r--r--drivers/media/usb/cpia2/cpia2.h2
-rw-r--r--drivers/media/usb/cpia2/cpia2_core.c4
-rw-r--r--drivers/media/usb/cpia2/cpia2_v4l.c4
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-417.c6
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-video.c6
-rw-r--r--drivers/media/usb/gspca/gspca.c6
-rw-r--r--drivers/media/usb/hdpvr/hdpvr-video.c6
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-v4l2.c4
-rw-r--r--drivers/media/usb/stkwebcam/stk-webcam.c4
-rw-r--r--drivers/media/usb/tm6000/tm6000-video.c10
-rw-r--r--drivers/media/usb/uvc/uvc_queue.c4
-rw-r--r--drivers/media/usb/uvc/uvc_v4l2.c2
-rw-r--r--drivers/media/usb/uvc/uvcvideo.h2
-rw-r--r--drivers/media/usb/zr364xx/zr364xx.c4
-rw-r--r--drivers/media/v4l2-core/v4l2-ctrls.c2
-rw-r--r--drivers/media/v4l2-core/v4l2-dev.c4
-rw-r--r--drivers/media/v4l2-core/v4l2-mem2mem.c10
-rw-r--r--drivers/media/v4l2-core/v4l2-subdev.c2
-rw-r--r--drivers/media/v4l2-core/videobuf-core.c6
-rw-r--r--drivers/media/v4l2-core/videobuf2-core.c4
-rw-r--r--drivers/media/v4l2-core/videobuf2-v4l2.c10
-rw-r--r--drivers/misc/cxl/api.c2
-rw-r--r--drivers/misc/cxl/cxl.h2
-rw-r--r--drivers/misc/cxl/file.c4
-rw-r--r--drivers/misc/hpilo.c2
-rw-r--r--drivers/misc/lis3lv02d/lis3lv02d.c2
-rw-r--r--drivers/misc/mei/main.c6
-rw-r--r--drivers/misc/mic/scif/scif_api.c7
-rw-r--r--drivers/misc/mic/scif/scif_epd.h2
-rw-r--r--drivers/misc/mic/scif/scif_fd.c2
-rw-r--r--drivers/misc/mic/vop/vop_vringh.c4
-rw-r--r--drivers/misc/phantom.c4
-rw-r--r--drivers/misc/vmw_vmci/vmci_host.c4
-rw-r--r--drivers/net/ieee802154/ca8210.c4
-rw-r--r--drivers/net/ppp/ppp_async.c2
-rw-r--r--drivers/net/ppp/ppp_generic.c4
-rw-r--r--drivers/net/ppp/ppp_synctty.c2
-rw-r--r--drivers/net/tap.c4
-rw-r--r--drivers/net/tun.c4
-rw-r--r--drivers/net/wan/cosa.c2
-rw-r--r--drivers/net/wireless/ralink/rt2x00/rt2x00debug.c2
-rw-r--r--drivers/pci/switch/switchtec.c4
-rw-r--r--drivers/platform/chrome/cros_ec_debugfs.c4
-rw-r--r--drivers/platform/goldfish/goldfish_pipe.c4
-rw-r--r--drivers/platform/x86/sony-laptop.c2
-rw-r--r--drivers/pps/pps.c2
-rw-r--r--drivers/ptp/ptp_chardev.c2
-rw-r--r--drivers/ptp/ptp_private.h2
-rw-r--r--drivers/rapidio/devices/rio_mport_cdev.c2
-rw-r--r--drivers/rpmsg/qcom_smd.c4
-rw-r--r--drivers/rpmsg/rpmsg_char.c4
-rw-r--r--drivers/rpmsg/rpmsg_core.c2
-rw-r--r--drivers/rpmsg/rpmsg_internal.h2
-rw-r--r--drivers/rtc/rtc-dev.c2
-rw-r--r--drivers/s390/block/dasd_eer.c4
-rw-r--r--drivers/s390/char/monreader.c2
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c4
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_ctl.c2
-rw-r--r--drivers/scsi/sg.c6
-rw-r--r--drivers/staging/comedi/comedi_fops.c4
-rw-r--r--drivers/staging/comedi/drivers/serial2002.c2
-rw-r--r--drivers/staging/irda/net/af_irda.c4
-rw-r--r--drivers/staging/irda/net/irnet/irnet_ppp.c8
-rw-r--r--drivers/staging/irda/net/irnet/irnet_ppp.h2
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c2
-rw-r--r--drivers/staging/media/bcm2048/radio-bcm2048.c4
-rw-r--r--drivers/staging/media/davinci_vpfe/vpfe_video.c2
-rw-r--r--drivers/staging/media/lirc/lirc_zilog.c4
-rw-r--r--drivers/staging/media/omap4iss/iss_video.c2
-rw-r--r--drivers/staging/most/aim-cdev/cdev.c4
-rw-r--r--drivers/staging/most/aim-v4l2/video.c4
-rw-r--r--drivers/staging/speakup/speakup_soft.c4
-rw-r--r--drivers/tty/n_gsm.c4
-rw-r--r--drivers/tty/n_hdlc.c6
-rw-r--r--drivers/tty/n_r3964.c6
-rw-r--r--drivers/tty/n_tty.c4
-rw-r--r--drivers/tty/tty_io.c8
-rw-r--r--drivers/tty/vt/vc_screen.c4
-rw-r--r--drivers/uio/uio.c2
-rw-r--r--drivers/usb/class/cdc-wdm.c4
-rw-r--r--drivers/usb/class/usblp.c4
-rw-r--r--drivers/usb/class/usbtmc.c4
-rw-r--r--drivers/usb/core/devices.c2
-rw-r--r--drivers/usb/core/devio.c4
-rw-r--r--drivers/usb/gadget/function/f_fs.c4
-rw-r--r--drivers/usb/gadget/function/f_hid.c4
-rw-r--r--drivers/usb/gadget/function/f_printer.c4
-rw-r--r--drivers/usb/gadget/function/uvc_queue.c2
-rw-r--r--drivers/usb/gadget/function/uvc_queue.h2
-rw-r--r--drivers/usb/gadget/function/uvc_v4l2.c2
-rw-r--r--drivers/usb/gadget/legacy/inode.c4
-rw-r--r--drivers/usb/misc/iowarrior.c4
-rw-r--r--drivers/usb/misc/ldusb.c4
-rw-r--r--drivers/usb/misc/legousbtower.c6
-rw-r--r--drivers/usb/mon/mon_bin.c4
-rw-r--r--drivers/vfio/virqfd.c4
-rw-r--r--drivers/vhost/net.c2
-rw-r--r--drivers/vhost/vhost.c12
-rw-r--r--drivers/vhost/vhost.h6
-rw-r--r--drivers/virt/fsl_hypervisor.c4
-rw-r--r--drivers/xen/evtchn.c4
-rw-r--r--drivers/xen/mcelog.c2
-rw-r--r--drivers/xen/pvcalls-front.c10
-rw-r--r--drivers/xen/xenbus/xenbus_dev_frontend.c2
-rw-r--r--fs/cachefiles/daemon.c6
-rw-r--r--fs/coda/psdev.c4
-rw-r--r--fs/debugfs/file.c4
-rw-r--r--fs/dlm/plock.c4
-rw-r--r--fs/dlm/user.c2
-rw-r--r--fs/ecryptfs/miscdev.c4
-rw-r--r--fs/eventfd.c4
-rw-r--r--fs/eventpoll.c28
-rw-r--r--fs/fcntl.c4
-rw-r--r--fs/fuse/dev.c4
-rw-r--r--fs/fuse/file.c6
-rw-r--r--fs/fuse/fuse_i.h2
-rw-r--r--fs/kernfs/file.c2
-rw-r--r--fs/notify/fanotify/fanotify_user.c4
-rw-r--r--fs/notify/inotify/inotify_user.c4
-rw-r--r--fs/ocfs2/dlmfs/dlmfs.c4
-rw-r--r--fs/orangefs/devorangefs-req.c6
-rw-r--r--fs/pipe.c4
-rw-r--r--fs/proc/inode.c6
-rw-r--r--fs/proc/kmsg.c2
-rw-r--r--fs/proc/proc_sysctl.c4
-rw-r--r--fs/proc_namespace.c4
-rw-r--r--fs/select.c27
-rw-r--r--fs/signalfd.c4
-rw-r--r--fs/timerfd.c4
-rw-r--r--fs/userfaultfd.c4
-rw-r--r--include/crypto/if_alg.h2
-rw-r--r--include/drm/drm_file.h2
-rw-r--r--include/linux/dma-buf.h2
-rw-r--r--include/linux/fs.h2
-rw-r--r--include/linux/net.h2
-rw-r--r--include/linux/poll.h10
-rw-r--r--include/linux/posix-clock.h2
-rw-r--r--include/linux/ring_buffer.h2
-rw-r--r--include/linux/rpmsg.h4
-rw-r--r--include/linux/scif.h4
-rw-r--r--include/linux/skbuff.h2
-rw-r--r--include/linux/tty_ldisc.h2
-rw-r--r--include/linux/wait.h10
-rw-r--r--include/media/lirc_dev.h2
-rw-r--r--include/media/media-devnode.h2
-rw-r--r--include/media/soc_camera.h2
-rw-r--r--include/media/v4l2-ctrls.h2
-rw-r--r--include/media/v4l2-dev.h2
-rw-r--r--include/media/v4l2-mem2mem.h4
-rw-r--r--include/media/videobuf-core.h2
-rw-r--r--include/media/videobuf2-core.h2
-rw-r--r--include/media/videobuf2-v4l2.h5
-rw-r--r--include/misc/cxl.h2
-rw-r--r--include/net/bluetooth/bluetooth.h2
-rw-r--r--include/net/inet_connection_sock.h2
-rw-r--r--include/net/iucv/af_iucv.h2
-rw-r--r--include/net/sctp/sctp.h2
-rw-r--r--include/net/sock.h2
-rw-r--r--include/net/tcp.h2
-rw-r--r--include/net/udp.h2
-rw-r--r--include/sound/hwdep.h2
-rw-r--r--include/sound/info.h2
-rw-r--r--include/uapi/asm-generic/poll.h44
-rw-r--r--include/uapi/linux/types.h6
-rw-r--r--ipc/mqueue.c4
-rw-r--r--kernel/events/core.c4
-rw-r--r--kernel/printk/printk.c4
-rw-r--r--kernel/relay.c4
-rw-r--r--kernel/time/posix-clock.c4
-rw-r--r--kernel/trace/ring_buffer.c2
-rw-r--r--kernel/trace/trace.c6
-rw-r--r--mm/memcontrol.c2
-rw-r--r--mm/swapfile.c2
-rw-r--r--net/9p/trans_fd.c60
-rw-r--r--net/atm/common.c4
-rw-r--r--net/atm/common.h2
-rw-r--r--net/batman-adv/icmp_socket.c2
-rw-r--r--net/batman-adv/log.c2
-rw-r--r--net/bluetooth/af_bluetooth.c6
-rw-r--r--net/caif/caif_socket.c4
-rw-r--r--net/core/datagram.c8
-rw-r--r--net/core/sock.c2
-rw-r--r--net/dccp/dccp.h2
-rw-r--r--net/dccp/proto.c4
-rw-r--r--net/decnet/af_decnet.c4
-rw-r--r--net/ipv4/tcp.c4
-rw-r--r--net/ipv4/udp.c4
-rw-r--r--net/iucv/af_iucv.c6
-rw-r--r--net/nfc/llcp_sock.c6
-rw-r--r--net/nfc/nci/uart.c2
-rw-r--r--net/packet/af_packet.c4
-rw-r--r--net/phonet/socket.c4
-rw-r--r--net/rds/af_rds.c4
-rw-r--r--net/rfkill/core.c4
-rw-r--r--net/rxrpc/af_rxrpc.c4
-rw-r--r--net/sctp/socket.c4
-rw-r--r--net/smc/af_smc.c6
-rw-r--r--net/socket.c6
-rw-r--r--net/sunrpc/cache.c8
-rw-r--r--net/sunrpc/rpc_pipe.c4
-rw-r--r--net/tipc/socket.c4
-rw-r--r--net/unix/af_unix.c15
-rw-r--r--net/vmw_vsock/af_vsock.c4
-rw-r--r--security/apparmor/apparmorfs.c4
-rw-r--r--security/tomoyo/audit.c2
-rw-r--r--security/tomoyo/common.c4
-rw-r--r--security/tomoyo/common.h6
-rw-r--r--security/tomoyo/securityfs_if.c2
-rw-r--r--sound/core/compress_offload.c6
-rw-r--r--sound/core/control.c4
-rw-r--r--sound/core/hwdep.c2
-rw-r--r--sound/core/info.c4
-rw-r--r--sound/core/init.c2
-rw-r--r--sound/core/oss/pcm_oss.c4
-rw-r--r--sound/core/pcm_native.c8
-rw-r--r--sound/core/rawmidi.c4
-rw-r--r--sound/core/seq/oss/seq_oss.c4
-rw-r--r--sound/core/seq/oss/seq_oss_device.h2
-rw-r--r--sound/core/seq/oss/seq_oss_rw.c4
-rw-r--r--sound/core/seq/seq_clientmgr.c4
-rw-r--r--sound/core/timer.c4
-rw-r--r--sound/firewire/bebob/bebob_hwdep.c4
-rw-r--r--sound/firewire/dice/dice-hwdep.c4
-rw-r--r--sound/firewire/digi00x/digi00x-hwdep.c4
-rw-r--r--sound/firewire/fireface/ff-hwdep.c4
-rw-r--r--sound/firewire/fireworks/fireworks_hwdep.c4
-rw-r--r--sound/firewire/motu/motu-hwdep.c4
-rw-r--r--sound/firewire/oxfw/oxfw-hwdep.c4
-rw-r--r--sound/firewire/tascam/tascam-hwdep.c4
-rw-r--r--sound/oss/dmasound/dmasound_core.c4
-rw-r--r--sound/usb/mixer_quirks.c2
-rw-r--r--sound/usb/usx2y/us122l.c4
-rw-r--r--sound/usb/usx2y/usX2Yhwdep.c4
-rw-r--r--virt/kvm/eventfd.c4
387 files changed, 928 insertions, 810 deletions
diff --git a/arch/alpha/include/uapi/asm/Kbuild b/arch/alpha/include/uapi/asm/Kbuild
index 14a2e9af97e9..9afaba5e5503 100644
--- a/arch/alpha/include/uapi/asm/Kbuild
+++ b/arch/alpha/include/uapi/asm/Kbuild
@@ -2,3 +2,4 @@
2include include/uapi/asm-generic/Kbuild.asm 2include include/uapi/asm-generic/Kbuild.asm
3 3
4generic-y += bpf_perf_event.h 4generic-y += bpf_perf_event.h
5generic-y += poll.h
diff --git a/arch/alpha/include/uapi/asm/poll.h b/arch/alpha/include/uapi/asm/poll.h
deleted file mode 100644
index b7132a305a47..000000000000
--- a/arch/alpha/include/uapi/asm/poll.h
+++ /dev/null
@@ -1,2 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#include <asm-generic/poll.h>
diff --git a/arch/blackfin/include/uapi/asm/poll.h b/arch/blackfin/include/uapi/asm/poll.h
index 8b094d43e9b7..3b162f2d2970 100644
--- a/arch/blackfin/include/uapi/asm/poll.h
+++ b/arch/blackfin/include/uapi/asm/poll.h
@@ -9,8 +9,25 @@
9#ifndef _UAPI__BFIN_POLL_H 9#ifndef _UAPI__BFIN_POLL_H
10#define _UAPI__BFIN_POLL_H 10#define _UAPI__BFIN_POLL_H
11 11
12#define POLLWRNORM 4 /* POLLOUT */ 12#ifndef __KERNEL__
13#define POLLWRBAND 256 13#define POLLWRNORM POLLOUT
14#define POLLWRBAND (__force __poll_t)256
15#else
16#define __ARCH_HAS_MANGLED_POLL
17static inline __u16 mangle_poll(__poll_t val)
18{
19 __u16 v = (__force __u16)val;
20 /* bit 9 -> bit 8, bit 8 -> bit 2 */
21 return (v & ~0x300) | ((v & 0x200) >> 1) | ((v & 0x100) >> 6);
22}
23
24static inline __poll_t demangle_poll(__u16 v)
25{
26 /* bit 8 -> bit 9, bit 2 -> bits 2 and 8 */
27 return (__force __poll_t)((v & ~0x100) | ((v & 0x100) << 1) |
28 ((v & 4) << 6));
29}
30#endif
14 31
15#include <asm-generic/poll.h> 32#include <asm-generic/poll.h>
16 33
diff --git a/arch/cris/arch-v10/drivers/gpio.c b/arch/cris/arch-v10/drivers/gpio.c
index 68dbe261dc57..a2986c60aaac 100644
--- a/arch/cris/arch-v10/drivers/gpio.c
+++ b/arch/cris/arch-v10/drivers/gpio.c
@@ -50,7 +50,7 @@ static ssize_t gpio_write(struct file *file, const char __user *buf,
50 size_t count, loff_t *off); 50 size_t count, loff_t *off);
51static int gpio_open(struct inode *inode, struct file *filp); 51static int gpio_open(struct inode *inode, struct file *filp);
52static int gpio_release(struct inode *inode, struct file *filp); 52static int gpio_release(struct inode *inode, struct file *filp);
53static unsigned int gpio_poll(struct file *filp, struct poll_table_struct *wait); 53static __poll_t gpio_poll(struct file *filp, struct poll_table_struct *wait);
54 54
55/* private data per open() of this driver */ 55/* private data per open() of this driver */
56 56
@@ -141,9 +141,9 @@ static unsigned long dir_g_shadow; /* 1=output */
141#define USE_PORTS(priv) ((priv)->minor <= GPIO_MINOR_B) 141#define USE_PORTS(priv) ((priv)->minor <= GPIO_MINOR_B)
142 142
143 143
144static unsigned int gpio_poll(struct file *file, poll_table *wait) 144static __poll_t gpio_poll(struct file *file, poll_table *wait)
145{ 145{
146 unsigned int mask = 0; 146 __poll_t mask = 0;
147 struct gpio_private *priv = file->private_data; 147 struct gpio_private *priv = file->private_data;
148 unsigned long data; 148 unsigned long data;
149 unsigned long flags; 149 unsigned long flags;
diff --git a/arch/cris/arch-v10/drivers/sync_serial.c b/arch/cris/arch-v10/drivers/sync_serial.c
index cfe9176f2205..177843c64071 100644
--- a/arch/cris/arch-v10/drivers/sync_serial.c
+++ b/arch/cris/arch-v10/drivers/sync_serial.c
@@ -157,7 +157,7 @@ static inline int sync_data_avail(struct sync_port *port);
157 157
158static int sync_serial_open(struct inode *inode, struct file *file); 158static int sync_serial_open(struct inode *inode, struct file *file);
159static int sync_serial_release(struct inode *inode, struct file *file); 159static int sync_serial_release(struct inode *inode, struct file *file);
160static unsigned int sync_serial_poll(struct file *filp, poll_table *wait); 160static __poll_t sync_serial_poll(struct file *filp, poll_table *wait);
161 161
162static long sync_serial_ioctl(struct file *file, 162static long sync_serial_ioctl(struct file *file,
163 unsigned int cmd, unsigned long arg); 163 unsigned int cmd, unsigned long arg);
@@ -654,12 +654,12 @@ static int sync_serial_release(struct inode *inode, struct file *file)
654 654
655 655
656 656
657static unsigned int sync_serial_poll(struct file *file, poll_table *wait) 657static __poll_t sync_serial_poll(struct file *file, poll_table *wait)
658{ 658{
659 int dev = MINOR(file_inode(file)->i_rdev); 659 int dev = MINOR(file_inode(file)->i_rdev);
660 unsigned int mask = 0; 660 __poll_t mask = 0;
661 struct sync_port *port; 661 struct sync_port *port;
662 DEBUGPOLL(static unsigned int prev_mask = 0); 662 DEBUGPOLL(static __poll_t prev_mask = 0);
663 663
664 port = &ports[dev]; 664 port = &ports[dev];
665 poll_wait(file, &port->out_wait_q, wait); 665 poll_wait(file, &port->out_wait_q, wait);
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c
index 8efcc1a899a8..e20e0b9a3a5c 100644
--- a/arch/cris/arch-v32/drivers/sync_serial.c
+++ b/arch/cris/arch-v32/drivers/sync_serial.c
@@ -178,7 +178,7 @@ static inline int sync_data_avail(struct sync_port *port);
178 178
179static int sync_serial_open(struct inode *, struct file *); 179static int sync_serial_open(struct inode *, struct file *);
180static int sync_serial_release(struct inode *, struct file *); 180static int sync_serial_release(struct inode *, struct file *);
181static unsigned int sync_serial_poll(struct file *filp, poll_table *wait); 181static __poll_t sync_serial_poll(struct file *filp, poll_table *wait);
182 182
183static long sync_serial_ioctl(struct file *file, 183static long sync_serial_ioctl(struct file *file,
184 unsigned int cmd, unsigned long arg); 184 unsigned int cmd, unsigned long arg);
@@ -555,13 +555,13 @@ static int sync_serial_release(struct inode *inode, struct file *file)
555 return 0; 555 return 0;
556} 556}
557 557
558static unsigned int sync_serial_poll(struct file *file, poll_table *wait) 558static __poll_t sync_serial_poll(struct file *file, poll_table *wait)
559{ 559{
560 int dev = iminor(file_inode(file)); 560 int dev = iminor(file_inode(file));
561 unsigned int mask = 0; 561 __poll_t mask = 0;
562 struct sync_port *port; 562 struct sync_port *port;
563 DEBUGPOLL( 563 DEBUGPOLL(
564 static unsigned int prev_mask; 564 static __poll_t prev_mask;
565 ); 565 );
566 566
567 port = &ports[dev]; 567 port = &ports[dev];
diff --git a/arch/frv/include/uapi/asm/poll.h b/arch/frv/include/uapi/asm/poll.h
index 887b67288340..a44c8f0ebee7 100644
--- a/arch/frv/include/uapi/asm/poll.h
+++ b/arch/frv/include/uapi/asm/poll.h
@@ -2,12 +2,27 @@
2#ifndef _ASM_POLL_H 2#ifndef _ASM_POLL_H
3#define _ASM_POLL_H 3#define _ASM_POLL_H
4 4
5#ifndef __KERNEL__
5#define POLLWRNORM POLLOUT 6#define POLLWRNORM POLLOUT
6#define POLLWRBAND 256 7#define POLLWRBAND (__force __poll_t)256
8#else
9#define __ARCH_HAS_MANGLED_POLL
10static inline __u16 mangle_poll(__poll_t val)
11{
12 __u16 v = (__force __u16)val;
13 /* bit 9 -> bit 8, bit 8 -> bit 2 */
14 return (v & ~0x300) | ((v & 0x200) >> 1) | ((v & 0x100) >> 6);
15}
7 16
8#include <asm-generic/poll.h> 17static inline __poll_t demangle_poll(__u16 v)
18{
19 /* bit 8 -> bit 9, bit 2 -> bits 2 and 8 */
20 return (__force __poll_t)((v & ~0x100) | ((v & 0x100) << 1) |
21 ((v & 4) << 6));
22}
23#endif
9 24
25#include <asm-generic/poll.h>
10#undef POLLREMOVE 26#undef POLLREMOVE
11 27
12#endif 28#endif
13
diff --git a/arch/ia64/include/uapi/asm/Kbuild b/arch/ia64/include/uapi/asm/Kbuild
index f5c6967a93bb..c0527cfc48f0 100644
--- a/arch/ia64/include/uapi/asm/Kbuild
+++ b/arch/ia64/include/uapi/asm/Kbuild
@@ -3,3 +3,4 @@ include include/uapi/asm-generic/Kbuild.asm
3 3
4generic-y += bpf_perf_event.h 4generic-y += bpf_perf_event.h
5generic-y += kvm_para.h 5generic-y += kvm_para.h
6generic-y += poll.h
diff --git a/arch/ia64/include/uapi/asm/poll.h b/arch/ia64/include/uapi/asm/poll.h
deleted file mode 100644
index b7132a305a47..000000000000
--- a/arch/ia64/include/uapi/asm/poll.h
+++ /dev/null
@@ -1,2 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#include <asm-generic/poll.h>
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 09f86ebfcc7b..c44f002e8f6b 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -1644,12 +1644,12 @@ pfm_write(struct file *file, const char __user *ubuf,
1644 return -EINVAL; 1644 return -EINVAL;
1645} 1645}
1646 1646
1647static unsigned int 1647static __poll_t
1648pfm_poll(struct file *filp, poll_table * wait) 1648pfm_poll(struct file *filp, poll_table * wait)
1649{ 1649{
1650 pfm_context_t *ctx; 1650 pfm_context_t *ctx;
1651 unsigned long flags; 1651 unsigned long flags;
1652 unsigned int mask = 0; 1652 __poll_t mask = 0;
1653 1653
1654 if (PFM_IS_FILE(filp) == 0) { 1654 if (PFM_IS_FILE(filp) == 0) {
1655 printk(KERN_ERR "perfmon: pfm_poll: bad magic [%d]\n", task_pid_nr(current)); 1655 printk(KERN_ERR "perfmon: pfm_poll: bad magic [%d]\n", task_pid_nr(current));
diff --git a/arch/m32r/include/uapi/asm/Kbuild b/arch/m32r/include/uapi/asm/Kbuild
index 451bf6071c6e..c3df55aeefe7 100644
--- a/arch/m32r/include/uapi/asm/Kbuild
+++ b/arch/m32r/include/uapi/asm/Kbuild
@@ -3,4 +3,5 @@ include include/uapi/asm-generic/Kbuild.asm
3 3
4generic-y += bpf_perf_event.h 4generic-y += bpf_perf_event.h
5generic-y += kvm_para.h 5generic-y += kvm_para.h
6generic-y += poll.h
6generic-y += siginfo.h 7generic-y += siginfo.h
diff --git a/arch/m32r/include/uapi/asm/poll.h b/arch/m32r/include/uapi/asm/poll.h
deleted file mode 100644
index b7132a305a47..000000000000
--- a/arch/m32r/include/uapi/asm/poll.h
+++ /dev/null
@@ -1,2 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#include <asm-generic/poll.h>
diff --git a/arch/m68k/include/uapi/asm/poll.h b/arch/m68k/include/uapi/asm/poll.h
index c3e3fcc15e1d..d8be239e8141 100644
--- a/arch/m68k/include/uapi/asm/poll.h
+++ b/arch/m68k/include/uapi/asm/poll.h
@@ -2,8 +2,25 @@
2#ifndef __m68k_POLL_H 2#ifndef __m68k_POLL_H
3#define __m68k_POLL_H 3#define __m68k_POLL_H
4 4
5#ifndef __KERNEL__
5#define POLLWRNORM POLLOUT 6#define POLLWRNORM POLLOUT
6#define POLLWRBAND 256 7#define POLLWRBAND (__force __poll_t)256
8#else
9#define __ARCH_HAS_MANGLED_POLL
10static inline __u16 mangle_poll(__poll_t val)
11{
12 __u16 v = (__force __u16)val;
13 /* bit 9 -> bit 8, bit 8 -> bit 2 */
14 return (v & ~0x300) | ((v & 0x200) >> 1) | ((v & 0x100) >> 6);
15}
16
17static inline __poll_t demangle_poll(__u16 v)
18{
19 /* bit 8 -> bit 9, bit 2 -> bits 2 and 8 */
20 return (__force __poll_t)((v & ~0x100) | ((v & 0x100) << 1) |
21 ((v & 4) << 6));
22}
23#endif
7 24
8#include <asm-generic/poll.h> 25#include <asm-generic/poll.h>
9 26
diff --git a/arch/mips/include/uapi/asm/poll.h b/arch/mips/include/uapi/asm/poll.h
index ad289d7b7434..3173f8917128 100644
--- a/arch/mips/include/uapi/asm/poll.h
+++ b/arch/mips/include/uapi/asm/poll.h
@@ -2,8 +2,25 @@
2#ifndef __ASM_POLL_H 2#ifndef __ASM_POLL_H
3#define __ASM_POLL_H 3#define __ASM_POLL_H
4 4
5#ifndef __KERNEL__
5#define POLLWRNORM POLLOUT 6#define POLLWRNORM POLLOUT
6#define POLLWRBAND 0x0100 7#define POLLWRBAND (__force __poll_t)0x0100
8#else
9#define __ARCH_HAS_MANGLED_POLL
10static inline __u16 mangle_poll(__poll_t val)
11{
12 __u16 v = (__force __u16)val;
13 /* bit 9 -> bit 8, bit 8 -> bit 2 */
14 return (v & ~0x300) | ((v & 0x200) >> 1) | ((v & 0x100) >> 6);
15}
16
17static inline __poll_t demangle_poll(__u16 v)
18{
19 /* bit 8 -> bit 9, bit 2 -> bits 2 and 8 */
20 return (__force __poll_t)((v & ~0x100) | ((v & 0x100) << 1) |
21 ((v & 4) << 6));
22}
23#endif
7 24
8#include <asm-generic/poll.h> 25#include <asm-generic/poll.h>
9 26
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c
index b80dd8b17a76..bbb0f4770c0d 100644
--- a/arch/mips/kernel/rtlx.c
+++ b/arch/mips/kernel/rtlx.c
@@ -336,10 +336,10 @@ static int file_release(struct inode *inode, struct file *filp)
336 return rtlx_release(iminor(inode)); 336 return rtlx_release(iminor(inode));
337} 337}
338 338
339static unsigned int file_poll(struct file *file, poll_table *wait) 339static __poll_t file_poll(struct file *file, poll_table *wait)
340{ 340{
341 int minor = iminor(file_inode(file)); 341 int minor = iminor(file_inode(file));
342 unsigned int mask = 0; 342 __poll_t mask = 0;
343 343
344 poll_wait(file, &channel_wqs[minor].rt_queue, wait); 344 poll_wait(file, &channel_wqs[minor].rt_queue, wait);
345 poll_wait(file, &channel_wqs[minor].lx_queue, wait); 345 poll_wait(file, &channel_wqs[minor].lx_queue, wait);
diff --git a/arch/mn10300/include/uapi/asm/Kbuild b/arch/mn10300/include/uapi/asm/Kbuild
index 81271d3af47c..b04fd1632051 100644
--- a/arch/mn10300/include/uapi/asm/Kbuild
+++ b/arch/mn10300/include/uapi/asm/Kbuild
@@ -2,4 +2,5 @@
2include include/uapi/asm-generic/Kbuild.asm 2include include/uapi/asm-generic/Kbuild.asm
3 3
4generic-y += bpf_perf_event.h 4generic-y += bpf_perf_event.h
5generic-y += poll.h
5generic-y += siginfo.h 6generic-y += siginfo.h
diff --git a/arch/mn10300/include/uapi/asm/poll.h b/arch/mn10300/include/uapi/asm/poll.h
deleted file mode 100644
index b7132a305a47..000000000000
--- a/arch/mn10300/include/uapi/asm/poll.h
+++ /dev/null
@@ -1,2 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#include <asm-generic/poll.h>
diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c
index 0f0b1b2f3b60..1da8b7d8c6ca 100644
--- a/arch/powerpc/kernel/rtasd.c
+++ b/arch/powerpc/kernel/rtasd.c
@@ -388,7 +388,7 @@ out:
388 return error; 388 return error;
389} 389}
390 390
391static unsigned int rtas_log_poll(struct file *file, poll_table * wait) 391static __poll_t rtas_log_poll(struct file *file, poll_table * wait)
392{ 392{
393 poll_wait(file, &rtas_log_wait, wait); 393 poll_wait(file, &rtas_log_wait, wait);
394 if (rtas_log_size) 394 if (rtas_log_size)
diff --git a/arch/powerpc/platforms/cell/spufs/backing_ops.c b/arch/powerpc/platforms/cell/spufs/backing_ops.c
index 6e8a9ef8590e..1a9a756b0b2f 100644
--- a/arch/powerpc/platforms/cell/spufs/backing_ops.c
+++ b/arch/powerpc/platforms/cell/spufs/backing_ops.c
@@ -86,10 +86,10 @@ static u32 spu_backing_mbox_stat_read(struct spu_context *ctx)
86 return ctx->csa.prob.mb_stat_R; 86 return ctx->csa.prob.mb_stat_R;
87} 87}
88 88
89static unsigned int spu_backing_mbox_stat_poll(struct spu_context *ctx, 89static __poll_t spu_backing_mbox_stat_poll(struct spu_context *ctx,
90 unsigned int events) 90 __poll_t events)
91{ 91{
92 int ret; 92 __poll_t ret;
93 u32 stat; 93 u32 stat;
94 94
95 ret = 0; 95 ret = 0;
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 5ffcdeb1eb17..fc7772c3d068 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -762,10 +762,10 @@ out:
762 return count; 762 return count;
763} 763}
764 764
765static unsigned int spufs_ibox_poll(struct file *file, poll_table *wait) 765static __poll_t spufs_ibox_poll(struct file *file, poll_table *wait)
766{ 766{
767 struct spu_context *ctx = file->private_data; 767 struct spu_context *ctx = file->private_data;
768 unsigned int mask; 768 __poll_t mask;
769 769
770 poll_wait(file, &ctx->ibox_wq, wait); 770 poll_wait(file, &ctx->ibox_wq, wait);
771 771
@@ -898,10 +898,10 @@ out:
898 return count; 898 return count;
899} 899}
900 900
901static unsigned int spufs_wbox_poll(struct file *file, poll_table *wait) 901static __poll_t spufs_wbox_poll(struct file *file, poll_table *wait)
902{ 902{
903 struct spu_context *ctx = file->private_data; 903 struct spu_context *ctx = file->private_data;
904 unsigned int mask; 904 __poll_t mask;
905 905
906 poll_wait(file, &ctx->wbox_wq, wait); 906 poll_wait(file, &ctx->wbox_wq, wait);
907 907
@@ -1690,11 +1690,11 @@ out:
1690 return ret; 1690 return ret;
1691} 1691}
1692 1692
1693static unsigned int spufs_mfc_poll(struct file *file,poll_table *wait) 1693static __poll_t spufs_mfc_poll(struct file *file,poll_table *wait)
1694{ 1694{
1695 struct spu_context *ctx = file->private_data; 1695 struct spu_context *ctx = file->private_data;
1696 u32 free_elements, tagstatus; 1696 u32 free_elements, tagstatus;
1697 unsigned int mask; 1697 __poll_t mask;
1698 1698
1699 poll_wait(file, &ctx->mfc_wq, wait); 1699 poll_wait(file, &ctx->mfc_wq, wait);
1700 1700
@@ -2455,11 +2455,11 @@ static ssize_t spufs_switch_log_read(struct file *file, char __user *buf,
2455 return cnt == 0 ? error : cnt; 2455 return cnt == 0 ? error : cnt;
2456} 2456}
2457 2457
2458static unsigned int spufs_switch_log_poll(struct file *file, poll_table *wait) 2458static __poll_t spufs_switch_log_poll(struct file *file, poll_table *wait)
2459{ 2459{
2460 struct inode *inode = file_inode(file); 2460 struct inode *inode = file_inode(file);
2461 struct spu_context *ctx = SPUFS_I(inode)->i_ctx; 2461 struct spu_context *ctx = SPUFS_I(inode)->i_ctx;
2462 unsigned int mask = 0; 2462 __poll_t mask = 0;
2463 int rc; 2463 int rc;
2464 2464
2465 poll_wait(file, &ctx->switch_log->wait, wait); 2465 poll_wait(file, &ctx->switch_log->wait, wait);
diff --git a/arch/powerpc/platforms/cell/spufs/hw_ops.c b/arch/powerpc/platforms/cell/spufs/hw_ops.c
index 8655c4cbefc2..fff58198b5b6 100644
--- a/arch/powerpc/platforms/cell/spufs/hw_ops.c
+++ b/arch/powerpc/platforms/cell/spufs/hw_ops.c
@@ -56,11 +56,10 @@ static u32 spu_hw_mbox_stat_read(struct spu_context *ctx)
56 return in_be32(&ctx->spu->problem->mb_stat_R); 56 return in_be32(&ctx->spu->problem->mb_stat_R);
57} 57}
58 58
59static unsigned int spu_hw_mbox_stat_poll(struct spu_context *ctx, 59static __poll_t spu_hw_mbox_stat_poll(struct spu_context *ctx, __poll_t events)
60 unsigned int events)
61{ 60{
62 struct spu *spu = ctx->spu; 61 struct spu *spu = ctx->spu;
63 int ret = 0; 62 __poll_t ret = 0;
64 u32 stat; 63 u32 stat;
65 64
66 spin_lock_irq(&spu->register_lock); 65 spin_lock_irq(&spu->register_lock);
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h
index 5e59f80e95db..2d0479ad3af4 100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
@@ -185,8 +185,7 @@ struct mfc_dma_command {
185struct spu_context_ops { 185struct spu_context_ops {
186 int (*mbox_read) (struct spu_context * ctx, u32 * data); 186 int (*mbox_read) (struct spu_context * ctx, u32 * data);
187 u32(*mbox_stat_read) (struct spu_context * ctx); 187 u32(*mbox_stat_read) (struct spu_context * ctx);
188 unsigned int (*mbox_stat_poll)(struct spu_context *ctx, 188 __poll_t (*mbox_stat_poll)(struct spu_context *ctx, __poll_t events);
189 unsigned int events);
190 int (*ibox_read) (struct spu_context * ctx, u32 * data); 189 int (*ibox_read) (struct spu_context * ctx, u32 * data);
191 int (*wbox_write) (struct spu_context * ctx, u32 data); 190 int (*wbox_write) (struct spu_context * ctx, u32 data);
192 u32(*signal1_read) (struct spu_context * ctx); 191 u32(*signal1_read) (struct spu_context * ctx);
diff --git a/arch/powerpc/platforms/powernv/opal-prd.c b/arch/powerpc/platforms/powernv/opal-prd.c
index de4dd09f4a15..c18de0a9b1bd 100644
--- a/arch/powerpc/platforms/powernv/opal-prd.c
+++ b/arch/powerpc/platforms/powernv/opal-prd.c
@@ -147,7 +147,7 @@ static bool opal_msg_queue_empty(void)
147 return ret; 147 return ret;
148} 148}
149 149
150static unsigned int opal_prd_poll(struct file *file, 150static __poll_t opal_prd_poll(struct file *file,
151 struct poll_table_struct *wait) 151 struct poll_table_struct *wait)
152{ 152{
153 poll_wait(file, &opal_prd_msg_wait, wait); 153 poll_wait(file, &opal_prd_msg_wait, wait);
diff --git a/arch/score/include/uapi/asm/Kbuild b/arch/score/include/uapi/asm/Kbuild
index 81271d3af47c..b04fd1632051 100644
--- a/arch/score/include/uapi/asm/Kbuild
+++ b/arch/score/include/uapi/asm/Kbuild
@@ -2,4 +2,5 @@
2include include/uapi/asm-generic/Kbuild.asm 2include include/uapi/asm-generic/Kbuild.asm
3 3
4generic-y += bpf_perf_event.h 4generic-y += bpf_perf_event.h
5generic-y += poll.h
5generic-y += siginfo.h 6generic-y += siginfo.h
diff --git a/arch/score/include/uapi/asm/poll.h b/arch/score/include/uapi/asm/poll.h
deleted file mode 100644
index c636b85843cd..000000000000
--- a/arch/score/include/uapi/asm/poll.h
+++ /dev/null
@@ -1,7 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_SCORE_POLL_H
3#define _ASM_SCORE_POLL_H
4
5#include <asm-generic/poll.h>
6
7#endif /* _ASM_SCORE_POLL_H */
diff --git a/arch/sparc/include/uapi/asm/poll.h b/arch/sparc/include/uapi/asm/poll.h
index 72356c999125..2a81e79aa3ea 100644
--- a/arch/sparc/include/uapi/asm/poll.h
+++ b/arch/sparc/include/uapi/asm/poll.h
@@ -2,11 +2,31 @@
2#ifndef __SPARC_POLL_H 2#ifndef __SPARC_POLL_H
3#define __SPARC_POLL_H 3#define __SPARC_POLL_H
4 4
5#ifndef __KERNEL__
5#define POLLWRNORM POLLOUT 6#define POLLWRNORM POLLOUT
6#define POLLWRBAND 256 7#define POLLWRBAND (__force __poll_t)256
7#define POLLMSG 512 8#define POLLMSG (__force __poll_t)512
8#define POLLREMOVE 1024 9#define POLLREMOVE (__force __poll_t)1024
9#define POLLRDHUP 2048 10#define POLLRDHUP (__force __poll_t)2048
11#else
12#define __ARCH_HAS_MANGLED_POLL
13static inline __u16 mangle_poll(__poll_t val)
14{
15 __u16 v = (__force __u16)val;
16 /* bit 9 -> bit 8, bit 8 -> bit 2, bit 13 -> bit 11 */
17 return (v & ~0x300) | ((v & 0x200) >> 1) | ((v & 0x100) >> 6) |
18 ((v & 0x2000) >> 2);
19
20
21}
22
23static inline __poll_t demangle_poll(__u16 v)
24{
25 /* bit 8 -> bit 9, bit 2 -> bits 2 and 8 */
26 return (__force __poll_t)((v & ~0x100) | ((v & 0x100) << 1) |
27 ((v & 4) << 6) | ((v & 0x800) << 2));
28}
29#endif
10 30
11#include <asm-generic/poll.h> 31#include <asm-generic/poll.h>
12 32
diff --git a/arch/um/Makefile b/arch/um/Makefile
index b76fcce397a1..e54dda8a0363 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -116,8 +116,15 @@ endef
116KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig 116KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig
117 117
118archheaders: 118archheaders:
119 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \
120 kbuild-file=$(HOST_DIR)/include/asm/Kbuild \
121 obj=$(HOST_DIR)/include/generated/asm
122 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \
123 kbuild-file=$(HOST_DIR)/include/uapi/asm/Kbuild \
124 obj=$(HOST_DIR)/include/generated/uapi/asm
119 $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders 125 $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders
120 126
127
121archprepare: include/generated/user_constants.h 128archprepare: include/generated/user_constants.h
122 129
123LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static 130LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
diff --git a/arch/um/drivers/hostaudio_kern.c b/arch/um/drivers/hostaudio_kern.c
index 12bdb5996bf5..7f9dbdbc4eb7 100644
--- a/arch/um/drivers/hostaudio_kern.c
+++ b/arch/um/drivers/hostaudio_kern.c
@@ -119,10 +119,10 @@ static ssize_t hostaudio_write(struct file *file, const char __user *buffer,
119 return err; 119 return err;
120} 120}
121 121
122static unsigned int hostaudio_poll(struct file *file, 122static __poll_t hostaudio_poll(struct file *file,
123 struct poll_table_struct *wait) 123 struct poll_table_struct *wait)
124{ 124{
125 unsigned int mask = 0; 125 __poll_t mask = 0;
126 126
127#ifdef DEBUG 127#ifdef DEBUG
128 printk(KERN_DEBUG "hostaudio: poll called (unimplemented)\n"); 128 printk(KERN_DEBUG "hostaudio: poll called (unimplemented)\n");
diff --git a/arch/x86/include/uapi/asm/Kbuild b/arch/x86/include/uapi/asm/Kbuild
index 1e901e421f2d..322681622d1e 100644
--- a/arch/x86/include/uapi/asm/Kbuild
+++ b/arch/x86/include/uapi/asm/Kbuild
@@ -5,3 +5,4 @@ generic-y += bpf_perf_event.h
5generated-y += unistd_32.h 5generated-y += unistd_32.h
6generated-y += unistd_64.h 6generated-y += unistd_64.h
7generated-y += unistd_x32.h 7generated-y += unistd_x32.h
8generic-y += poll.h
diff --git a/arch/x86/include/uapi/asm/poll.h b/arch/x86/include/uapi/asm/poll.h
deleted file mode 100644
index c98509d3149e..000000000000
--- a/arch/x86/include/uapi/asm/poll.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/poll.h>
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index e4b0d92b3ae0..ab1865342002 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -1506,7 +1506,7 @@ static ssize_t do_read(struct file *fp, char __user *buf, size_t count, loff_t *
1506 return 0; 1506 return 0;
1507} 1507}
1508 1508
1509static unsigned int do_poll(struct file *fp, poll_table *wait) 1509static __poll_t do_poll(struct file *fp, poll_table *wait)
1510{ 1510{
1511 struct apm_user *as; 1511 struct apm_user *as;
1512 1512
diff --git a/arch/x86/kernel/cpu/mcheck/dev-mcelog.c b/arch/x86/kernel/cpu/mcheck/dev-mcelog.c
index 7f85b76f43bc..213e8c2ca702 100644
--- a/arch/x86/kernel/cpu/mcheck/dev-mcelog.c
+++ b/arch/x86/kernel/cpu/mcheck/dev-mcelog.c
@@ -243,7 +243,7 @@ out:
243 return err ? err : buf - ubuf; 243 return err ? err : buf - ubuf;
244} 244}
245 245
246static unsigned int mce_chrdev_poll(struct file *file, poll_table *wait) 246static __poll_t mce_chrdev_poll(struct file *file, poll_table *wait)
247{ 247{
248 poll_wait(file, &mce_chrdev_wait, wait); 248 poll_wait(file, &mce_chrdev_wait, wait);
249 if (READ_ONCE(mcelog.next)) 249 if (READ_ONCE(mcelog.next))
diff --git a/arch/xtensa/include/uapi/asm/poll.h b/arch/xtensa/include/uapi/asm/poll.h
index 4d249040b33d..e3246d41182c 100644
--- a/arch/xtensa/include/uapi/asm/poll.h
+++ b/arch/xtensa/include/uapi/asm/poll.h
@@ -12,9 +12,26 @@
12#ifndef _XTENSA_POLL_H 12#ifndef _XTENSA_POLL_H
13#define _XTENSA_POLL_H 13#define _XTENSA_POLL_H
14 14
15#ifndef __KERNEL__
15#define POLLWRNORM POLLOUT 16#define POLLWRNORM POLLOUT
16#define POLLWRBAND 0x0100 17#define POLLWRBAND (__force __poll_t)0x0100
17#define POLLREMOVE 0x0800 18#define POLLREMOVE (__force __poll_t)0x0800
19#else
20#define __ARCH_HAS_MANGLED_POLL
21static inline __u16 mangle_poll(__poll_t val)
22{
23 __u16 v = (__force __u16)val;
24 /* bit 9 -> bit 8, bit 8 -> bit 2 */
25 return (v & ~0x300) | ((v & 0x200) >> 1) | ((v & 0x100) >> 6);
26}
27
28static inline __poll_t demangle_poll(__u16 v)
29{
30 /* bit 8 -> bit 9, bit 2 -> bits 2 and 8 */
31 return (__force __poll_t)((v & ~0x100) | ((v & 0x100) << 1) |
32 ((v & 4) << 6));
33}
34#endif
18 35
19#include <asm-generic/poll.h> 36#include <asm-generic/poll.h>
20 37
diff --git a/block/bsg.c b/block/bsg.c
index a1bcbb6ba50b..2e2c1e222209 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -839,10 +839,10 @@ static int bsg_release(struct inode *inode, struct file *file)
839 return bsg_put_device(bd); 839 return bsg_put_device(bd);
840} 840}
841 841
842static unsigned int bsg_poll(struct file *file, poll_table *wait) 842static __poll_t bsg_poll(struct file *file, poll_table *wait)
843{ 843{
844 struct bsg_device *bd = file->private_data; 844 struct bsg_device *bd = file->private_data;
845 unsigned int mask = 0; 845 __poll_t mask = 0;
846 846
847 poll_wait(file, &bd->wq_done, wait); 847 poll_wait(file, &bd->wq_done, wait);
848 poll_wait(file, &bd->wq_free, wait); 848 poll_wait(file, &bd->wq_free, wait);
diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index 35d4dcea381f..f41047ab60f5 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -1062,13 +1062,13 @@ EXPORT_SYMBOL_GPL(af_alg_async_cb);
1062/** 1062/**
1063 * af_alg_poll - poll system call handler 1063 * af_alg_poll - poll system call handler
1064 */ 1064 */
1065unsigned int af_alg_poll(struct file *file, struct socket *sock, 1065__poll_t af_alg_poll(struct file *file, struct socket *sock,
1066 poll_table *wait) 1066 poll_table *wait)
1067{ 1067{
1068 struct sock *sk = sock->sk; 1068 struct sock *sk = sock->sk;
1069 struct alg_sock *ask = alg_sk(sk); 1069 struct alg_sock *ask = alg_sk(sk);
1070 struct af_alg_ctx *ctx = ask->private; 1070 struct af_alg_ctx *ctx = ask->private;
1071 unsigned int mask; 1071 __poll_t mask;
1072 1072
1073 sock_poll_wait(file, sk_sleep(sk), wait); 1073 sock_poll_wait(file, sk_sleep(sk), wait);
1074 mask = 0; 1074 mask = 0;
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
index c5c47b680152..f50907430c92 100644
--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -193,7 +193,6 @@ out:
193 return ret; 193 return ret;
194} 194}
195 195
196
197static struct proto_ops algif_skcipher_ops = { 196static struct proto_ops algif_skcipher_ops = {
198 .family = PF_ALG, 197 .family = PF_ALG,
199 198
diff --git a/drivers/acpi/acpi_dbg.c b/drivers/acpi/acpi_dbg.c
index 3ec05aa1a903..2ff5c8c04e3b 100644
--- a/drivers/acpi/acpi_dbg.c
+++ b/drivers/acpi/acpi_dbg.c
@@ -718,9 +718,9 @@ again:
718 return size > 0 ? size : ret; 718 return size > 0 ? size : ret;
719} 719}
720 720
721static unsigned int acpi_aml_poll(struct file *file, poll_table *wait) 721static __poll_t acpi_aml_poll(struct file *file, poll_table *wait)
722{ 722{
723 int masks = 0; 723 __poll_t masks = 0;
724 724
725 poll_wait(file, &acpi_aml_io.wait, wait); 725 poll_wait(file, &acpi_aml_io.wait, wait);
726 if (acpi_aml_user_readable()) 726 if (acpi_aml_user_readable())
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index a7ecfde66b7b..cc89d0d2b965 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -4311,7 +4311,7 @@ static int binder_thread_release(struct binder_proc *proc,
4311 return active_transactions; 4311 return active_transactions;
4312} 4312}
4313 4313
4314static unsigned int binder_poll(struct file *filp, 4314static __poll_t binder_poll(struct file *filp,
4315 struct poll_table_struct *wait) 4315 struct poll_table_struct *wait)
4316{ 4316{
4317 struct binder_proc *proc = filp->private_data; 4317 struct binder_proc *proc = filp->private_data;
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index c823914b3a80..b6a71705b7d6 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -794,7 +794,7 @@ static ssize_t hci_uart_tty_write(struct tty_struct *tty, struct file *file,
794 return 0; 794 return 0;
795} 795}
796 796
797static unsigned int hci_uart_tty_poll(struct tty_struct *tty, 797static __poll_t hci_uart_tty_poll(struct tty_struct *tty,
798 struct file *filp, poll_table *wait) 798 struct file *filp, poll_table *wait)
799{ 799{
800 return 0; 800 return 0;
diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index e6f6dbc04131..0521748a1972 100644
--- a/drivers/bluetooth/hci_vhci.c
+++ b/drivers/bluetooth/hci_vhci.c
@@ -299,7 +299,7 @@ static ssize_t vhci_write(struct kiocb *iocb, struct iov_iter *from)
299 return vhci_get_user(data, from); 299 return vhci_get_user(data, from);
300} 300}
301 301
302static unsigned int vhci_poll(struct file *file, poll_table *wait) 302static __poll_t vhci_poll(struct file *file, poll_table *wait)
303{ 303{
304 struct vhci_data *data = file->private_data; 304 struct vhci_data *data = file->private_data;
305 305
diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c
index 1dfb9f8de171..a2a1c1478cd0 100644
--- a/drivers/char/apm-emulation.c
+++ b/drivers/char/apm-emulation.c
@@ -236,7 +236,7 @@ static ssize_t apm_read(struct file *fp, char __user *buf, size_t count, loff_t
236 return ret; 236 return ret;
237} 237}
238 238
239static unsigned int apm_poll(struct file *fp, poll_table * wait) 239static __poll_t apm_poll(struct file *fp, poll_table * wait)
240{ 240{
241 struct apm_user *as = fp->private_data; 241 struct apm_user *as = fp->private_data;
242 242
diff --git a/drivers/char/dsp56k.c b/drivers/char/dsp56k.c
index 0d7b577e0ff0..2f92cc46698b 100644
--- a/drivers/char/dsp56k.c
+++ b/drivers/char/dsp56k.c
@@ -406,7 +406,7 @@ static long dsp56k_ioctl(struct file *file, unsigned int cmd,
406 * Do I need this function at all??? 406 * Do I need this function at all???
407 */ 407 */
408#if 0 408#if 0
409static unsigned int dsp56k_poll(struct file *file, poll_table *wait) 409static __poll_t dsp56k_poll(struct file *file, poll_table *wait)
410{ 410{
411 int dev = iminor(file_inode(file)) & 0x0f; 411 int dev = iminor(file_inode(file)) & 0x0f;
412 412
diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c
index 839ee61d352a..2697c22e3be2 100644
--- a/drivers/char/dtlk.c
+++ b/drivers/char/dtlk.c
@@ -91,7 +91,7 @@ static ssize_t dtlk_read(struct file *, char __user *,
91 size_t nbytes, loff_t * ppos); 91 size_t nbytes, loff_t * ppos);
92static ssize_t dtlk_write(struct file *, const char __user *, 92static ssize_t dtlk_write(struct file *, const char __user *,
93 size_t nbytes, loff_t * ppos); 93 size_t nbytes, loff_t * ppos);
94static unsigned int dtlk_poll(struct file *, poll_table *); 94static __poll_t dtlk_poll(struct file *, poll_table *);
95static int dtlk_open(struct inode *, struct file *); 95static int dtlk_open(struct inode *, struct file *);
96static int dtlk_release(struct inode *, struct file *); 96static int dtlk_release(struct inode *, struct file *);
97static long dtlk_ioctl(struct file *file, 97static long dtlk_ioctl(struct file *file,
@@ -228,9 +228,9 @@ static ssize_t dtlk_write(struct file *file, const char __user *buf,
228 return -EAGAIN; 228 return -EAGAIN;
229} 229}
230 230
231static unsigned int dtlk_poll(struct file *file, poll_table * wait) 231static __poll_t dtlk_poll(struct file *file, poll_table * wait)
232{ 232{
233 int mask = 0; 233 __poll_t mask = 0;
234 unsigned long expires; 234 unsigned long expires;
235 235
236 TRACE_TEXT(" dtlk_poll"); 236 TRACE_TEXT(" dtlk_poll");
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index b941e6d59fd6..dbed4953f86c 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -342,7 +342,7 @@ out:
342 return retval; 342 return retval;
343} 343}
344 344
345static unsigned int hpet_poll(struct file *file, poll_table * wait) 345static __poll_t hpet_poll(struct file *file, poll_table * wait)
346{ 346{
347 unsigned long v; 347 unsigned long v;
348 struct hpet_dev *devp; 348 struct hpet_dev *devp;
diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c
index 6edfaa72b98b..7992c870b0a2 100644
--- a/drivers/char/ipmi/bt-bmc.c
+++ b/drivers/char/ipmi/bt-bmc.c
@@ -338,10 +338,10 @@ static int bt_bmc_release(struct inode *inode, struct file *file)
338 return 0; 338 return 0;
339} 339}
340 340
341static unsigned int bt_bmc_poll(struct file *file, poll_table *wait) 341static __poll_t bt_bmc_poll(struct file *file, poll_table *wait)
342{ 342{
343 struct bt_bmc *bt_bmc = file_bt_bmc(file); 343 struct bt_bmc *bt_bmc = file_bt_bmc(file);
344 unsigned int mask = 0; 344 __poll_t mask = 0;
345 u8 ctrl; 345 u8 ctrl;
346 346
347 poll_wait(file, &bt_bmc->queue, wait); 347 poll_wait(file, &bt_bmc->queue, wait);
diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c
index 2ffca4232686..a011a7739f5e 100644
--- a/drivers/char/ipmi/ipmi_devintf.c
+++ b/drivers/char/ipmi/ipmi_devintf.c
@@ -78,10 +78,10 @@ static void file_receive_handler(struct ipmi_recv_msg *msg,
78 spin_unlock_irqrestore(&(priv->recv_msg_lock), flags); 78 spin_unlock_irqrestore(&(priv->recv_msg_lock), flags);
79} 79}
80 80
81static unsigned int ipmi_poll(struct file *file, poll_table *wait) 81static __poll_t ipmi_poll(struct file *file, poll_table *wait)
82{ 82{
83 struct ipmi_file_private *priv = file->private_data; 83 struct ipmi_file_private *priv = file->private_data;
84 unsigned int mask = 0; 84 __poll_t mask = 0;
85 unsigned long flags; 85 unsigned long flags;
86 86
87 poll_wait(file, &priv->wait, wait); 87 poll_wait(file, &priv->wait, wait);
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c
index 76b270678b50..95d8e9a53e91 100644
--- a/drivers/char/ipmi/ipmi_watchdog.c
+++ b/drivers/char/ipmi/ipmi_watchdog.c
@@ -887,9 +887,9 @@ static int ipmi_open(struct inode *ino, struct file *filep)
887 } 887 }
888} 888}
889 889
890static unsigned int ipmi_poll(struct file *file, poll_table *wait) 890static __poll_t ipmi_poll(struct file *file, poll_table *wait)
891{ 891{
892 unsigned int mask = 0; 892 __poll_t mask = 0;
893 893
894 poll_wait(file, &read_q, wait); 894 poll_wait(file, &read_q, wait);
895 895
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c
index 9a1aaf538758..819fe37a3683 100644
--- a/drivers/char/pcmcia/cm4040_cs.c
+++ b/drivers/char/pcmcia/cm4040_cs.c
@@ -415,10 +415,10 @@ static ssize_t cm4040_write(struct file *filp, const char __user *buf,
415 return count; 415 return count;
416} 416}
417 417
418static unsigned int cm4040_poll(struct file *filp, poll_table *wait) 418static __poll_t cm4040_poll(struct file *filp, poll_table *wait)
419{ 419{
420 struct reader_dev *dev = filp->private_data; 420 struct reader_dev *dev = filp->private_data;
421 unsigned int mask = 0; 421 __poll_t mask = 0;
422 422
423 poll_wait(filp, &dev->poll_wait, wait); 423 poll_wait(filp, &dev->poll_wait, wait);
424 424
diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c
index d256110ba672..7a56d1a13ec3 100644
--- a/drivers/char/ppdev.c
+++ b/drivers/char/ppdev.c
@@ -769,10 +769,10 @@ static int pp_release(struct inode *inode, struct file *file)
769} 769}
770 770
771/* No kernel lock held - fine */ 771/* No kernel lock held - fine */
772static unsigned int pp_poll(struct file *file, poll_table *wait) 772static __poll_t pp_poll(struct file *file, poll_table *wait)
773{ 773{
774 struct pp_struct *pp = file->private_data; 774 struct pp_struct *pp = file->private_data;
775 unsigned int mask = 0; 775 __poll_t mask = 0;
776 776
777 poll_wait(file, &pp->irq_wait, wait); 777 poll_wait(file, &pp->irq_wait, wait);
778 if (atomic_read(&pp->irqc)) 778 if (atomic_read(&pp->irqc))
diff --git a/drivers/char/random.c b/drivers/char/random.c
index ec42c8bb9b0d..64b59562c872 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1784,10 +1784,10 @@ urandom_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
1784 return ret; 1784 return ret;
1785} 1785}
1786 1786
1787static unsigned int 1787static __poll_t
1788random_poll(struct file *file, poll_table * wait) 1788random_poll(struct file *file, poll_table * wait)
1789{ 1789{
1790 unsigned int mask; 1790 __poll_t mask;
1791 1791
1792 poll_wait(file, &random_read_wait, wait); 1792 poll_wait(file, &random_read_wait, wait);
1793 poll_wait(file, &random_write_wait, wait); 1793 poll_wait(file, &random_write_wait, wait);
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index 5542a438bbd0..c6a317120a55 100644
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -147,7 +147,7 @@ static long rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
147static void rtc_get_rtc_time(struct rtc_time *rtc_tm); 147static void rtc_get_rtc_time(struct rtc_time *rtc_tm);
148 148
149#ifdef RTC_IRQ 149#ifdef RTC_IRQ
150static unsigned int rtc_poll(struct file *file, poll_table *wait); 150static __poll_t rtc_poll(struct file *file, poll_table *wait);
151#endif 151#endif
152 152
153static void get_rtc_alm_time(struct rtc_time *alm_tm); 153static void get_rtc_alm_time(struct rtc_time *alm_tm);
@@ -790,7 +790,7 @@ no_irq:
790} 790}
791 791
792#ifdef RTC_IRQ 792#ifdef RTC_IRQ
793static unsigned int rtc_poll(struct file *file, poll_table *wait) 793static __poll_t rtc_poll(struct file *file, poll_table *wait)
794{ 794{
795 unsigned long l; 795 unsigned long l;
796 796
diff --git a/drivers/char/snsc.c b/drivers/char/snsc.c
index 6aa32679fd58..7f49fa0f41d7 100644
--- a/drivers/char/snsc.c
+++ b/drivers/char/snsc.c
@@ -321,10 +321,10 @@ scdrv_write(struct file *file, const char __user *buf,
321 return status; 321 return status;
322} 322}
323 323
324static unsigned int 324static __poll_t
325scdrv_poll(struct file *file, struct poll_table_struct *wait) 325scdrv_poll(struct file *file, struct poll_table_struct *wait)
326{ 326{
327 unsigned int mask = 0; 327 __poll_t mask = 0;
328 int status = 0; 328 int status = 0;
329 struct subch_data_s *sd = (struct subch_data_s *) file->private_data; 329 struct subch_data_s *sd = (struct subch_data_s *) file->private_data;
330 unsigned long flags; 330 unsigned long flags;
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index d3a979e25724..fc041c462aa4 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -940,7 +940,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf,
940 return ret; 940 return ret;
941} 941}
942 942
943static unsigned int sonypi_misc_poll(struct file *file, poll_table *wait) 943static __poll_t sonypi_misc_poll(struct file *file, poll_table *wait)
944{ 944{
945 poll_wait(file, &sonypi_device.fifo_proc_list, wait); 945 poll_wait(file, &sonypi_device.fifo_proc_list, wait);
946 if (kfifo_len(&sonypi_device.fifo)) 946 if (kfifo_len(&sonypi_device.fifo))
diff --git a/drivers/char/tpm/tpm_vtpm_proxy.c b/drivers/char/tpm/tpm_vtpm_proxy.c
index 1d877cc9af97..674218b50b13 100644
--- a/drivers/char/tpm/tpm_vtpm_proxy.c
+++ b/drivers/char/tpm/tpm_vtpm_proxy.c
@@ -173,10 +173,10 @@ static ssize_t vtpm_proxy_fops_write(struct file *filp, const char __user *buf,
173 * 173 *
174 * Return: Poll flags 174 * Return: Poll flags
175 */ 175 */
176static unsigned int vtpm_proxy_fops_poll(struct file *filp, poll_table *wait) 176static __poll_t vtpm_proxy_fops_poll(struct file *filp, poll_table *wait)
177{ 177{
178 struct proxy_dev *proxy_dev = filp->private_data; 178 struct proxy_dev *proxy_dev = filp->private_data;
179 unsigned ret; 179 __poll_t ret;
180 180
181 poll_wait(filp, &proxy_dev->wq, wait); 181 poll_wait(filp, &proxy_dev->wq, wait);
182 182
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index d1aed2513bd9..813a2e46824d 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -982,10 +982,10 @@ error_out:
982 return ret; 982 return ret;
983} 983}
984 984
985static unsigned int port_fops_poll(struct file *filp, poll_table *wait) 985static __poll_t port_fops_poll(struct file *filp, poll_table *wait)
986{ 986{
987 struct port *port; 987 struct port *port;
988 unsigned int ret; 988 __poll_t ret;
989 989
990 port = filp->private_data; 990 port = filp->private_data;
991 poll_wait(filp, &port->waitqueue, wait); 991 poll_wait(filp, &port->waitqueue, wait);
diff --git a/drivers/char/xillybus/xillybus_core.c b/drivers/char/xillybus/xillybus_core.c
index b6c9cdead7f3..88e1cf475d3f 100644
--- a/drivers/char/xillybus/xillybus_core.c
+++ b/drivers/char/xillybus/xillybus_core.c
@@ -1736,10 +1736,10 @@ end:
1736 return pos; 1736 return pos;
1737} 1737}
1738 1738
1739static unsigned int xillybus_poll(struct file *filp, poll_table *wait) 1739static __poll_t xillybus_poll(struct file *filp, poll_table *wait)
1740{ 1740{
1741 struct xilly_channel *channel = filp->private_data; 1741 struct xilly_channel *channel = filp->private_data;
1742 unsigned int mask = 0; 1742 __poll_t mask = 0;
1743 unsigned long flags; 1743 unsigned long flags;
1744 1744
1745 poll_wait(filp, &channel->endpoint->ep_wait, wait); 1745 poll_wait(filp, &channel->endpoint->ep_wait, wait);
diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index bc1cb284111c..12b62d0aac27 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -157,13 +157,13 @@ static void dma_buf_poll_cb(struct dma_fence *fence, struct dma_fence_cb *cb)
157 spin_unlock_irqrestore(&dcb->poll->lock, flags); 157 spin_unlock_irqrestore(&dcb->poll->lock, flags);
158} 158}
159 159
160static unsigned int dma_buf_poll(struct file *file, poll_table *poll) 160static __poll_t dma_buf_poll(struct file *file, poll_table *poll)
161{ 161{
162 struct dma_buf *dmabuf; 162 struct dma_buf *dmabuf;
163 struct reservation_object *resv; 163 struct reservation_object *resv;
164 struct reservation_object_list *fobj; 164 struct reservation_object_list *fobj;
165 struct dma_fence *fence_excl; 165 struct dma_fence *fence_excl;
166 unsigned long events; 166 __poll_t events;
167 unsigned shared_count, seq; 167 unsigned shared_count, seq;
168 168
169 dmabuf = file->private_data; 169 dmabuf = file->private_data;
@@ -195,7 +195,7 @@ retry:
195 195
196 if (fence_excl && (!(events & POLLOUT) || shared_count == 0)) { 196 if (fence_excl && (!(events & POLLOUT) || shared_count == 0)) {
197 struct dma_buf_poll_cb_t *dcb = &dmabuf->cb_excl; 197 struct dma_buf_poll_cb_t *dcb = &dmabuf->cb_excl;
198 unsigned long pevents = POLLIN; 198 __poll_t pevents = POLLIN;
199 199
200 if (shared_count == 0) 200 if (shared_count == 0)
201 pevents |= POLLOUT; 201 pevents |= POLLOUT;
diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
index 03830634e141..8e8c4a12a0bc 100644
--- a/drivers/dma-buf/sync_file.c
+++ b/drivers/dma-buf/sync_file.c
@@ -312,7 +312,7 @@ static int sync_file_release(struct inode *inode, struct file *file)
312 return 0; 312 return 0;
313} 313}
314 314
315static unsigned int sync_file_poll(struct file *file, poll_table *wait) 315static __poll_t sync_file_poll(struct file *file, poll_table *wait)
316{ 316{
317 struct sync_file *sync_file = file->private_data; 317 struct sync_file *sync_file = file->private_data;
318 318
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c
index a301fcf46e88..523391bb3fbe 100644
--- a/drivers/firewire/core-cdev.c
+++ b/drivers/firewire/core-cdev.c
@@ -1784,10 +1784,10 @@ static int fw_device_op_release(struct inode *inode, struct file *file)
1784 return 0; 1784 return 0;
1785} 1785}
1786 1786
1787static unsigned int fw_device_op_poll(struct file *file, poll_table * pt) 1787static __poll_t fw_device_op_poll(struct file *file, poll_table * pt)
1788{ 1788{
1789 struct client *client = file->private_data; 1789 struct client *client = file->private_data;
1790 unsigned int mask = 0; 1790 __poll_t mask = 0;
1791 1791
1792 poll_wait(file, &client->wait, pt); 1792 poll_wait(file, &client->wait, pt);
1793 1793
diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c
index 180f0a96528c..fee2e9e7ea20 100644
--- a/drivers/firewire/nosy.c
+++ b/drivers/firewire/nosy.c
@@ -328,11 +328,11 @@ nosy_release(struct inode *inode, struct file *file)
328 return 0; 328 return 0;
329} 329}
330 330
331static unsigned int 331static __poll_t
332nosy_poll(struct file *file, poll_table *pt) 332nosy_poll(struct file *file, poll_table *pt)
333{ 333{
334 struct client *client = file->private_data; 334 struct client *client = file->private_data;
335 unsigned int ret = 0; 335 __poll_t ret = 0;
336 336
337 poll_wait(file, &client->buffer.wait, pt); 337 poll_wait(file, &client->buffer.wait, pt);
338 338
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 14532d9576e4..5d6e8bb38ac7 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -604,11 +604,11 @@ struct lineevent_state {
604 (GPIOEVENT_REQUEST_RISING_EDGE | \ 604 (GPIOEVENT_REQUEST_RISING_EDGE | \
605 GPIOEVENT_REQUEST_FALLING_EDGE) 605 GPIOEVENT_REQUEST_FALLING_EDGE)
606 606
607static unsigned int lineevent_poll(struct file *filep, 607static __poll_t lineevent_poll(struct file *filep,
608 struct poll_table_struct *wait) 608 struct poll_table_struct *wait)
609{ 609{
610 struct lineevent_state *le = filep->private_data; 610 struct lineevent_state *le = filep->private_data;
611 unsigned int events = 0; 611 __poll_t events = 0;
612 612
613 poll_wait(filep, &le->wait, wait); 613 poll_wait(filep, &le->wait, wait);
614 614
diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c
index b3c6e997ccdb..9a17bd3639d1 100644
--- a/drivers/gpu/drm/drm_file.c
+++ b/drivers/gpu/drm/drm_file.c
@@ -559,10 +559,10 @@ EXPORT_SYMBOL(drm_read);
559 * 559 *
560 * Mask of POLL flags indicating the current status of the file. 560 * Mask of POLL flags indicating the current status of the file.
561 */ 561 */
562unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait) 562__poll_t drm_poll(struct file *filp, struct poll_table_struct *wait)
563{ 563{
564 struct drm_file *file_priv = filp->private_data; 564 struct drm_file *file_priv = filp->private_data;
565 unsigned int mask = 0; 565 __poll_t mask = 0;
566 566
567 poll_wait(filp, &file_priv->event_wait, wait); 567 poll_wait(filp, &file_priv->event_wait, wait);
568 568
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 59ee808f8fd9..d453756ca128 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -2331,12 +2331,12 @@ static enum hrtimer_restart oa_poll_check_timer_cb(struct hrtimer *hrtimer)
2331 * 2331 *
2332 * Returns: any poll events that are ready without sleeping 2332 * Returns: any poll events that are ready without sleeping
2333 */ 2333 */
2334static unsigned int i915_perf_poll_locked(struct drm_i915_private *dev_priv, 2334static __poll_t i915_perf_poll_locked(struct drm_i915_private *dev_priv,
2335 struct i915_perf_stream *stream, 2335 struct i915_perf_stream *stream,
2336 struct file *file, 2336 struct file *file,
2337 poll_table *wait) 2337 poll_table *wait)
2338{ 2338{
2339 unsigned int events = 0; 2339 __poll_t events = 0;
2340 2340
2341 stream->ops->poll_wait(stream, file, wait); 2341 stream->ops->poll_wait(stream, file, wait);
2342 2342
@@ -2365,11 +2365,11 @@ static unsigned int i915_perf_poll_locked(struct drm_i915_private *dev_priv,
2365 * 2365 *
2366 * Returns: any poll events that are ready without sleeping 2366 * Returns: any poll events that are ready without sleeping
2367 */ 2367 */
2368static unsigned int i915_perf_poll(struct file *file, poll_table *wait) 2368static __poll_t i915_perf_poll(struct file *file, poll_table *wait)
2369{ 2369{
2370 struct i915_perf_stream *stream = file->private_data; 2370 struct i915_perf_stream *stream = file->private_data;
2371 struct drm_i915_private *dev_priv = stream->dev_priv; 2371 struct drm_i915_private *dev_priv = stream->dev_priv;
2372 int ret; 2372 __poll_t ret;
2373 2373
2374 mutex_lock(&dev_priv->perf.lock); 2374 mutex_lock(&dev_priv->perf.lock);
2375 ret = i915_perf_poll_locked(dev_priv, stream, file, wait); 2375 ret = i915_perf_poll_locked(dev_priv, stream, file, wait);
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
index 7e5f30e234b1..d08753e8fd94 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
@@ -713,7 +713,7 @@ extern int vmw_present_ioctl(struct drm_device *dev, void *data,
713 struct drm_file *file_priv); 713 struct drm_file *file_priv);
714extern int vmw_present_readback_ioctl(struct drm_device *dev, void *data, 714extern int vmw_present_readback_ioctl(struct drm_device *dev, void *data,
715 struct drm_file *file_priv); 715 struct drm_file *file_priv);
716extern unsigned int vmw_fops_poll(struct file *filp, 716extern __poll_t vmw_fops_poll(struct file *filp,
717 struct poll_table_struct *wait); 717 struct poll_table_struct *wait);
718extern ssize_t vmw_fops_read(struct file *filp, char __user *buffer, 718extern ssize_t vmw_fops_read(struct file *filp, char __user *buffer,
719 size_t count, loff_t *offset); 719 size_t count, loff_t *offset);
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
index 01be355525e4..67f844678ac8 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
@@ -412,7 +412,7 @@ out_clips:
412 * Wrapper around the drm_poll function that makes sure the device is 412 * Wrapper around the drm_poll function that makes sure the device is
413 * processing the fifo if drm_poll decides to wait. 413 * processing the fifo if drm_poll decides to wait.
414 */ 414 */
415unsigned int vmw_fops_poll(struct file *filp, struct poll_table_struct *wait) 415__poll_t vmw_fops_poll(struct file *filp, struct poll_table_struct *wait)
416{ 416{
417 struct drm_file *file_priv = filp->private_data; 417 struct drm_file *file_priv = filp->private_data;
418 struct vmw_private *dev_priv = 418 struct vmw_private *dev_priv =
diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
index d35d6d271f3f..dfd8d0048980 100644
--- a/drivers/gpu/vga/vgaarb.c
+++ b/drivers/gpu/vga/vgaarb.c
@@ -1266,7 +1266,7 @@ done:
1266 return ret_val; 1266 return ret_val;
1267} 1267}
1268 1268
1269static unsigned int vga_arb_fpoll(struct file *file, poll_table *wait) 1269static __poll_t vga_arb_fpoll(struct file *file, poll_table *wait)
1270{ 1270{
1271 pr_debug("%s\n", __func__); 1271 pr_debug("%s\n", __func__);
1272 1272
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
index 5271db593478..c783fd5ef809 100644
--- a/drivers/hid/hid-debug.c
+++ b/drivers/hid/hid-debug.c
@@ -1179,7 +1179,7 @@ out:
1179 return ret; 1179 return ret;
1180} 1180}
1181 1181
1182static unsigned int hid_debug_events_poll(struct file *file, poll_table *wait) 1182static __poll_t hid_debug_events_poll(struct file *file, poll_table *wait)
1183{ 1183{
1184 struct hid_debug_list *list = file->private_data; 1184 struct hid_debug_list *list = file->private_data;
1185 1185
diff --git a/drivers/hid/hid-roccat.c b/drivers/hid/hid-roccat.c
index fb77dec720a4..b7e86aba6f33 100644
--- a/drivers/hid/hid-roccat.c
+++ b/drivers/hid/hid-roccat.c
@@ -137,7 +137,7 @@ exit_unlock:
137 return retval; 137 return retval;
138} 138}
139 139
140static unsigned int roccat_poll(struct file *file, poll_table *wait) 140static __poll_t roccat_poll(struct file *file, poll_table *wait)
141{ 141{
142 struct roccat_reader *reader = file->private_data; 142 struct roccat_reader *reader = file->private_data;
143 poll_wait(file, &reader->device->wait, wait); 143 poll_wait(file, &reader->device->wait, wait);
diff --git a/drivers/hid/hid-sensor-custom.c b/drivers/hid/hid-sensor-custom.c
index 0bcf041368c7..21ed6c55c40a 100644
--- a/drivers/hid/hid-sensor-custom.c
+++ b/drivers/hid/hid-sensor-custom.c
@@ -702,11 +702,11 @@ static int hid_sensor_custom_open(struct inode *inode, struct file *file)
702 return nonseekable_open(inode, file); 702 return nonseekable_open(inode, file);
703} 703}
704 704
705static unsigned int hid_sensor_custom_poll(struct file *file, 705static __poll_t hid_sensor_custom_poll(struct file *file,
706 struct poll_table_struct *wait) 706 struct poll_table_struct *wait)
707{ 707{
708 struct hid_sensor_custom *sensor_inst; 708 struct hid_sensor_custom *sensor_inst;
709 unsigned int mask = 0; 709 __poll_t mask = 0;
710 710
711 sensor_inst = container_of(file->private_data, 711 sensor_inst = container_of(file->private_data,
712 struct hid_sensor_custom, custom_dev); 712 struct hid_sensor_custom, custom_dev);
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index 5fbe0f81ab2e..be210219f982 100644
--- a/drivers/hid/hidraw.c
+++ b/drivers/hid/hidraw.c
@@ -249,7 +249,7 @@ out:
249 return ret; 249 return ret;
250} 250}
251 251
252static unsigned int hidraw_poll(struct file *file, poll_table *wait) 252static __poll_t hidraw_poll(struct file *file, poll_table *wait)
253{ 253{
254 struct hidraw_list *list = file->private_data; 254 struct hidraw_list *list = file->private_data;
255 255
diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c
index 6f819f144cb4..fc43850a155e 100644
--- a/drivers/hid/uhid.c
+++ b/drivers/hid/uhid.c
@@ -753,7 +753,7 @@ unlock:
753 return ret ? ret : count; 753 return ret ? ret : count;
754} 754}
755 755
756static unsigned int uhid_char_poll(struct file *file, poll_table *wait) 756static __poll_t uhid_char_poll(struct file *file, poll_table *wait)
757{ 757{
758 struct uhid_device *uhid = file->private_data; 758 struct uhid_device *uhid = file->private_data;
759 759
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
index 7d749b19c27c..0ff3e7e70c8d 100644
--- a/drivers/hid/usbhid/hiddev.c
+++ b/drivers/hid/usbhid/hiddev.c
@@ -422,7 +422,7 @@ static ssize_t hiddev_read(struct file * file, char __user * buffer, size_t coun
422 * "poll" file op 422 * "poll" file op
423 * No kernel lock - fine 423 * No kernel lock - fine
424 */ 424 */
425static unsigned int hiddev_poll(struct file *file, poll_table *wait) 425static __poll_t hiddev_poll(struct file *file, poll_table *wait)
426{ 426{
427 struct hiddev_list *list = file->private_data; 427 struct hiddev_list *list = file->private_data;
428 428
diff --git a/drivers/hsi/clients/cmt_speech.c b/drivers/hsi/clients/cmt_speech.c
index 727f968ac1cb..e6ad3de6c975 100644
--- a/drivers/hsi/clients/cmt_speech.c
+++ b/drivers/hsi/clients/cmt_speech.c
@@ -1124,10 +1124,10 @@ static int cs_char_fasync(int fd, struct file *file, int on)
1124 return 0; 1124 return 0;
1125} 1125}
1126 1126
1127static unsigned int cs_char_poll(struct file *file, poll_table *wait) 1127static __poll_t cs_char_poll(struct file *file, poll_table *wait)
1128{ 1128{
1129 struct cs_char *csdata = file->private_data; 1129 struct cs_char *csdata = file->private_data;
1130 unsigned int ret = 0; 1130 __poll_t ret = 0;
1131 1131
1132 poll_wait(file, &cs_char_data.wait, wait); 1132 poll_wait(file, &cs_char_data.wait, wait);
1133 spin_lock_bh(&csdata->lock); 1133 spin_lock_bh(&csdata->lock);
diff --git a/drivers/hv/hv_utils_transport.c b/drivers/hv/hv_utils_transport.c
index 4402a71e23f7..047959e74bb1 100644
--- a/drivers/hv/hv_utils_transport.c
+++ b/drivers/hv/hv_utils_transport.c
@@ -104,7 +104,7 @@ static ssize_t hvt_op_write(struct file *file, const char __user *buf,
104 return ret ? ret : count; 104 return ret ? ret : count;
105} 105}
106 106
107static unsigned int hvt_op_poll(struct file *file, poll_table *wait) 107static __poll_t hvt_op_poll(struct file *file, poll_table *wait)
108{ 108{
109 struct hvutil_transport *hvt; 109 struct hvutil_transport *hvt;
110 110
diff --git a/drivers/iio/iio_core.h b/drivers/iio/iio_core.h
index 4c45488e3a7f..c775fedbcaf6 100644
--- a/drivers/iio/iio_core.h
+++ b/drivers/iio/iio_core.h
@@ -43,7 +43,7 @@ ssize_t iio_format_value(char *buf, unsigned int type, int size, int *vals);
43#ifdef CONFIG_IIO_BUFFER 43#ifdef CONFIG_IIO_BUFFER
44struct poll_table_struct; 44struct poll_table_struct;
45 45
46unsigned int iio_buffer_poll(struct file *filp, 46__poll_t iio_buffer_poll(struct file *filp,
47 struct poll_table_struct *wait); 47 struct poll_table_struct *wait);
48ssize_t iio_buffer_read_first_n_outer(struct file *filp, char __user *buf, 48ssize_t iio_buffer_read_first_n_outer(struct file *filp, char __user *buf,
49 size_t n, loff_t *f_ps); 49 size_t n, loff_t *f_ps);
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index d2b465140a6b..0bc2fe31f211 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -169,7 +169,7 @@ ssize_t iio_buffer_read_first_n_outer(struct file *filp, char __user *buf,
169 * Return: (POLLIN | POLLRDNORM) if data is available for reading 169 * Return: (POLLIN | POLLRDNORM) if data is available for reading
170 * or 0 for other cases 170 * or 0 for other cases
171 */ 171 */
172unsigned int iio_buffer_poll(struct file *filp, 172__poll_t iio_buffer_poll(struct file *filp,
173 struct poll_table_struct *wait) 173 struct poll_table_struct *wait)
174{ 174{
175 struct iio_dev *indio_dev = filp->private_data; 175 struct iio_dev *indio_dev = filp->private_data;
diff --git a/drivers/iio/industrialio-event.c b/drivers/iio/industrialio-event.c
index 90fac8ec63c9..0bcf073e46db 100644
--- a/drivers/iio/industrialio-event.c
+++ b/drivers/iio/industrialio-event.c
@@ -95,12 +95,12 @@ EXPORT_SYMBOL(iio_push_event);
95 * Return: (POLLIN | POLLRDNORM) if data is available for reading 95 * Return: (POLLIN | POLLRDNORM) if data is available for reading
96 * or a negative error code on failure 96 * or a negative error code on failure
97 */ 97 */
98static unsigned int iio_event_poll(struct file *filep, 98static __poll_t iio_event_poll(struct file *filep,
99 struct poll_table_struct *wait) 99 struct poll_table_struct *wait)
100{ 100{
101 struct iio_dev *indio_dev = filep->private_data; 101 struct iio_dev *indio_dev = filep->private_data;
102 struct iio_event_interface *ev_int = indio_dev->event_interface; 102 struct iio_event_interface *ev_int = indio_dev->event_interface;
103 unsigned int events = 0; 103 __poll_t events = 0;
104 104
105 if (!indio_dev->info) 105 if (!indio_dev->info)
106 return events; 106 return events;
diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c
index f2a7f62c2834..f7adae0adc19 100644
--- a/drivers/infiniband/core/ucm.c
+++ b/drivers/infiniband/core/ucm.c
@@ -1130,11 +1130,11 @@ static ssize_t ib_ucm_write(struct file *filp, const char __user *buf,
1130 return result; 1130 return result;
1131} 1131}
1132 1132
1133static unsigned int ib_ucm_poll(struct file *filp, 1133static __poll_t ib_ucm_poll(struct file *filp,
1134 struct poll_table_struct *wait) 1134 struct poll_table_struct *wait)
1135{ 1135{
1136 struct ib_ucm_file *file = filp->private_data; 1136 struct ib_ucm_file *file = filp->private_data;
1137 unsigned int mask = 0; 1137 __poll_t mask = 0;
1138 1138
1139 poll_wait(filp, &file->poll_wait, wait); 1139 poll_wait(filp, &file->poll_wait, wait);
1140 1140
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index eb85b546e223..e4be89d1f3d8 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -1630,10 +1630,10 @@ static ssize_t ucma_write(struct file *filp, const char __user *buf,
1630 return ret; 1630 return ret;
1631} 1631}
1632 1632
1633static unsigned int ucma_poll(struct file *filp, struct poll_table_struct *wait) 1633static __poll_t ucma_poll(struct file *filp, struct poll_table_struct *wait)
1634{ 1634{
1635 struct ucma_file *file = filp->private_data; 1635 struct ucma_file *file = filp->private_data;
1636 unsigned int mask = 0; 1636 __poll_t mask = 0;
1637 1637
1638 poll_wait(filp, &file->poll_wait, wait); 1638 poll_wait(filp, &file->poll_wait, wait);
1639 1639
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
index 4b64dd02e090..0c32d10f23ff 100644
--- a/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -617,12 +617,12 @@ err:
617 return ret; 617 return ret;
618} 618}
619 619
620static unsigned int ib_umad_poll(struct file *filp, struct poll_table_struct *wait) 620static __poll_t ib_umad_poll(struct file *filp, struct poll_table_struct *wait)
621{ 621{
622 struct ib_umad_file *file = filp->private_data; 622 struct ib_umad_file *file = filp->private_data;
623 623
624 /* we will always be able to post a MAD send */ 624 /* we will always be able to post a MAD send */
625 unsigned int mask = POLLOUT | POLLWRNORM; 625 __poll_t mask = POLLOUT | POLLWRNORM;
626 626
627 poll_wait(filp, &file->recv_wait, wait); 627 poll_wait(filp, &file->recv_wait, wait);
628 628
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 381fd9c096ae..5f216ffb465a 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -339,11 +339,11 @@ static ssize_t ib_uverbs_comp_event_read(struct file *filp, char __user *buf,
339 sizeof(struct ib_uverbs_comp_event_desc)); 339 sizeof(struct ib_uverbs_comp_event_desc));
340} 340}
341 341
342static unsigned int ib_uverbs_event_poll(struct ib_uverbs_event_queue *ev_queue, 342static __poll_t ib_uverbs_event_poll(struct ib_uverbs_event_queue *ev_queue,
343 struct file *filp, 343 struct file *filp,
344 struct poll_table_struct *wait) 344 struct poll_table_struct *wait)
345{ 345{
346 unsigned int pollflags = 0; 346 __poll_t pollflags = 0;
347 347
348 poll_wait(filp, &ev_queue->poll_wait, wait); 348 poll_wait(filp, &ev_queue->poll_wait, wait);
349 349
@@ -355,13 +355,13 @@ static unsigned int ib_uverbs_event_poll(struct ib_uverbs_event_queue *ev_queue,
355 return pollflags; 355 return pollflags;
356} 356}
357 357
358static unsigned int ib_uverbs_async_event_poll(struct file *filp, 358static __poll_t ib_uverbs_async_event_poll(struct file *filp,
359 struct poll_table_struct *wait) 359 struct poll_table_struct *wait)
360{ 360{
361 return ib_uverbs_event_poll(filp->private_data, filp, wait); 361 return ib_uverbs_event_poll(filp->private_data, filp, wait);
362} 362}
363 363
364static unsigned int ib_uverbs_comp_event_poll(struct file *filp, 364static __poll_t ib_uverbs_comp_event_poll(struct file *filp,
365 struct poll_table_struct *wait) 365 struct poll_table_struct *wait)
366{ 366{
367 struct ib_uverbs_completion_event_file *comp_ev_file = 367 struct ib_uverbs_completion_event_file *comp_ev_file =
diff --git a/drivers/infiniband/hw/hfi1/file_ops.c b/drivers/infiniband/hw/hfi1/file_ops.c
index 1df7da47f431..bd6f03cc5ee0 100644
--- a/drivers/infiniband/hw/hfi1/file_ops.c
+++ b/drivers/infiniband/hw/hfi1/file_ops.c
@@ -74,7 +74,7 @@
74static int hfi1_file_open(struct inode *inode, struct file *fp); 74static int hfi1_file_open(struct inode *inode, struct file *fp);
75static int hfi1_file_close(struct inode *inode, struct file *fp); 75static int hfi1_file_close(struct inode *inode, struct file *fp);
76static ssize_t hfi1_write_iter(struct kiocb *kiocb, struct iov_iter *from); 76static ssize_t hfi1_write_iter(struct kiocb *kiocb, struct iov_iter *from);
77static unsigned int hfi1_poll(struct file *fp, struct poll_table_struct *pt); 77static __poll_t hfi1_poll(struct file *fp, struct poll_table_struct *pt);
78static int hfi1_file_mmap(struct file *fp, struct vm_area_struct *vma); 78static int hfi1_file_mmap(struct file *fp, struct vm_area_struct *vma);
79 79
80static u64 kvirt_to_phys(void *addr); 80static u64 kvirt_to_phys(void *addr);
@@ -102,8 +102,8 @@ static int allocate_ctxt(struct hfi1_filedata *fd, struct hfi1_devdata *dd,
102 struct hfi1_user_info *uinfo, 102 struct hfi1_user_info *uinfo,
103 struct hfi1_ctxtdata **cd); 103 struct hfi1_ctxtdata **cd);
104static void deallocate_ctxt(struct hfi1_ctxtdata *uctxt); 104static void deallocate_ctxt(struct hfi1_ctxtdata *uctxt);
105static unsigned int poll_urgent(struct file *fp, struct poll_table_struct *pt); 105static __poll_t poll_urgent(struct file *fp, struct poll_table_struct *pt);
106static unsigned int poll_next(struct file *fp, struct poll_table_struct *pt); 106static __poll_t poll_next(struct file *fp, struct poll_table_struct *pt);
107static int user_event_ack(struct hfi1_ctxtdata *uctxt, u16 subctxt, 107static int user_event_ack(struct hfi1_ctxtdata *uctxt, u16 subctxt,
108 unsigned long arg); 108 unsigned long arg);
109static int set_ctxt_pkey(struct hfi1_ctxtdata *uctxt, unsigned long arg); 109static int set_ctxt_pkey(struct hfi1_ctxtdata *uctxt, unsigned long arg);
@@ -607,10 +607,10 @@ static int vma_fault(struct vm_fault *vmf)
607 return 0; 607 return 0;
608} 608}
609 609
610static unsigned int hfi1_poll(struct file *fp, struct poll_table_struct *pt) 610static __poll_t hfi1_poll(struct file *fp, struct poll_table_struct *pt)
611{ 611{
612 struct hfi1_ctxtdata *uctxt; 612 struct hfi1_ctxtdata *uctxt;
613 unsigned pollflag; 613 __poll_t pollflag;
614 614
615 uctxt = ((struct hfi1_filedata *)fp->private_data)->uctxt; 615 uctxt = ((struct hfi1_filedata *)fp->private_data)->uctxt;
616 if (!uctxt) 616 if (!uctxt)
@@ -1425,13 +1425,13 @@ static int user_exp_rcv_invalid(struct hfi1_filedata *fd, unsigned long arg,
1425 return ret; 1425 return ret;
1426} 1426}
1427 1427
1428static unsigned int poll_urgent(struct file *fp, 1428static __poll_t poll_urgent(struct file *fp,
1429 struct poll_table_struct *pt) 1429 struct poll_table_struct *pt)
1430{ 1430{
1431 struct hfi1_filedata *fd = fp->private_data; 1431 struct hfi1_filedata *fd = fp->private_data;
1432 struct hfi1_ctxtdata *uctxt = fd->uctxt; 1432 struct hfi1_ctxtdata *uctxt = fd->uctxt;
1433 struct hfi1_devdata *dd = uctxt->dd; 1433 struct hfi1_devdata *dd = uctxt->dd;
1434 unsigned pollflag; 1434 __poll_t pollflag;
1435 1435
1436 poll_wait(fp, &uctxt->wait, pt); 1436 poll_wait(fp, &uctxt->wait, pt);
1437 1437
@@ -1448,13 +1448,13 @@ static unsigned int poll_urgent(struct file *fp,
1448 return pollflag; 1448 return pollflag;
1449} 1449}
1450 1450
1451static unsigned int poll_next(struct file *fp, 1451static __poll_t poll_next(struct file *fp,
1452 struct poll_table_struct *pt) 1452 struct poll_table_struct *pt)
1453{ 1453{
1454 struct hfi1_filedata *fd = fp->private_data; 1454 struct hfi1_filedata *fd = fp->private_data;
1455 struct hfi1_ctxtdata *uctxt = fd->uctxt; 1455 struct hfi1_ctxtdata *uctxt = fd->uctxt;
1456 struct hfi1_devdata *dd = uctxt->dd; 1456 struct hfi1_devdata *dd = uctxt->dd;
1457 unsigned pollflag; 1457 __poll_t pollflag;
1458 1458
1459 poll_wait(fp, &uctxt->wait, pt); 1459 poll_wait(fp, &uctxt->wait, pt);
1460 1460
diff --git a/drivers/infiniband/hw/qib/qib_file_ops.c b/drivers/infiniband/hw/qib/qib_file_ops.c
index 2d6a191afec0..b67df63bd64b 100644
--- a/drivers/infiniband/hw/qib/qib_file_ops.c
+++ b/drivers/infiniband/hw/qib/qib_file_ops.c
@@ -58,7 +58,7 @@ static int qib_open(struct inode *, struct file *);
58static int qib_close(struct inode *, struct file *); 58static int qib_close(struct inode *, struct file *);
59static ssize_t qib_write(struct file *, const char __user *, size_t, loff_t *); 59static ssize_t qib_write(struct file *, const char __user *, size_t, loff_t *);
60static ssize_t qib_write_iter(struct kiocb *, struct iov_iter *); 60static ssize_t qib_write_iter(struct kiocb *, struct iov_iter *);
61static unsigned int qib_poll(struct file *, struct poll_table_struct *); 61static __poll_t qib_poll(struct file *, struct poll_table_struct *);
62static int qib_mmapf(struct file *, struct vm_area_struct *); 62static int qib_mmapf(struct file *, struct vm_area_struct *);
63 63
64/* 64/*
@@ -1092,12 +1092,12 @@ bail:
1092 return ret; 1092 return ret;
1093} 1093}
1094 1094
1095static unsigned int qib_poll_urgent(struct qib_ctxtdata *rcd, 1095static __poll_t qib_poll_urgent(struct qib_ctxtdata *rcd,
1096 struct file *fp, 1096 struct file *fp,
1097 struct poll_table_struct *pt) 1097 struct poll_table_struct *pt)
1098{ 1098{
1099 struct qib_devdata *dd = rcd->dd; 1099 struct qib_devdata *dd = rcd->dd;
1100 unsigned pollflag; 1100 __poll_t pollflag;
1101 1101
1102 poll_wait(fp, &rcd->wait, pt); 1102 poll_wait(fp, &rcd->wait, pt);
1103 1103
@@ -1114,12 +1114,12 @@ static unsigned int qib_poll_urgent(struct qib_ctxtdata *rcd,
1114 return pollflag; 1114 return pollflag;
1115} 1115}
1116 1116
1117static unsigned int qib_poll_next(struct qib_ctxtdata *rcd, 1117static __poll_t qib_poll_next(struct qib_ctxtdata *rcd,
1118 struct file *fp, 1118 struct file *fp,
1119 struct poll_table_struct *pt) 1119 struct poll_table_struct *pt)
1120{ 1120{
1121 struct qib_devdata *dd = rcd->dd; 1121 struct qib_devdata *dd = rcd->dd;
1122 unsigned pollflag; 1122 __poll_t pollflag;
1123 1123
1124 poll_wait(fp, &rcd->wait, pt); 1124 poll_wait(fp, &rcd->wait, pt);
1125 1125
@@ -1135,10 +1135,10 @@ static unsigned int qib_poll_next(struct qib_ctxtdata *rcd,
1135 return pollflag; 1135 return pollflag;
1136} 1136}
1137 1137
1138static unsigned int qib_poll(struct file *fp, struct poll_table_struct *pt) 1138static __poll_t qib_poll(struct file *fp, struct poll_table_struct *pt)
1139{ 1139{
1140 struct qib_ctxtdata *rcd; 1140 struct qib_ctxtdata *rcd;
1141 unsigned pollflag; 1141 __poll_t pollflag;
1142 1142
1143 rcd = ctxt_fp(fp); 1143 rcd = ctxt_fp(fp);
1144 if (!rcd) 1144 if (!rcd)
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 925571475005..0193dd4f0452 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -635,11 +635,11 @@ static ssize_t evdev_read(struct file *file, char __user *buffer,
635} 635}
636 636
637/* No kernel lock - fine */ 637/* No kernel lock - fine */
638static unsigned int evdev_poll(struct file *file, poll_table *wait) 638static __poll_t evdev_poll(struct file *file, poll_table *wait)
639{ 639{
640 struct evdev_client *client = file->private_data; 640 struct evdev_client *client = file->private_data;
641 struct evdev *evdev = client->evdev; 641 struct evdev *evdev = client->evdev;
642 unsigned int mask; 642 __poll_t mask;
643 643
644 poll_wait(file, &evdev->wait, wait); 644 poll_wait(file, &evdev->wait, wait);
645 645
diff --git a/drivers/input/input.c b/drivers/input/input.c
index e30642db50d5..0d0b2ab1bb6b 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -1048,7 +1048,7 @@ static inline void input_wakeup_procfs_readers(void)
1048 wake_up(&input_devices_poll_wait); 1048 wake_up(&input_devices_poll_wait);
1049} 1049}
1050 1050
1051static unsigned int input_proc_devices_poll(struct file *file, poll_table *wait) 1051static __poll_t input_proc_devices_poll(struct file *file, poll_table *wait)
1052{ 1052{
1053 poll_wait(file, &input_devices_poll_wait, wait); 1053 poll_wait(file, &input_devices_poll_wait, wait);
1054 if (file->f_version != input_devices_state) { 1054 if (file->f_version != input_devices_state) {
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index 7b29a8944039..fe3255572886 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -436,7 +436,7 @@ static ssize_t joydev_read(struct file *file, char __user *buf,
436} 436}
437 437
438/* No kernel lock - fine */ 438/* No kernel lock - fine */
439static unsigned int joydev_poll(struct file *file, poll_table *wait) 439static __poll_t joydev_poll(struct file *file, poll_table *wait)
440{ 440{
441 struct joydev_client *client = file->private_data; 441 struct joydev_client *client = file->private_data;
442 struct joydev *joydev = client->joydev; 442 struct joydev *joydev = client->joydev;
diff --git a/drivers/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c
index 1c8c56efc995..9c3f7ec3bd3d 100644
--- a/drivers/input/misc/hp_sdc_rtc.c
+++ b/drivers/input/misc/hp_sdc_rtc.c
@@ -408,7 +408,7 @@ static ssize_t hp_sdc_rtc_read(struct file *file, char __user *buf,
408 return retval; 408 return retval;
409} 409}
410 410
411static unsigned int hp_sdc_rtc_poll(struct file *file, poll_table *wait) 411static __poll_t hp_sdc_rtc_poll(struct file *file, poll_table *wait)
412{ 412{
413 unsigned long l; 413 unsigned long l;
414 414
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index 39ddd9a73feb..91df0df15e68 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -694,7 +694,7 @@ static ssize_t uinput_read(struct file *file, char __user *buffer,
694 return retval; 694 return retval;
695} 695}
696 696
697static unsigned int uinput_poll(struct file *file, poll_table *wait) 697static __poll_t uinput_poll(struct file *file, poll_table *wait)
698{ 698{
699 struct uinput_device *udev = file->private_data; 699 struct uinput_device *udev = file->private_data;
700 700
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index 2d7f691ec71c..731d84ae5101 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -757,11 +757,11 @@ static ssize_t mousedev_read(struct file *file, char __user *buffer,
757} 757}
758 758
759/* No kernel lock - fine */ 759/* No kernel lock - fine */
760static unsigned int mousedev_poll(struct file *file, poll_table *wait) 760static __poll_t mousedev_poll(struct file *file, poll_table *wait)
761{ 761{
762 struct mousedev_client *client = file->private_data; 762 struct mousedev_client *client = file->private_data;
763 struct mousedev *mousedev = client->mousedev; 763 struct mousedev *mousedev = client->mousedev;
764 unsigned int mask; 764 __poll_t mask;
765 765
766 poll_wait(file, &mousedev->wait, wait); 766 poll_wait(file, &mousedev->wait, wait);
767 767
diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c
index 516f9fe77a17..fccf55a380b2 100644
--- a/drivers/input/serio/serio_raw.c
+++ b/drivers/input/serio/serio_raw.c
@@ -239,11 +239,11 @@ out:
239 return retval; 239 return retval;
240} 240}
241 241
242static unsigned int serio_raw_poll(struct file *file, poll_table *wait) 242static __poll_t serio_raw_poll(struct file *file, poll_table *wait)
243{ 243{
244 struct serio_raw_client *client = file->private_data; 244 struct serio_raw_client *client = file->private_data;
245 struct serio_raw *serio_raw = client->serio_raw; 245 struct serio_raw *serio_raw = client->serio_raw;
246 unsigned int mask; 246 __poll_t mask;
247 247
248 poll_wait(file, &serio_raw->wait, wait); 248 poll_wait(file, &serio_raw->wait, wait);
249 249
diff --git a/drivers/input/serio/userio.c b/drivers/input/serio/userio.c
index df1fd41860ac..a63de06b08bc 100644
--- a/drivers/input/serio/userio.c
+++ b/drivers/input/serio/userio.c
@@ -248,7 +248,7 @@ out:
248 return error ?: count; 248 return error ?: count;
249} 249}
250 250
251static unsigned int userio_char_poll(struct file *file, poll_table *wait) 251static __poll_t userio_char_poll(struct file *file, poll_table *wait)
252{ 252{
253 struct userio_device *userio = file->private_data; 253 struct userio_device *userio = file->private_data;
254 254
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index dde8f46bc254..e268811dc544 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -724,11 +724,11 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos
724 return count; 724 return count;
725} 725}
726 726
727static unsigned int 727static __poll_t
728capi_poll(struct file *file, poll_table *wait) 728capi_poll(struct file *file, poll_table *wait)
729{ 729{
730 struct capidev *cdev = file->private_data; 730 struct capidev *cdev = file->private_data;
731 unsigned int mask = 0; 731 __poll_t mask = 0;
732 732
733 if (!cdev->ap.applid) 733 if (!cdev->ap.applid)
734 return POLLERR; 734 return POLLERR;
diff --git a/drivers/isdn/divert/divert_procfs.c b/drivers/isdn/divert/divert_procfs.c
index 1c5dc345e7c5..34b7704042a4 100644
--- a/drivers/isdn/divert/divert_procfs.c
+++ b/drivers/isdn/divert/divert_procfs.c
@@ -119,10 +119,10 @@ isdn_divert_write(struct file *file, const char __user *buf, size_t count, loff_
119/***************************************/ 119/***************************************/
120/* select routines for various kernels */ 120/* select routines for various kernels */
121/***************************************/ 121/***************************************/
122static unsigned int 122static __poll_t
123isdn_divert_poll(struct file *file, poll_table *wait) 123isdn_divert_poll(struct file *file, poll_table *wait)
124{ 124{
125 unsigned int mask = 0; 125 __poll_t mask = 0;
126 126
127 poll_wait(file, &(rd_queue), wait); 127 poll_wait(file, &(rd_queue), wait);
128 /* mask = POLLOUT | POLLWRNORM; */ 128 /* mask = POLLOUT | POLLWRNORM; */
diff --git a/drivers/isdn/hardware/eicon/divamnt.c b/drivers/isdn/hardware/eicon/divamnt.c
index 72e58bf07577..70f16102a001 100644
--- a/drivers/isdn/hardware/eicon/divamnt.c
+++ b/drivers/isdn/hardware/eicon/divamnt.c
@@ -98,9 +98,9 @@ void diva_os_get_time(dword *sec, dword *usec)
98/* 98/*
99 * device node operations 99 * device node operations
100 */ 100 */
101static unsigned int maint_poll(struct file *file, poll_table *wait) 101static __poll_t maint_poll(struct file *file, poll_table *wait)
102{ 102{
103 unsigned int mask = 0; 103 __poll_t mask = 0;
104 104
105 poll_wait(file, &msgwaitq, wait); 105 poll_wait(file, &msgwaitq, wait);
106 mask = POLLOUT | POLLWRNORM; 106 mask = POLLOUT | POLLWRNORM;
diff --git a/drivers/isdn/hardware/eicon/divasi.c b/drivers/isdn/hardware/eicon/divasi.c
index 0033d74a7291..da5cc5ab7e2d 100644
--- a/drivers/isdn/hardware/eicon/divasi.c
+++ b/drivers/isdn/hardware/eicon/divasi.c
@@ -74,7 +74,7 @@ static ssize_t um_idi_read(struct file *file, char __user *buf, size_t count,
74 loff_t *offset); 74 loff_t *offset);
75static ssize_t um_idi_write(struct file *file, const char __user *buf, 75static ssize_t um_idi_write(struct file *file, const char __user *buf,
76 size_t count, loff_t *offset); 76 size_t count, loff_t *offset);
77static unsigned int um_idi_poll(struct file *file, poll_table *wait); 77static __poll_t um_idi_poll(struct file *file, poll_table *wait);
78static int um_idi_open(struct inode *inode, struct file *file); 78static int um_idi_open(struct inode *inode, struct file *file);
79static int um_idi_release(struct inode *inode, struct file *file); 79static int um_idi_release(struct inode *inode, struct file *file);
80static int remove_entity(void *entity); 80static int remove_entity(void *entity);
@@ -365,7 +365,7 @@ um_idi_write(struct file *file, const char __user *buf, size_t count,
365 return (ret); 365 return (ret);
366} 366}
367 367
368static unsigned int um_idi_poll(struct file *file, poll_table *wait) 368static __poll_t um_idi_poll(struct file *file, poll_table *wait)
369{ 369{
370 diva_um_idi_os_context_t *p_os; 370 diva_um_idi_os_context_t *p_os;
371 371
diff --git a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c
index b2023e08dcd2..fbc788e6f0db 100644
--- a/drivers/isdn/hardware/eicon/divasmain.c
+++ b/drivers/isdn/hardware/eicon/divasmain.c
@@ -650,7 +650,7 @@ static ssize_t divas_read(struct file *file, char __user *buf,
650 return (ret); 650 return (ret);
651} 651}
652 652
653static unsigned int divas_poll(struct file *file, poll_table *wait) 653static __poll_t divas_poll(struct file *file, poll_table *wait)
654{ 654{
655 if (!file->private_data) { 655 if (!file->private_data) {
656 return (POLLERR); 656 return (POLLERR);
diff --git a/drivers/isdn/hardware/eicon/divasproc.c b/drivers/isdn/hardware/eicon/divasproc.c
index b57efd6ad916..3478f6f099eb 100644
--- a/drivers/isdn/hardware/eicon/divasproc.c
+++ b/drivers/isdn/hardware/eicon/divasproc.c
@@ -99,7 +99,7 @@ divas_write(struct file *file, const char __user *buf, size_t count, loff_t *off
99 return (-ENODEV); 99 return (-ENODEV);
100} 100}
101 101
102static unsigned int divas_poll(struct file *file, poll_table *wait) 102static __poll_t divas_poll(struct file *file, poll_table *wait)
103{ 103{
104 return (POLLERR); 104 return (POLLERR);
105} 105}
diff --git a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c
index aaca0b3d662e..6abea6915f49 100644
--- a/drivers/isdn/hysdn/hysdn_proclog.c
+++ b/drivers/isdn/hysdn/hysdn_proclog.c
@@ -281,10 +281,10 @@ hysdn_log_close(struct inode *ino, struct file *filep)
281/*************************************************/ 281/*************************************************/
282/* select/poll routine to be able using select() */ 282/* select/poll routine to be able using select() */
283/*************************************************/ 283/*************************************************/
284static unsigned int 284static __poll_t
285hysdn_log_poll(struct file *file, poll_table *wait) 285hysdn_log_poll(struct file *file, poll_table *wait)
286{ 286{
287 unsigned int mask = 0; 287 __poll_t mask = 0;
288 hysdn_card *card = PDE_DATA(file_inode(file)); 288 hysdn_card *card = PDE_DATA(file_inode(file));
289 struct procdata *pd = card->proclog; 289 struct procdata *pd = card->proclog;
290 290
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index 8b03d618185e..0521c32949d4 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -1227,10 +1227,10 @@ out:
1227 return retval; 1227 return retval;
1228} 1228}
1229 1229
1230static unsigned int 1230static __poll_t
1231isdn_poll(struct file *file, poll_table *wait) 1231isdn_poll(struct file *file, poll_table *wait)
1232{ 1232{
1233 unsigned int mask = 0; 1233 __poll_t mask = 0;
1234 unsigned int minor = iminor(file_inode(file)); 1234 unsigned int minor = iminor(file_inode(file));
1235 int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL); 1235 int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL);
1236 1236
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
index e07aefb9151d..57884319b4b1 100644
--- a/drivers/isdn/i4l/isdn_ppp.c
+++ b/drivers/isdn/i4l/isdn_ppp.c
@@ -685,10 +685,10 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg)
685 return 0; 685 return 0;
686} 686}
687 687
688unsigned int 688__poll_t
689isdn_ppp_poll(struct file *file, poll_table *wait) 689isdn_ppp_poll(struct file *file, poll_table *wait)
690{ 690{
691 u_int mask; 691 __poll_t mask;
692 struct ippp_buf_queue *bf, *bl; 692 struct ippp_buf_queue *bf, *bl;
693 u_long flags; 693 u_long flags;
694 struct ippp_struct *is; 694 struct ippp_struct *is;
diff --git a/drivers/isdn/i4l/isdn_ppp.h b/drivers/isdn/i4l/isdn_ppp.h
index 4e9b8935a4eb..34b8a2ce84f3 100644
--- a/drivers/isdn/i4l/isdn_ppp.h
+++ b/drivers/isdn/i4l/isdn_ppp.h
@@ -23,7 +23,7 @@ extern int isdn_ppp_autodial_filter(struct sk_buff *, isdn_net_local *);
23extern int isdn_ppp_xmit(struct sk_buff *, struct net_device *); 23extern int isdn_ppp_xmit(struct sk_buff *, struct net_device *);
24extern void isdn_ppp_receive(isdn_net_dev *, isdn_net_local *, struct sk_buff *); 24extern void isdn_ppp_receive(isdn_net_dev *, isdn_net_local *, struct sk_buff *);
25extern int isdn_ppp_dev_ioctl(struct net_device *, struct ifreq *, int); 25extern int isdn_ppp_dev_ioctl(struct net_device *, struct ifreq *, int);
26extern unsigned int isdn_ppp_poll(struct file *, struct poll_table_struct *); 26extern __poll_t isdn_ppp_poll(struct file *, struct poll_table_struct *);
27extern int isdn_ppp_ioctl(int, struct file *, unsigned int, unsigned long); 27extern int isdn_ppp_ioctl(int, struct file *, unsigned int, unsigned long);
28extern void isdn_ppp_release(int, struct file *); 28extern void isdn_ppp_release(int, struct file *);
29extern int isdn_ppp_dial_slave(char *); 29extern int isdn_ppp_dial_slave(char *);
diff --git a/drivers/isdn/mISDN/timerdev.c b/drivers/isdn/mISDN/timerdev.c
index c50a34340f67..f4272d4e0a26 100644
--- a/drivers/isdn/mISDN/timerdev.c
+++ b/drivers/isdn/mISDN/timerdev.c
@@ -141,11 +141,11 @@ mISDN_read(struct file *filep, char __user *buf, size_t count, loff_t *off)
141 return ret; 141 return ret;
142} 142}
143 143
144static unsigned int 144static __poll_t
145mISDN_poll(struct file *filep, poll_table *wait) 145mISDN_poll(struct file *filep, poll_table *wait)
146{ 146{
147 struct mISDNtimerdev *dev = filep->private_data; 147 struct mISDNtimerdev *dev = filep->private_data;
148 unsigned int mask = POLLERR; 148 __poll_t mask = POLLERR;
149 149
150 if (*debug & DEBUG_TIMER) 150 if (*debug & DEBUG_TIMER)
151 printk(KERN_DEBUG "%s(%p, %p)\n", __func__, filep, wait); 151 printk(KERN_DEBUG "%s(%p, %p)\n", __func__, filep, wait);
diff --git a/drivers/leds/uleds.c b/drivers/leds/uleds.c
index 5e9e8a1fdefb..5beacab05ed7 100644
--- a/drivers/leds/uleds.c
+++ b/drivers/leds/uleds.c
@@ -176,7 +176,7 @@ static ssize_t uleds_read(struct file *file, char __user *buffer, size_t count,
176 return retval; 176 return retval;
177} 177}
178 178
179static unsigned int uleds_poll(struct file *file, poll_table *wait) 179static __poll_t uleds_poll(struct file *file, poll_table *wait)
180{ 180{
181 struct uleds_device *udev = file->private_data; 181 struct uleds_device *udev = file->private_data;
182 182
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index 899ec1f4c833..346e6f5f77be 100644
--- a/drivers/macintosh/smu.c
+++ b/drivers/macintosh/smu.c
@@ -1245,10 +1245,10 @@ static ssize_t smu_read(struct file *file, char __user *buf,
1245 return -EBADFD; 1245 return -EBADFD;
1246} 1246}
1247 1247
1248static unsigned int smu_fpoll(struct file *file, poll_table *wait) 1248static __poll_t smu_fpoll(struct file *file, poll_table *wait)
1249{ 1249{
1250 struct smu_private *pp = file->private_data; 1250 struct smu_private *pp = file->private_data;
1251 unsigned int mask = 0; 1251 __poll_t mask = 0;
1252 unsigned long flags; 1252 unsigned long flags;
1253 1253
1254 if (pp == 0) 1254 if (pp == 0)
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index c4c2b3b85ebc..e8b29fc532e1 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -2157,11 +2157,11 @@ pmu_write(struct file *file, const char __user *buf,
2157 return 0; 2157 return 0;
2158} 2158}
2159 2159
2160static unsigned int 2160static __poll_t
2161pmu_fpoll(struct file *filp, poll_table *wait) 2161pmu_fpoll(struct file *filp, poll_table *wait)
2162{ 2162{
2163 struct pmu_private *pp = filp->private_data; 2163 struct pmu_private *pp = filp->private_data;
2164 unsigned int mask = 0; 2164 __poll_t mask = 0;
2165 unsigned long flags; 2165 unsigned long flags;
2166 2166
2167 if (pp == 0) 2167 if (pp == 0)
diff --git a/drivers/mailbox/mailbox-test.c b/drivers/mailbox/mailbox-test.c
index 93f3d4d61fa7..f84730d63b1f 100644
--- a/drivers/mailbox/mailbox-test.c
+++ b/drivers/mailbox/mailbox-test.c
@@ -235,7 +235,7 @@ kfree_err:
235 return ret; 235 return ret;
236} 236}
237 237
238static unsigned int 238static __poll_t
239mbox_test_message_poll(struct file *filp, struct poll_table_struct *wait) 239mbox_test_message_poll(struct file *filp, struct poll_table_struct *wait)
240{ 240{
241 struct mbox_test_device *tdev = filp->private_data; 241 struct mbox_test_device *tdev = filp->private_data;
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index e52676fa9832..3f6791afd3e4 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -1929,10 +1929,10 @@ static int dm_release(struct inode *inode, struct file *filp)
1929 return 0; 1929 return 0;
1930} 1930}
1931 1931
1932static unsigned dm_poll(struct file *filp, poll_table *wait) 1932static __poll_t dm_poll(struct file *filp, poll_table *wait)
1933{ 1933{
1934 struct dm_file *priv = filp->private_data; 1934 struct dm_file *priv = filp->private_data;
1935 unsigned mask = 0; 1935 __poll_t mask = 0;
1936 1936
1937 poll_wait(filp, &dm_global_eventq, wait); 1937 poll_wait(filp, &dm_global_eventq, wait);
1938 1938
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 4e4dee0ec2de..cb1476214f3f 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -7871,10 +7871,10 @@ static int md_seq_open(struct inode *inode, struct file *file)
7871} 7871}
7872 7872
7873static int md_unloading; 7873static int md_unloading;
7874static unsigned int mdstat_poll(struct file *filp, poll_table *wait) 7874static __poll_t mdstat_poll(struct file *filp, poll_table *wait)
7875{ 7875{
7876 struct seq_file *seq = filp->private_data; 7876 struct seq_file *seq = filp->private_data;
7877 int mask; 7877 __poll_t mask;
7878 7878
7879 if (md_unloading) 7879 if (md_unloading)
7880 return POLLIN|POLLRDNORM|POLLERR|POLLPRI; 7880 return POLLIN|POLLRDNORM|POLLERR|POLLPRI;
diff --git a/drivers/media/cec/cec-api.c b/drivers/media/cec/cec-api.c
index 3dba3aa34a43..9d6c496f756c 100644
--- a/drivers/media/cec/cec-api.c
+++ b/drivers/media/cec/cec-api.c
@@ -43,13 +43,13 @@ static inline struct cec_devnode *cec_devnode_data(struct file *filp)
43 43
44/* CEC file operations */ 44/* CEC file operations */
45 45
46static unsigned int cec_poll(struct file *filp, 46static __poll_t cec_poll(struct file *filp,
47 struct poll_table_struct *poll) 47 struct poll_table_struct *poll)
48{ 48{
49 struct cec_devnode *devnode = cec_devnode_data(filp); 49 struct cec_devnode *devnode = cec_devnode_data(filp);
50 struct cec_fh *fh = filp->private_data; 50 struct cec_fh *fh = filp->private_data;
51 struct cec_adapter *adap = fh->adap; 51 struct cec_adapter *adap = fh->adap;
52 unsigned int res = 0; 52 __poll_t res = 0;
53 53
54 if (!devnode->registered) 54 if (!devnode->registered)
55 return POLLERR | POLLHUP; 55 return POLLERR | POLLHUP;
diff --git a/drivers/media/common/saa7146/saa7146_fops.c b/drivers/media/common/saa7146/saa7146_fops.c
index 8c87d6837c49..8ee3eebef4db 100644
--- a/drivers/media/common/saa7146/saa7146_fops.c
+++ b/drivers/media/common/saa7146/saa7146_fops.c
@@ -320,13 +320,13 @@ static int fops_mmap(struct file *file, struct vm_area_struct * vma)
320 return res; 320 return res;
321} 321}
322 322
323static unsigned int __fops_poll(struct file *file, struct poll_table_struct *wait) 323static __poll_t __fops_poll(struct file *file, struct poll_table_struct *wait)
324{ 324{
325 struct video_device *vdev = video_devdata(file); 325 struct video_device *vdev = video_devdata(file);
326 struct saa7146_fh *fh = file->private_data; 326 struct saa7146_fh *fh = file->private_data;
327 struct videobuf_buffer *buf = NULL; 327 struct videobuf_buffer *buf = NULL;
328 struct videobuf_queue *q; 328 struct videobuf_queue *q;
329 unsigned int res = v4l2_ctrl_poll(file, wait); 329 __poll_t res = v4l2_ctrl_poll(file, wait);
330 330
331 DEB_EE("file:%p, poll:%p\n", file, wait); 331 DEB_EE("file:%p, poll:%p\n", file, wait);
332 332
@@ -359,10 +359,10 @@ static unsigned int __fops_poll(struct file *file, struct poll_table_struct *wai
359 return res; 359 return res;
360} 360}
361 361
362static unsigned int fops_poll(struct file *file, struct poll_table_struct *wait) 362static __poll_t fops_poll(struct file *file, struct poll_table_struct *wait)
363{ 363{
364 struct video_device *vdev = video_devdata(file); 364 struct video_device *vdev = video_devdata(file);
365 unsigned int res; 365 __poll_t res;
366 366
367 mutex_lock(vdev->lock); 367 mutex_lock(vdev->lock);
368 res = __fops_poll(file, wait); 368 res = __fops_poll(file, wait);
diff --git a/drivers/media/common/siano/smsdvb-debugfs.c b/drivers/media/common/siano/smsdvb-debugfs.c
index 1a8677ade391..0c0878bcf251 100644
--- a/drivers/media/common/siano/smsdvb-debugfs.c
+++ b/drivers/media/common/siano/smsdvb-debugfs.c
@@ -374,7 +374,7 @@ exit:
374 return rc; 374 return rc;
375} 375}
376 376
377static unsigned int smsdvb_stats_poll(struct file *file, poll_table *wait) 377static __poll_t smsdvb_stats_poll(struct file *file, poll_table *wait)
378{ 378{
379 struct smsdvb_debugfs *debug_data = file->private_data; 379 struct smsdvb_debugfs *debug_data = file->private_data;
380 int rc; 380 int rc;
@@ -384,12 +384,9 @@ static unsigned int smsdvb_stats_poll(struct file *file, poll_table *wait)
384 poll_wait(file, &debug_data->stats_queue, wait); 384 poll_wait(file, &debug_data->stats_queue, wait);
385 385
386 rc = smsdvb_stats_wait_read(debug_data); 386 rc = smsdvb_stats_wait_read(debug_data);
387 if (rc > 0)
388 rc = POLLIN | POLLRDNORM;
389
390 kref_put(&debug_data->refcount, smsdvb_debugfs_data_release); 387 kref_put(&debug_data->refcount, smsdvb_debugfs_data_release);
391 388
392 return rc; 389 return rc > 0 ? POLLIN | POLLRDNORM : 0;
393} 390}
394 391
395static ssize_t smsdvb_stats_read(struct file *file, char __user *user_buf, 392static ssize_t smsdvb_stats_read(struct file *file, char __user *user_buf,
diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c
index 3ddd44e1ee77..3fe0eb740a6d 100644
--- a/drivers/media/dvb-core/dmxdev.c
+++ b/drivers/media/dvb-core/dmxdev.c
@@ -1066,10 +1066,10 @@ static long dvb_demux_ioctl(struct file *file, unsigned int cmd,
1066 return dvb_usercopy(file, cmd, arg, dvb_demux_do_ioctl); 1066 return dvb_usercopy(file, cmd, arg, dvb_demux_do_ioctl);
1067} 1067}
1068 1068
1069static unsigned int dvb_demux_poll(struct file *file, poll_table *wait) 1069static __poll_t dvb_demux_poll(struct file *file, poll_table *wait)
1070{ 1070{
1071 struct dmxdev_filter *dmxdevfilter = file->private_data; 1071 struct dmxdev_filter *dmxdevfilter = file->private_data;
1072 unsigned int mask = 0; 1072 __poll_t mask = 0;
1073 1073
1074 if ((!dmxdevfilter) || dmxdevfilter->dev->exit) 1074 if ((!dmxdevfilter) || dmxdevfilter->dev->exit)
1075 return POLLERR; 1075 return POLLERR;
@@ -1160,11 +1160,11 @@ static long dvb_dvr_ioctl(struct file *file,
1160 return dvb_usercopy(file, cmd, arg, dvb_dvr_do_ioctl); 1160 return dvb_usercopy(file, cmd, arg, dvb_dvr_do_ioctl);
1161} 1161}
1162 1162
1163static unsigned int dvb_dvr_poll(struct file *file, poll_table *wait) 1163static __poll_t dvb_dvr_poll(struct file *file, poll_table *wait)
1164{ 1164{
1165 struct dvb_device *dvbdev = file->private_data; 1165 struct dvb_device *dvbdev = file->private_data;
1166 struct dmxdev *dmxdev = dvbdev->priv; 1166 struct dmxdev *dmxdev = dvbdev->priv;
1167 unsigned int mask = 0; 1167 __poll_t mask = 0;
1168 1168
1169 dprintk("%s\n", __func__); 1169 dprintk("%s\n", __func__);
1170 1170
diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c
index d48b61eb01f4..3f6c8bd8f869 100644
--- a/drivers/media/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb-core/dvb_ca_en50221.c
@@ -1782,11 +1782,11 @@ static int dvb_ca_en50221_io_release(struct inode *inode, struct file *file)
1782 * 1782 *
1783 * return: Standard poll mask. 1783 * return: Standard poll mask.
1784 */ 1784 */
1785static unsigned int dvb_ca_en50221_io_poll(struct file *file, poll_table *wait) 1785static __poll_t dvb_ca_en50221_io_poll(struct file *file, poll_table *wait)
1786{ 1786{
1787 struct dvb_device *dvbdev = file->private_data; 1787 struct dvb_device *dvbdev = file->private_data;
1788 struct dvb_ca_private *ca = dvbdev->priv; 1788 struct dvb_ca_private *ca = dvbdev->priv;
1789 unsigned int mask = 0; 1789 __poll_t mask = 0;
1790 int slot; 1790 int slot;
1791 int result = 0; 1791 int result = 0;
1792 1792
diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
index 2afaa8226342..48e16fd003a7 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -2470,7 +2470,7 @@ static int dvb_frontend_handle_ioctl(struct file *file,
2470} 2470}
2471 2471
2472 2472
2473static unsigned int dvb_frontend_poll(struct file *file, struct poll_table_struct *wait) 2473static __poll_t dvb_frontend_poll(struct file *file, struct poll_table_struct *wait)
2474{ 2474{
2475 struct dvb_device *dvbdev = file->private_data; 2475 struct dvb_device *dvbdev = file->private_data;
2476 struct dvb_frontend *fe = dvbdev->priv; 2476 struct dvb_frontend *fe = dvbdev->priv;
diff --git a/drivers/media/firewire/firedtv-ci.c b/drivers/media/firewire/firedtv-ci.c
index edbb30fdd9d9..fb8a1d2ffd24 100644
--- a/drivers/media/firewire/firedtv-ci.c
+++ b/drivers/media/firewire/firedtv-ci.c
@@ -207,7 +207,7 @@ static int fdtv_ca_ioctl(struct file *file, unsigned int cmd, void *arg)
207 return err; 207 return err;
208} 208}
209 209
210static unsigned int fdtv_ca_io_poll(struct file *file, poll_table *wait) 210static __poll_t fdtv_ca_io_poll(struct file *file, poll_table *wait)
211{ 211{
212 return POLLIN; 212 return POLLIN;
213} 213}
diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c
index 423248f577b6..3049b1f505e5 100644
--- a/drivers/media/media-devnode.c
+++ b/drivers/media/media-devnode.c
@@ -99,7 +99,7 @@ static ssize_t media_write(struct file *filp, const char __user *buf,
99 return devnode->fops->write(filp, buf, sz, off); 99 return devnode->fops->write(filp, buf, sz, off);
100} 100}
101 101
102static unsigned int media_poll(struct file *filp, 102static __poll_t media_poll(struct file *filp,
103 struct poll_table_struct *poll) 103 struct poll_table_struct *poll)
104{ 104{
105 struct media_devnode *devnode = media_devnode_data(filp); 105 struct media_devnode *devnode = media_devnode_data(filp);
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index b366a7e1d976..c988669e22ff 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -2955,13 +2955,13 @@ static ssize_t bttv_read(struct file *file, char __user *data,
2955 return retval; 2955 return retval;
2956} 2956}
2957 2957
2958static unsigned int bttv_poll(struct file *file, poll_table *wait) 2958static __poll_t bttv_poll(struct file *file, poll_table *wait)
2959{ 2959{
2960 struct bttv_fh *fh = file->private_data; 2960 struct bttv_fh *fh = file->private_data;
2961 struct bttv_buffer *buf; 2961 struct bttv_buffer *buf;
2962 enum v4l2_field field; 2962 enum v4l2_field field;
2963 unsigned int rc = 0; 2963 __poll_t rc = 0;
2964 unsigned long req_events = poll_requested_events(wait); 2964 __poll_t req_events = poll_requested_events(wait);
2965 2965
2966 if (v4l2_event_pending(&fh->fh)) 2966 if (v4l2_event_pending(&fh->fh))
2967 rc = POLLPRI; 2967 rc = POLLPRI;
@@ -3329,13 +3329,13 @@ static ssize_t radio_read(struct file *file, char __user *data,
3329 return cmd.result; 3329 return cmd.result;
3330} 3330}
3331 3331
3332static unsigned int radio_poll(struct file *file, poll_table *wait) 3332static __poll_t radio_poll(struct file *file, poll_table *wait)
3333{ 3333{
3334 struct bttv_fh *fh = file->private_data; 3334 struct bttv_fh *fh = file->private_data;
3335 struct bttv *btv = fh->btv; 3335 struct bttv *btv = fh->btv;
3336 unsigned long req_events = poll_requested_events(wait); 3336 __poll_t req_events = poll_requested_events(wait);
3337 struct saa6588_command cmd; 3337 struct saa6588_command cmd;
3338 unsigned int res = 0; 3338 __poll_t res = 0;
3339 3339
3340 if (v4l2_event_pending(&fh->fh)) 3340 if (v4l2_event_pending(&fh->fh))
3341 res = POLLPRI; 3341 res = POLLPRI;
diff --git a/drivers/media/pci/cx18/cx18-fileops.c b/drivers/media/pci/cx18/cx18-fileops.c
index 4f9c2395941b..2b0abd5bbf64 100644
--- a/drivers/media/pci/cx18/cx18-fileops.c
+++ b/drivers/media/pci/cx18/cx18-fileops.c
@@ -602,14 +602,14 @@ ssize_t cx18_v4l2_read(struct file *filp, char __user *buf, size_t count,
602 return cx18_read_pos(s, buf, count, pos, filp->f_flags & O_NONBLOCK); 602 return cx18_read_pos(s, buf, count, pos, filp->f_flags & O_NONBLOCK);
603} 603}
604 604
605unsigned int cx18_v4l2_enc_poll(struct file *filp, poll_table *wait) 605__poll_t cx18_v4l2_enc_poll(struct file *filp, poll_table *wait)
606{ 606{
607 unsigned long req_events = poll_requested_events(wait); 607 __poll_t req_events = poll_requested_events(wait);
608 struct cx18_open_id *id = file2id(filp); 608 struct cx18_open_id *id = file2id(filp);
609 struct cx18 *cx = id->cx; 609 struct cx18 *cx = id->cx;
610 struct cx18_stream *s = &cx->streams[id->type]; 610 struct cx18_stream *s = &cx->streams[id->type];
611 int eof = test_bit(CX18_F_S_STREAMOFF, &s->s_flags); 611 int eof = test_bit(CX18_F_S_STREAMOFF, &s->s_flags);
612 unsigned res = 0; 612 __poll_t res = 0;
613 613
614 /* Start a capture if there is none */ 614 /* Start a capture if there is none */
615 if (!eof && !test_bit(CX18_F_S_STREAMING, &s->s_flags) && 615 if (!eof && !test_bit(CX18_F_S_STREAMING, &s->s_flags) &&
@@ -629,7 +629,7 @@ unsigned int cx18_v4l2_enc_poll(struct file *filp, poll_table *wait)
629 629
630 if ((s->vb_type == V4L2_BUF_TYPE_VIDEO_CAPTURE) && 630 if ((s->vb_type == V4L2_BUF_TYPE_VIDEO_CAPTURE) &&
631 (id->type == CX18_ENC_STREAM_TYPE_YUV)) { 631 (id->type == CX18_ENC_STREAM_TYPE_YUV)) {
632 int videobuf_poll = videobuf_poll_stream(filp, &s->vbuf_q, wait); 632 __poll_t videobuf_poll = videobuf_poll_stream(filp, &s->vbuf_q, wait);
633 633
634 if (v4l2_event_pending(&id->fh)) 634 if (v4l2_event_pending(&id->fh))
635 res |= POLLPRI; 635 res |= POLLPRI;
diff --git a/drivers/media/pci/cx18/cx18-fileops.h b/drivers/media/pci/cx18/cx18-fileops.h
index 37ef34e866cb..5b44d30efd8f 100644
--- a/drivers/media/pci/cx18/cx18-fileops.h
+++ b/drivers/media/pci/cx18/cx18-fileops.h
@@ -23,7 +23,7 @@ ssize_t cx18_v4l2_read(struct file *filp, char __user *buf, size_t count,
23ssize_t cx18_v4l2_write(struct file *filp, const char __user *buf, size_t count, 23ssize_t cx18_v4l2_write(struct file *filp, const char __user *buf, size_t count,
24 loff_t *pos); 24 loff_t *pos);
25int cx18_v4l2_close(struct file *filp); 25int cx18_v4l2_close(struct file *filp);
26unsigned int cx18_v4l2_enc_poll(struct file *filp, poll_table *wait); 26__poll_t cx18_v4l2_enc_poll(struct file *filp, poll_table *wait);
27int cx18_start_capture(struct cx18_open_id *id); 27int cx18_start_capture(struct cx18_open_id *id);
28void cx18_stop_capture(struct cx18_open_id *id, int gop_end); 28void cx18_stop_capture(struct cx18_open_id *id, int gop_end);
29void cx18_mute(struct cx18 *cx); 29void cx18_mute(struct cx18 *cx);
diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c
index f4bd4908acdd..09a25d6c2cd1 100644
--- a/drivers/media/pci/ddbridge/ddbridge-core.c
+++ b/drivers/media/pci/ddbridge/ddbridge-core.c
@@ -732,13 +732,13 @@ static ssize_t ts_read(struct file *file, __user char *buf,
732 return (count && (left == count)) ? -EAGAIN : (count - left); 732 return (count && (left == count)) ? -EAGAIN : (count - left);
733} 733}
734 734
735static unsigned int ts_poll(struct file *file, poll_table *wait) 735static __poll_t ts_poll(struct file *file, poll_table *wait)
736{ 736{
737 struct dvb_device *dvbdev = file->private_data; 737 struct dvb_device *dvbdev = file->private_data;
738 struct ddb_output *output = dvbdev->priv; 738 struct ddb_output *output = dvbdev->priv;
739 struct ddb_input *input = output->port->input[0]; 739 struct ddb_input *input = output->port->input[0];
740 740
741 unsigned int mask = 0; 741 __poll_t mask = 0;
742 742
743 poll_wait(file, &input->dma->wq, wait); 743 poll_wait(file, &input->dma->wq, wait);
744 poll_wait(file, &output->dma->wq, wait); 744 poll_wait(file, &output->dma->wq, wait);
diff --git a/drivers/media/pci/ivtv/ivtv-fileops.c b/drivers/media/pci/ivtv/ivtv-fileops.c
index c9bd018e53de..4aa773507201 100644
--- a/drivers/media/pci/ivtv/ivtv-fileops.c
+++ b/drivers/media/pci/ivtv/ivtv-fileops.c
@@ -730,12 +730,12 @@ ssize_t ivtv_v4l2_write(struct file *filp, const char __user *user_buf, size_t c
730 return res; 730 return res;
731} 731}
732 732
733unsigned int ivtv_v4l2_dec_poll(struct file *filp, poll_table *wait) 733__poll_t ivtv_v4l2_dec_poll(struct file *filp, poll_table *wait)
734{ 734{
735 struct ivtv_open_id *id = fh2id(filp->private_data); 735 struct ivtv_open_id *id = fh2id(filp->private_data);
736 struct ivtv *itv = id->itv; 736 struct ivtv *itv = id->itv;
737 struct ivtv_stream *s = &itv->streams[id->type]; 737 struct ivtv_stream *s = &itv->streams[id->type];
738 int res = 0; 738 __poll_t res = 0;
739 739
740 /* add stream's waitq to the poll list */ 740 /* add stream's waitq to the poll list */
741 IVTV_DEBUG_HI_FILE("Decoder poll\n"); 741 IVTV_DEBUG_HI_FILE("Decoder poll\n");
@@ -764,14 +764,14 @@ unsigned int ivtv_v4l2_dec_poll(struct file *filp, poll_table *wait)
764 return res; 764 return res;
765} 765}
766 766
767unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table *wait) 767__poll_t ivtv_v4l2_enc_poll(struct file *filp, poll_table *wait)
768{ 768{
769 unsigned long req_events = poll_requested_events(wait); 769 __poll_t req_events = poll_requested_events(wait);
770 struct ivtv_open_id *id = fh2id(filp->private_data); 770 struct ivtv_open_id *id = fh2id(filp->private_data);
771 struct ivtv *itv = id->itv; 771 struct ivtv *itv = id->itv;
772 struct ivtv_stream *s = &itv->streams[id->type]; 772 struct ivtv_stream *s = &itv->streams[id->type];
773 int eof = test_bit(IVTV_F_S_STREAMOFF, &s->s_flags); 773 int eof = test_bit(IVTV_F_S_STREAMOFF, &s->s_flags);
774 unsigned res = 0; 774 __poll_t res = 0;
775 775
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) &&
diff --git a/drivers/media/pci/ivtv/ivtv-fileops.h b/drivers/media/pci/ivtv/ivtv-fileops.h
index 5e08800772ca..e0029b2b8d09 100644
--- a/drivers/media/pci/ivtv/ivtv-fileops.h
+++ b/drivers/media/pci/ivtv/ivtv-fileops.h
@@ -28,8 +28,8 @@ ssize_t ivtv_v4l2_read(struct file *filp, char __user *buf, size_t count,
28ssize_t ivtv_v4l2_write(struct file *filp, const char __user *buf, size_t count, 28ssize_t ivtv_v4l2_write(struct file *filp, const char __user *buf, size_t count,
29 loff_t * pos); 29 loff_t * pos);
30int ivtv_v4l2_close(struct file *filp); 30int ivtv_v4l2_close(struct file *filp);
31unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table * wait); 31__poll_t ivtv_v4l2_enc_poll(struct file *filp, poll_table * wait);
32unsigned int ivtv_v4l2_dec_poll(struct file *filp, poll_table * wait); 32__poll_t ivtv_v4l2_dec_poll(struct file *filp, poll_table * wait);
33int ivtv_start_capture(struct ivtv_open_id *id); 33int ivtv_start_capture(struct ivtv_open_id *id);
34void ivtv_stop_capture(struct ivtv_open_id *id, int gop_end); 34void ivtv_stop_capture(struct ivtv_open_id *id, int gop_end);
35int ivtv_start_decoding(struct ivtv_open_id *id, int speed); 35int ivtv_start_decoding(struct ivtv_open_id *id, int speed);
diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c
index 23999a8cef37..f74b08635082 100644
--- a/drivers/media/pci/meye/meye.c
+++ b/drivers/media/pci/meye/meye.c
@@ -1423,9 +1423,9 @@ static long vidioc_default(struct file *file, void *fh, bool valid_prio,
1423 1423
1424} 1424}
1425 1425
1426static unsigned int meye_poll(struct file *file, poll_table *wait) 1426static __poll_t meye_poll(struct file *file, poll_table *wait)
1427{ 1427{
1428 unsigned int res = v4l2_ctrl_poll(file, wait); 1428 __poll_t res = v4l2_ctrl_poll(file, wait);
1429 1429
1430 mutex_lock(&meye.lock); 1430 mutex_lock(&meye.lock);
1431 poll_wait(file, &meye.proc_list, wait); 1431 poll_wait(file, &meye.proc_list, wait);
diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c
index 82d2a24644e4..0ceaa3473cf2 100644
--- a/drivers/media/pci/saa7134/saa7134-video.c
+++ b/drivers/media/pci/saa7134/saa7134-video.c
@@ -1227,11 +1227,11 @@ static ssize_t radio_read(struct file *file, char __user *data,
1227 return cmd.result; 1227 return cmd.result;
1228} 1228}
1229 1229
1230static unsigned int radio_poll(struct file *file, poll_table *wait) 1230static __poll_t radio_poll(struct file *file, poll_table *wait)
1231{ 1231{
1232 struct saa7134_dev *dev = video_drvdata(file); 1232 struct saa7134_dev *dev = video_drvdata(file);
1233 struct saa6588_command cmd; 1233 struct saa6588_command cmd;
1234 unsigned int rc = v4l2_ctrl_poll(file, wait); 1234 __poll_t rc = v4l2_ctrl_poll(file, wait);
1235 1235
1236 cmd.instance = file; 1236 cmd.instance = file;
1237 cmd.event_list = wait; 1237 cmd.event_list = wait;
diff --git a/drivers/media/pci/saa7164/saa7164-encoder.c b/drivers/media/pci/saa7164/saa7164-encoder.c
index f21c245a54f7..e7b31a5b14fd 100644
--- a/drivers/media/pci/saa7164/saa7164-encoder.c
+++ b/drivers/media/pci/saa7164/saa7164-encoder.c
@@ -909,13 +909,13 @@ err:
909 return ret; 909 return ret;
910} 910}
911 911
912static unsigned int fops_poll(struct file *file, poll_table *wait) 912static __poll_t fops_poll(struct file *file, poll_table *wait)
913{ 913{
914 unsigned long req_events = poll_requested_events(wait); 914 __poll_t req_events = poll_requested_events(wait);
915 struct saa7164_encoder_fh *fh = 915 struct saa7164_encoder_fh *fh =
916 (struct saa7164_encoder_fh *)file->private_data; 916 (struct saa7164_encoder_fh *)file->private_data;
917 struct saa7164_port *port = fh->port; 917 struct saa7164_port *port = fh->port;
918 unsigned int mask = v4l2_ctrl_poll(file, wait); 918 __poll_t mask = v4l2_ctrl_poll(file, wait);
919 919
920 port->last_poll_msecs_diff = port->last_poll_msecs; 920 port->last_poll_msecs_diff = port->last_poll_msecs;
921 port->last_poll_msecs = jiffies_to_msecs(jiffies); 921 port->last_poll_msecs = jiffies_to_msecs(jiffies);
diff --git a/drivers/media/pci/saa7164/saa7164-vbi.c b/drivers/media/pci/saa7164/saa7164-vbi.c
index 9255d7d23947..6f97c8f2e00d 100644
--- a/drivers/media/pci/saa7164/saa7164-vbi.c
+++ b/drivers/media/pci/saa7164/saa7164-vbi.c
@@ -614,11 +614,11 @@ err:
614 return ret; 614 return ret;
615} 615}
616 616
617static unsigned int fops_poll(struct file *file, poll_table *wait) 617static __poll_t fops_poll(struct file *file, poll_table *wait)
618{ 618{
619 struct saa7164_vbi_fh *fh = (struct saa7164_vbi_fh *)file->private_data; 619 struct saa7164_vbi_fh *fh = (struct saa7164_vbi_fh *)file->private_data;
620 struct saa7164_port *port = fh->port; 620 struct saa7164_port *port = fh->port;
621 unsigned int mask = 0; 621 __poll_t mask = 0;
622 622
623 port->last_poll_msecs_diff = port->last_poll_msecs; 623 port->last_poll_msecs_diff = port->last_poll_msecs;
624 port->last_poll_msecs = jiffies_to_msecs(jiffies); 624 port->last_poll_msecs = jiffies_to_msecs(jiffies);
diff --git a/drivers/media/pci/ttpci/av7110_av.c b/drivers/media/pci/ttpci/av7110_av.c
index 2aa4ba675194..4d10e2f979d2 100644
--- a/drivers/media/pci/ttpci/av7110_av.c
+++ b/drivers/media/pci/ttpci/av7110_av.c
@@ -937,11 +937,11 @@ static int dvb_video_get_event (struct av7110 *av7110, struct video_event *event
937 * DVB device file operations 937 * DVB device file operations
938 ******************************************************************************/ 938 ******************************************************************************/
939 939
940static unsigned int dvb_video_poll(struct file *file, poll_table *wait) 940static __poll_t dvb_video_poll(struct file *file, poll_table *wait)
941{ 941{
942 struct dvb_device *dvbdev = file->private_data; 942 struct dvb_device *dvbdev = file->private_data;
943 struct av7110 *av7110 = dvbdev->priv; 943 struct av7110 *av7110 = dvbdev->priv;
944 unsigned int mask = 0; 944 __poll_t mask = 0;
945 945
946 dprintk(2, "av7110:%p, \n", av7110); 946 dprintk(2, "av7110:%p, \n", av7110);
947 947
@@ -989,11 +989,11 @@ static ssize_t dvb_video_write(struct file *file, const char __user *buf,
989 return dvb_play(av7110, buf, count, file->f_flags & O_NONBLOCK, 1); 989 return dvb_play(av7110, buf, count, file->f_flags & O_NONBLOCK, 1);
990} 990}
991 991
992static unsigned int dvb_audio_poll(struct file *file, poll_table *wait) 992static __poll_t dvb_audio_poll(struct file *file, poll_table *wait)
993{ 993{
994 struct dvb_device *dvbdev = file->private_data; 994 struct dvb_device *dvbdev = file->private_data;
995 struct av7110 *av7110 = dvbdev->priv; 995 struct av7110 *av7110 = dvbdev->priv;
996 unsigned int mask = 0; 996 __poll_t mask = 0;
997 997
998 dprintk(2, "av7110:%p, \n", av7110); 998 dprintk(2, "av7110:%p, \n", av7110);
999 999
diff --git a/drivers/media/pci/ttpci/av7110_ca.c b/drivers/media/pci/ttpci/av7110_ca.c
index 1fe49171d823..96ca227cf51b 100644
--- a/drivers/media/pci/ttpci/av7110_ca.c
+++ b/drivers/media/pci/ttpci/av7110_ca.c
@@ -223,13 +223,13 @@ static int dvb_ca_open(struct inode *inode, struct file *file)
223 return 0; 223 return 0;
224} 224}
225 225
226static unsigned int dvb_ca_poll (struct file *file, poll_table *wait) 226static __poll_t dvb_ca_poll (struct file *file, poll_table *wait)
227{ 227{
228 struct dvb_device *dvbdev = file->private_data; 228 struct dvb_device *dvbdev = file->private_data;
229 struct av7110 *av7110 = dvbdev->priv; 229 struct av7110 *av7110 = dvbdev->priv;
230 struct dvb_ringbuffer *rbuf = &av7110->ci_rbuffer; 230 struct dvb_ringbuffer *rbuf = &av7110->ci_rbuffer;
231 struct dvb_ringbuffer *wbuf = &av7110->ci_wbuffer; 231 struct dvb_ringbuffer *wbuf = &av7110->ci_wbuffer;
232 unsigned int mask = 0; 232 __poll_t mask = 0;
233 233
234 dprintk(8, "av7110:%p\n",av7110); 234 dprintk(8, "av7110:%p\n",av7110);
235 235
diff --git a/drivers/media/pci/zoran/zoran_driver.c b/drivers/media/pci/zoran/zoran_driver.c
index d07840072337..b6a6c4f171d0 100644
--- a/drivers/media/pci/zoran/zoran_driver.c
+++ b/drivers/media/pci/zoran/zoran_driver.c
@@ -2501,13 +2501,13 @@ static int zoran_s_jpegcomp(struct file *file, void *__fh,
2501 return res; 2501 return res;
2502} 2502}
2503 2503
2504static unsigned int 2504static __poll_t
2505zoran_poll (struct file *file, 2505zoran_poll (struct file *file,
2506 poll_table *wait) 2506 poll_table *wait)
2507{ 2507{
2508 struct zoran_fh *fh = file->private_data; 2508 struct zoran_fh *fh = file->private_data;
2509 struct zoran *zr = fh->zr; 2509 struct zoran *zr = fh->zr;
2510 int res = v4l2_ctrl_poll(file, wait); 2510 __poll_t res = v4l2_ctrl_poll(file, wait);
2511 int frame; 2511 int frame;
2512 unsigned long flags; 2512 unsigned long flags;
2513 2513
diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c
index 7b3f6f8e3dc8..cf65b39807fe 100644
--- a/drivers/media/platform/davinci/vpfe_capture.c
+++ b/drivers/media/platform/davinci/vpfe_capture.c
@@ -730,7 +730,7 @@ static int vpfe_mmap(struct file *file, struct vm_area_struct *vma)
730/* 730/*
731 * vpfe_poll: It is used for select/poll system call 731 * vpfe_poll: It is used for select/poll system call
732 */ 732 */
733static unsigned int vpfe_poll(struct file *file, poll_table *wait) 733static __poll_t vpfe_poll(struct file *file, poll_table *wait)
734{ 734{
735 struct vpfe_device *vpfe_dev = video_drvdata(file); 735 struct vpfe_device *vpfe_dev = video_drvdata(file);
736 736
diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c b/drivers/media/platform/exynos-gsc/gsc-m2m.c
index 2a2994ef15d5..b2dc524112f7 100644
--- a/drivers/media/platform/exynos-gsc/gsc-m2m.c
+++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c
@@ -707,12 +707,12 @@ static int gsc_m2m_release(struct file *file)
707 return 0; 707 return 0;
708} 708}
709 709
710static unsigned int gsc_m2m_poll(struct file *file, 710static __poll_t gsc_m2m_poll(struct file *file,
711 struct poll_table_struct *wait) 711 struct poll_table_struct *wait)
712{ 712{
713 struct gsc_ctx *ctx = fh_to_ctx(file->private_data); 713 struct gsc_ctx *ctx = fh_to_ctx(file->private_data);
714 struct gsc_dev *gsc = ctx->gsc_dev; 714 struct gsc_dev *gsc = ctx->gsc_dev;
715 unsigned int ret; 715 __poll_t ret;
716 716
717 if (mutex_lock_interruptible(&gsc->lock)) 717 if (mutex_lock_interruptible(&gsc->lock))
718 return -ERESTARTSYS; 718 return -ERESTARTSYS;
diff --git a/drivers/media/platform/fsl-viu.c b/drivers/media/platform/fsl-viu.c
index dba21215dc84..de285a269390 100644
--- a/drivers/media/platform/fsl-viu.c
+++ b/drivers/media/platform/fsl-viu.c
@@ -1263,13 +1263,13 @@ static ssize_t viu_read(struct file *file, char __user *data, size_t count,
1263 return 0; 1263 return 0;
1264} 1264}
1265 1265
1266static unsigned int viu_poll(struct file *file, struct poll_table_struct *wait) 1266static __poll_t viu_poll(struct file *file, struct poll_table_struct *wait)
1267{ 1267{
1268 struct viu_fh *fh = file->private_data; 1268 struct viu_fh *fh = file->private_data;
1269 struct videobuf_queue *q = &fh->vb_vidq; 1269 struct videobuf_queue *q = &fh->vb_vidq;
1270 struct viu_dev *dev = fh->dev; 1270 struct viu_dev *dev = fh->dev;
1271 unsigned long req_events = poll_requested_events(wait); 1271 __poll_t req_events = poll_requested_events(wait);
1272 unsigned int res = v4l2_ctrl_poll(file, wait); 1272 __poll_t res = v4l2_ctrl_poll(file, wait);
1273 1273
1274 if (V4L2_BUF_TYPE_VIDEO_CAPTURE != fh->type) 1274 if (V4L2_BUF_TYPE_VIDEO_CAPTURE != fh->type)
1275 return POLLERR; 1275 return POLLERR;
diff --git a/drivers/media/platform/m2m-deinterlace.c b/drivers/media/platform/m2m-deinterlace.c
index c8a12493f395..945ef1e2ccc7 100644
--- a/drivers/media/platform/m2m-deinterlace.c
+++ b/drivers/media/platform/m2m-deinterlace.c
@@ -950,11 +950,11 @@ static int deinterlace_release(struct file *file)
950 return 0; 950 return 0;
951} 951}
952 952
953static unsigned int deinterlace_poll(struct file *file, 953static __poll_t deinterlace_poll(struct file *file,
954 struct poll_table_struct *wait) 954 struct poll_table_struct *wait)
955{ 955{
956 struct deinterlace_ctx *ctx = file->private_data; 956 struct deinterlace_ctx *ctx = file->private_data;
957 int ret; 957 __poll_t ret;
958 958
959 deinterlace_lock(ctx); 959 deinterlace_lock(ctx);
960 ret = v4l2_m2m_poll(file, ctx->m2m_ctx, wait); 960 ret = v4l2_m2m_poll(file, ctx->m2m_ctx, wait);
diff --git a/drivers/media/platform/mx2_emmaprp.c b/drivers/media/platform/mx2_emmaprp.c
index 4a2b1afa19c4..5a8eff60e95f 100644
--- a/drivers/media/platform/mx2_emmaprp.c
+++ b/drivers/media/platform/mx2_emmaprp.c
@@ -838,12 +838,12 @@ static int emmaprp_release(struct file *file)
838 return 0; 838 return 0;
839} 839}
840 840
841static unsigned int emmaprp_poll(struct file *file, 841static __poll_t emmaprp_poll(struct file *file,
842 struct poll_table_struct *wait) 842 struct poll_table_struct *wait)
843{ 843{
844 struct emmaprp_dev *pcdev = video_drvdata(file); 844 struct emmaprp_dev *pcdev = video_drvdata(file);
845 struct emmaprp_ctx *ctx = file->private_data; 845 struct emmaprp_ctx *ctx = file->private_data;
846 unsigned int res; 846 __poll_t res;
847 847
848 mutex_lock(&pcdev->dev_mutex); 848 mutex_lock(&pcdev->dev_mutex);
849 res = v4l2_m2m_poll(file, ctx->m2m_ctx, wait); 849 res = v4l2_m2m_poll(file, ctx->m2m_ctx, wait);
diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c
index 6f1b0c799e58..abb14ee20538 100644
--- a/drivers/media/platform/omap/omap_vout.c
+++ b/drivers/media/platform/omap/omap_vout.c
@@ -839,7 +839,7 @@ static void omap_vout_buffer_release(struct videobuf_queue *q,
839/* 839/*
840 * File operations 840 * File operations
841 */ 841 */
842static unsigned int omap_vout_poll(struct file *file, 842static __poll_t omap_vout_poll(struct file *file,
843 struct poll_table_struct *wait) 843 struct poll_table_struct *wait)
844{ 844{
845 struct omap_vout_device *vout = file->private_data; 845 struct omap_vout_device *vout = file->private_data;
diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c
index 218e6d7ae93a..a751c89a3ea8 100644
--- a/drivers/media/platform/omap3isp/ispvideo.c
+++ b/drivers/media/platform/omap3isp/ispvideo.c
@@ -1383,11 +1383,11 @@ static int isp_video_release(struct file *file)
1383 return 0; 1383 return 0;
1384} 1384}
1385 1385
1386static unsigned int isp_video_poll(struct file *file, poll_table *wait) 1386static __poll_t isp_video_poll(struct file *file, poll_table *wait)
1387{ 1387{
1388 struct isp_video_fh *vfh = to_isp_video_fh(file->private_data); 1388 struct isp_video_fh *vfh = to_isp_video_fh(file->private_data);
1389 struct isp_video *video = video_drvdata(file); 1389 struct isp_video *video = video_drvdata(file);
1390 int ret; 1390 __poll_t ret;
1391 1391
1392 mutex_lock(&video->queue_lock); 1392 mutex_lock(&video->queue_lock);
1393 ret = vb2_poll(&vfh->queue, file, wait); 1393 ret = vb2_poll(&vfh->queue, file, wait);
diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c
index 25c7a7d42292..437395a61065 100644
--- a/drivers/media/platform/s3c-camif/camif-capture.c
+++ b/drivers/media/platform/s3c-camif/camif-capture.c
@@ -590,12 +590,12 @@ static int s3c_camif_close(struct file *file)
590 return ret; 590 return ret;
591} 591}
592 592
593static unsigned int s3c_camif_poll(struct file *file, 593static __poll_t s3c_camif_poll(struct file *file,
594 struct poll_table_struct *wait) 594 struct poll_table_struct *wait)
595{ 595{
596 struct camif_vp *vp = video_drvdata(file); 596 struct camif_vp *vp = video_drvdata(file);
597 struct camif_dev *camif = vp->camif; 597 struct camif_dev *camif = vp->camif;
598 int ret; 598 __poll_t ret;
599 599
600 mutex_lock(&camif->lock); 600 mutex_lock(&camif->lock);
601 if (vp->owner && vp->owner != file->private_data) 601 if (vp->owner && vp->owner != file->private_data)
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index bc68dbbcaec1..fe94bd6b705e 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -988,14 +988,14 @@ static int s5p_mfc_release(struct file *file)
988} 988}
989 989
990/* Poll */ 990/* Poll */
991static unsigned int s5p_mfc_poll(struct file *file, 991static __poll_t s5p_mfc_poll(struct file *file,
992 struct poll_table_struct *wait) 992 struct poll_table_struct *wait)
993{ 993{
994 struct s5p_mfc_ctx *ctx = fh_to_ctx(file->private_data); 994 struct s5p_mfc_ctx *ctx = fh_to_ctx(file->private_data);
995 struct s5p_mfc_dev *dev = ctx->dev; 995 struct s5p_mfc_dev *dev = ctx->dev;
996 struct vb2_queue *src_q, *dst_q; 996 struct vb2_queue *src_q, *dst_q;
997 struct vb2_buffer *src_vb = NULL, *dst_vb = NULL; 997 struct vb2_buffer *src_vb = NULL, *dst_vb = NULL;
998 unsigned int rc = 0; 998 __poll_t rc = 0;
999 unsigned long flags; 999 unsigned long flags;
1000 1000
1001 mutex_lock(&dev->mfc_mutex); 1001 mutex_lock(&dev->mfc_mutex);
diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c
index dedc1b024f6f..976ea0bb5b6c 100644
--- a/drivers/media/platform/sh_veu.c
+++ b/drivers/media/platform/sh_veu.c
@@ -1016,7 +1016,7 @@ static int sh_veu_release(struct file *file)
1016 return 0; 1016 return 0;
1017} 1017}
1018 1018
1019static unsigned int sh_veu_poll(struct file *file, 1019static __poll_t sh_veu_poll(struct file *file,
1020 struct poll_table_struct *wait) 1020 struct poll_table_struct *wait)
1021{ 1021{
1022 struct sh_veu_file *veu_file = file->private_data; 1022 struct sh_veu_file *veu_file = file->private_data;
diff --git a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
index 36762ec954e7..9b069783e3ed 100644
--- a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
+++ b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
@@ -1553,7 +1553,7 @@ static int sh_mobile_ceu_set_liveselection(struct soc_camera_device *icd,
1553 return ret; 1553 return ret;
1554} 1554}
1555 1555
1556static unsigned int sh_mobile_ceu_poll(struct file *file, poll_table *pt) 1556static __poll_t sh_mobile_ceu_poll(struct file *file, poll_table *pt)
1557{ 1557{
1558 struct soc_camera_device *icd = file->private_data; 1558 struct soc_camera_device *icd = file->private_data;
1559 1559
diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index 916ff68b73d4..d964c072832c 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -805,11 +805,11 @@ static int soc_camera_mmap(struct file *file, struct vm_area_struct *vma)
805 return err; 805 return err;
806} 806}
807 807
808static unsigned int soc_camera_poll(struct file *file, poll_table *pt) 808static __poll_t soc_camera_poll(struct file *file, poll_table *pt)
809{ 809{
810 struct soc_camera_device *icd = file->private_data; 810 struct soc_camera_device *icd = file->private_data;
811 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); 811 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
812 unsigned res = POLLERR; 812 __poll_t res = POLLERR;
813 813
814 if (icd->streamer != file) 814 if (icd->streamer != file)
815 return POLLERR; 815 return POLLERR;
diff --git a/drivers/media/platform/via-camera.c b/drivers/media/platform/via-camera.c
index 805d4a8fc17e..f77be9302120 100644
--- a/drivers/media/platform/via-camera.c
+++ b/drivers/media/platform/via-camera.c
@@ -764,7 +764,7 @@ out_unlock:
764} 764}
765 765
766 766
767static unsigned int viacam_poll(struct file *filp, struct poll_table_struct *pt) 767static __poll_t viacam_poll(struct file *filp, struct poll_table_struct *pt)
768{ 768{
769 struct via_camera *cam = video_drvdata(filp); 769 struct via_camera *cam = video_drvdata(filp);
770 770
diff --git a/drivers/media/platform/vivid/vivid-core.c b/drivers/media/platform/vivid/vivid-core.c
index 5f316a5e38db..c80239592088 100644
--- a/drivers/media/platform/vivid/vivid-core.c
+++ b/drivers/media/platform/vivid/vivid-core.c
@@ -416,7 +416,7 @@ static ssize_t vivid_radio_write(struct file *file, const char __user *buf,
416 return vivid_radio_tx_write(file, buf, size, offset); 416 return vivid_radio_tx_write(file, buf, size, offset);
417} 417}
418 418
419static unsigned int vivid_radio_poll(struct file *file, struct poll_table_struct *wait) 419static __poll_t vivid_radio_poll(struct file *file, struct poll_table_struct *wait)
420{ 420{
421 struct video_device *vdev = video_devdata(file); 421 struct video_device *vdev = video_devdata(file);
422 422
diff --git a/drivers/media/platform/vivid/vivid-radio-rx.c b/drivers/media/platform/vivid/vivid-radio-rx.c
index 47c36c26096b..71f3ebb7aecf 100644
--- a/drivers/media/platform/vivid/vivid-radio-rx.c
+++ b/drivers/media/platform/vivid/vivid-radio-rx.c
@@ -141,7 +141,7 @@ retry:
141 return i; 141 return i;
142} 142}
143 143
144unsigned int vivid_radio_rx_poll(struct file *file, struct poll_table_struct *wait) 144__poll_t vivid_radio_rx_poll(struct file *file, struct poll_table_struct *wait)
145{ 145{
146 return POLLIN | POLLRDNORM | v4l2_ctrl_poll(file, wait); 146 return POLLIN | POLLRDNORM | v4l2_ctrl_poll(file, wait);
147} 147}
diff --git a/drivers/media/platform/vivid/vivid-radio-rx.h b/drivers/media/platform/vivid/vivid-radio-rx.h
index 1077d8f061eb..2b33edb60942 100644
--- a/drivers/media/platform/vivid/vivid-radio-rx.h
+++ b/drivers/media/platform/vivid/vivid-radio-rx.h
@@ -21,7 +21,7 @@
21#define _VIVID_RADIO_RX_H_ 21#define _VIVID_RADIO_RX_H_
22 22
23ssize_t vivid_radio_rx_read(struct file *, char __user *, size_t, loff_t *); 23ssize_t vivid_radio_rx_read(struct file *, char __user *, size_t, loff_t *);
24unsigned int vivid_radio_rx_poll(struct file *file, struct poll_table_struct *wait); 24__poll_t vivid_radio_rx_poll(struct file *file, struct poll_table_struct *wait);
25 25
26int vivid_radio_rx_enum_freq_bands(struct file *file, void *fh, struct v4l2_frequency_band *band); 26int vivid_radio_rx_enum_freq_bands(struct file *file, void *fh, struct v4l2_frequency_band *band);
27int vivid_radio_rx_s_hw_freq_seek(struct file *file, void *fh, const struct v4l2_hw_freq_seek *a); 27int vivid_radio_rx_s_hw_freq_seek(struct file *file, void *fh, const struct v4l2_hw_freq_seek *a);
diff --git a/drivers/media/platform/vivid/vivid-radio-tx.c b/drivers/media/platform/vivid/vivid-radio-tx.c
index 0e8025b7b4dd..f0917f4e7d8c 100644
--- a/drivers/media/platform/vivid/vivid-radio-tx.c
+++ b/drivers/media/platform/vivid/vivid-radio-tx.c
@@ -105,7 +105,7 @@ retry:
105 return i; 105 return i;
106} 106}
107 107
108unsigned int vivid_radio_tx_poll(struct file *file, struct poll_table_struct *wait) 108__poll_t vivid_radio_tx_poll(struct file *file, struct poll_table_struct *wait)
109{ 109{
110 return POLLOUT | POLLWRNORM | v4l2_ctrl_poll(file, wait); 110 return POLLOUT | POLLWRNORM | v4l2_ctrl_poll(file, wait);
111} 111}
diff --git a/drivers/media/platform/vivid/vivid-radio-tx.h b/drivers/media/platform/vivid/vivid-radio-tx.h
index 7f8ff7547119..3c3343d70cbc 100644
--- a/drivers/media/platform/vivid/vivid-radio-tx.h
+++ b/drivers/media/platform/vivid/vivid-radio-tx.h
@@ -21,7 +21,7 @@
21#define _VIVID_RADIO_TX_H_ 21#define _VIVID_RADIO_TX_H_
22 22
23ssize_t vivid_radio_tx_write(struct file *, const char __user *, size_t, loff_t *); 23ssize_t vivid_radio_tx_write(struct file *, const char __user *, size_t, loff_t *);
24unsigned int vivid_radio_tx_poll(struct file *file, struct poll_table_struct *wait); 24__poll_t vivid_radio_tx_poll(struct file *file, struct poll_table_struct *wait);
25 25
26int vidioc_g_modulator(struct file *file, void *fh, struct v4l2_modulator *a); 26int vidioc_g_modulator(struct file *file, void *fh, struct v4l2_modulator *a);
27int vidioc_s_modulator(struct file *file, void *fh, const struct v4l2_modulator *a); 27int vidioc_s_modulator(struct file *file, void *fh, const struct v4l2_modulator *a);
diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c
index 7575e5370a49..dba611003a00 100644
--- a/drivers/media/radio/radio-cadet.c
+++ b/drivers/media/radio/radio-cadet.c
@@ -481,11 +481,11 @@ static int cadet_release(struct file *file)
481 return 0; 481 return 0;
482} 482}
483 483
484static unsigned int cadet_poll(struct file *file, struct poll_table_struct *wait) 484static __poll_t cadet_poll(struct file *file, struct poll_table_struct *wait)
485{ 485{
486 struct cadet *dev = video_drvdata(file); 486 struct cadet *dev = video_drvdata(file);
487 unsigned long req_events = poll_requested_events(wait); 487 __poll_t req_events = poll_requested_events(wait);
488 unsigned int res = v4l2_ctrl_poll(file, wait); 488 __poll_t res = v4l2_ctrl_poll(file, wait);
489 489
490 poll_wait(file, &dev->read_queue, wait); 490 poll_wait(file, &dev->read_queue, wait);
491 if (dev->rdsstat == 0 && (req_events & (POLLIN | POLLRDNORM))) { 491 if (dev->rdsstat == 0 && (req_events & (POLLIN | POLLRDNORM))) {
diff --git a/drivers/media/radio/radio-si476x.c b/drivers/media/radio/radio-si476x.c
index 540ac887a63c..49293dd707b9 100644
--- a/drivers/media/radio/radio-si476x.c
+++ b/drivers/media/radio/radio-si476x.c
@@ -1153,12 +1153,12 @@ static ssize_t si476x_radio_fops_read(struct file *file, char __user *buf,
1153 return rval; 1153 return rval;
1154} 1154}
1155 1155
1156static unsigned int si476x_radio_fops_poll(struct file *file, 1156static __poll_t si476x_radio_fops_poll(struct file *file,
1157 struct poll_table_struct *pts) 1157 struct poll_table_struct *pts)
1158{ 1158{
1159 struct si476x_radio *radio = video_drvdata(file); 1159 struct si476x_radio *radio = video_drvdata(file);
1160 unsigned long req_events = poll_requested_events(pts); 1160 __poll_t req_events = poll_requested_events(pts);
1161 unsigned int err = v4l2_ctrl_poll(file, pts); 1161 __poll_t err = v4l2_ctrl_poll(file, pts);
1162 1162
1163 if (req_events & (POLLIN | POLLRDNORM)) { 1163 if (req_events & (POLLIN | POLLRDNORM)) {
1164 if (atomic_read(&radio->core->is_alive)) 1164 if (atomic_read(&radio->core->is_alive))
diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c
index 3cbdc085c65d..f92b0f9241a9 100644
--- a/drivers/media/radio/radio-wl1273.c
+++ b/drivers/media/radio/radio-wl1273.c
@@ -1089,7 +1089,7 @@ out:
1089 return r; 1089 return r;
1090} 1090}
1091 1091
1092static unsigned int wl1273_fm_fops_poll(struct file *file, 1092static __poll_t wl1273_fm_fops_poll(struct file *file,
1093 struct poll_table_struct *pts) 1093 struct poll_table_struct *pts)
1094{ 1094{
1095 struct wl1273_device *radio = video_get_drvdata(video_devdata(file)); 1095 struct wl1273_device *radio = video_get_drvdata(video_devdata(file));
diff --git a/drivers/media/radio/si470x/radio-si470x-common.c b/drivers/media/radio/si470x/radio-si470x-common.c
index c89a7d5b8c55..68fe9e5c7a70 100644
--- a/drivers/media/radio/si470x/radio-si470x-common.c
+++ b/drivers/media/radio/si470x/radio-si470x-common.c
@@ -507,12 +507,12 @@ done:
507/* 507/*
508 * si470x_fops_poll - poll RDS data 508 * si470x_fops_poll - poll RDS data
509 */ 509 */
510static unsigned int si470x_fops_poll(struct file *file, 510static __poll_t si470x_fops_poll(struct file *file,
511 struct poll_table_struct *pts) 511 struct poll_table_struct *pts)
512{ 512{
513 struct si470x_device *radio = video_drvdata(file); 513 struct si470x_device *radio = video_drvdata(file);
514 unsigned long req_events = poll_requested_events(pts); 514 __poll_t req_events = poll_requested_events(pts);
515 int retval = v4l2_ctrl_poll(file, pts); 515 __poll_t retval = v4l2_ctrl_poll(file, pts);
516 516
517 if (req_events & (POLLIN | POLLRDNORM)) { 517 if (req_events & (POLLIN | POLLRDNORM)) {
518 /* switch on rds reception */ 518 /* switch on rds reception */
diff --git a/drivers/media/radio/wl128x/fmdrv_v4l2.c b/drivers/media/radio/wl128x/fmdrv_v4l2.c
index fc5a7abc83d2..fd603c1b96bb 100644
--- a/drivers/media/radio/wl128x/fmdrv_v4l2.c
+++ b/drivers/media/radio/wl128x/fmdrv_v4l2.c
@@ -102,7 +102,7 @@ static ssize_t fm_v4l2_fops_write(struct file *file, const char __user * buf,
102 return sizeof(rds); 102 return sizeof(rds);
103} 103}
104 104
105static u32 fm_v4l2_fops_poll(struct file *file, struct poll_table_struct *pts) 105static __poll_t fm_v4l2_fops_poll(struct file *file, struct poll_table_struct *pts)
106{ 106{
107 int ret; 107 int ret;
108 struct fmdev *fmdev; 108 struct fmdev *fmdev;
diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
index e16d1138ca48..aab53641838b 100644
--- a/drivers/media/rc/lirc_dev.c
+++ b/drivers/media/rc/lirc_dev.c
@@ -272,10 +272,10 @@ int lirc_dev_fop_close(struct inode *inode, struct file *file)
272} 272}
273EXPORT_SYMBOL(lirc_dev_fop_close); 273EXPORT_SYMBOL(lirc_dev_fop_close);
274 274
275unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait) 275__poll_t lirc_dev_fop_poll(struct file *file, poll_table *wait)
276{ 276{
277 struct lirc_dev *d = file->private_data; 277 struct lirc_dev *d = file->private_data;
278 unsigned int ret; 278 __poll_t ret;
279 279
280 if (!d->attached) 280 if (!d->attached)
281 return POLLHUP | POLLERR; 281 return POLLHUP | POLLERR;
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);
444void cpia2_free_buffers(struct camera_data *cam); 444void cpia2_free_buffers(struct camera_data *cam);
445long cpia2_read(struct camera_data *cam, 445long cpia2_read(struct camera_data *cam,
446 char __user *buf, unsigned long count, int noblock); 446 char __user *buf, unsigned long count, int noblock);
447unsigned int cpia2_poll(struct camera_data *cam, 447__poll_t cpia2_poll(struct camera_data *cam,
448 struct file *filp, poll_table *wait); 448 struct file *filp, poll_table *wait);
449int cpia2_remap_buffer(struct camera_data *cam, struct vm_area_struct *vma); 449int cpia2_remap_buffer(struct camera_data *cam, struct vm_area_struct *vma);
450void cpia2_set_property_flip(struct camera_data *cam, int prop_val); 450void 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,
2370 * cpia2_poll 2370 * cpia2_poll
2371 * 2371 *
2372 *****************************************************************************/ 2372 *****************************************************************************/
2373unsigned int cpia2_poll(struct camera_data *cam, struct file *filp, 2373__poll_t cpia2_poll(struct camera_data *cam, struct file *filp,
2374 poll_table *wait) 2374 poll_table *wait)
2375{ 2375{
2376 unsigned int status = v4l2_ctrl_poll(filp, wait); 2376 __poll_t status = v4l2_ctrl_poll(filp, wait);
2377 2377
2378 if ((poll_requested_events(wait) & (POLLIN | POLLRDNORM)) && 2378 if ((poll_requested_events(wait) & (POLLIN | POLLRDNORM)) &&
2379 !cam->streaming) { 2379 !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,
169 * cpia2_v4l_poll 169 * cpia2_v4l_poll
170 * 170 *
171 *****************************************************************************/ 171 *****************************************************************************/
172static unsigned int cpia2_v4l_poll(struct file *filp, struct poll_table_struct *wait) 172static __poll_t cpia2_v4l_poll(struct file *filp, struct poll_table_struct *wait)
173{ 173{
174 struct camera_data *cam = video_drvdata(filp); 174 struct camera_data *cam = video_drvdata(filp);
175 unsigned int res; 175 __poll_t res;
176 176
177 mutex_lock(&cam->v4l2_lock); 177 mutex_lock(&cam->v4l2_lock);
178 res = cpia2_poll(cam, filp, wait); 178 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,
1812 file->f_flags & O_NONBLOCK); 1812 file->f_flags & O_NONBLOCK);
1813} 1813}
1814 1814
1815static unsigned int mpeg_poll(struct file *file, 1815static __poll_t mpeg_poll(struct file *file,
1816 struct poll_table_struct *wait) 1816 struct poll_table_struct *wait)
1817{ 1817{
1818 unsigned long req_events = poll_requested_events(wait); 1818 __poll_t req_events = poll_requested_events(wait);
1819 struct cx231xx_fh *fh = file->private_data; 1819 struct cx231xx_fh *fh = file->private_data;
1820 struct cx231xx *dev = fh->dev; 1820 struct cx231xx *dev = fh->dev;
1821 unsigned int res = 0; 1821 __poll_t res = 0;
1822 1822
1823 if (v4l2_event_pending(&fh->fh)) 1823 if (v4l2_event_pending(&fh->fh))
1824 res |= POLLPRI; 1824 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,
2006 * cx231xx_v4l2_poll() 2006 * cx231xx_v4l2_poll()
2007 * will allocate buffers when called for the first time 2007 * will allocate buffers when called for the first time
2008 */ 2008 */
2009static unsigned int cx231xx_v4l2_poll(struct file *filp, poll_table *wait) 2009static __poll_t cx231xx_v4l2_poll(struct file *filp, poll_table *wait)
2010{ 2010{
2011 unsigned long req_events = poll_requested_events(wait); 2011 __poll_t req_events = poll_requested_events(wait);
2012 struct cx231xx_fh *fh = filp->private_data; 2012 struct cx231xx_fh *fh = filp->private_data;
2013 struct cx231xx *dev = fh->dev; 2013 struct cx231xx *dev = fh->dev;
2014 unsigned res = 0; 2014 __poll_t res = 0;
2015 int rc; 2015 int rc;
2016 2016
2017 rc = check_dev(dev); 2017 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:
1862 return ret; 1862 return ret;
1863} 1863}
1864 1864
1865static unsigned int dev_poll(struct file *file, poll_table *wait) 1865static __poll_t dev_poll(struct file *file, poll_table *wait)
1866{ 1866{
1867 struct gspca_dev *gspca_dev = video_drvdata(file); 1867 struct gspca_dev *gspca_dev = video_drvdata(file);
1868 unsigned long req_events = poll_requested_events(wait); 1868 __poll_t req_events = poll_requested_events(wait);
1869 int ret = 0; 1869 __poll_t ret = 0;
1870 1870
1871 PDEBUG(D_FRAM, "poll"); 1871 PDEBUG(D_FRAM, "poll");
1872 1872
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:
521 return ret; 521 return ret;
522} 522}
523 523
524static unsigned int hdpvr_poll(struct file *filp, poll_table *wait) 524static __poll_t hdpvr_poll(struct file *filp, poll_table *wait)
525{ 525{
526 unsigned long req_events = poll_requested_events(wait); 526 __poll_t req_events = poll_requested_events(wait);
527 struct hdpvr_buffer *buf = NULL; 527 struct hdpvr_buffer *buf = NULL;
528 struct hdpvr_device *dev = video_drvdata(filp); 528 struct hdpvr_device *dev = video_drvdata(filp);
529 unsigned int mask = v4l2_ctrl_poll(filp, wait); 529 __poll_t mask = v4l2_ctrl_poll(filp, wait);
530 530
531 if (!(req_events & (POLLIN | POLLRDNORM))) 531 if (!(req_events & (POLLIN | POLLRDNORM)))
532 return mask; 532 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,
1190} 1190}
1191 1191
1192 1192
1193static unsigned int pvr2_v4l2_poll(struct file *file, poll_table *wait) 1193static __poll_t pvr2_v4l2_poll(struct file *file, poll_table *wait)
1194{ 1194{
1195 unsigned int mask = 0; 1195 __poll_t mask = 0;
1196 struct pvr2_v4l2_fh *fh = file->private_data; 1196 struct pvr2_v4l2_fh *fh = file->private_data;
1197 int ret; 1197 int ret;
1198 1198
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,
721 return ret; 721 return ret;
722} 722}
723 723
724static unsigned int v4l_stk_poll(struct file *fp, poll_table *wait) 724static __poll_t v4l_stk_poll(struct file *fp, poll_table *wait)
725{ 725{
726 struct stk_camera *dev = video_drvdata(fp); 726 struct stk_camera *dev = video_drvdata(fp);
727 unsigned res = v4l2_ctrl_poll(fp, wait); 727 __poll_t res = v4l2_ctrl_poll(fp, wait);
728 728
729 poll_wait(fp, &dev->wait_frame, wait); 729 poll_wait(fp, &dev->wait_frame, wait);
730 730
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)
1423 return 0; 1423 return 0;
1424} 1424}
1425 1425
1426static unsigned int 1426static __poll_t
1427__tm6000_poll(struct file *file, struct poll_table_struct *wait) 1427__tm6000_poll(struct file *file, struct poll_table_struct *wait)
1428{ 1428{
1429 unsigned long req_events = poll_requested_events(wait); 1429 __poll_t req_events = poll_requested_events(wait);
1430 struct tm6000_fh *fh = file->private_data; 1430 struct tm6000_fh *fh = file->private_data;
1431 struct tm6000_buffer *buf; 1431 struct tm6000_buffer *buf;
1432 int res = 0; 1432 __poll_t res = 0;
1433 1433
1434 if (v4l2_event_pending(&fh->fh)) 1434 if (v4l2_event_pending(&fh->fh))
1435 res = POLLPRI; 1435 res = POLLPRI;
@@ -1457,11 +1457,11 @@ __tm6000_poll(struct file *file, struct poll_table_struct *wait)
1457 return res; 1457 return res;
1458} 1458}
1459 1459
1460static unsigned int tm6000_poll(struct file *file, struct poll_table_struct *wait) 1460static __poll_t tm6000_poll(struct file *file, struct poll_table_struct *wait)
1461{ 1461{
1462 struct tm6000_fh *fh = file->private_data; 1462 struct tm6000_fh *fh = file->private_data;
1463 struct tm6000_core *dev = fh->dev; 1463 struct tm6000_core *dev = fh->dev;
1464 unsigned int res; 1464 __poll_t res;
1465 1465
1466 mutex_lock(&dev->lock); 1466 mutex_lock(&dev->lock);
1467 res = __tm6000_poll(file, wait); 1467 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,
340} 340}
341#endif 341#endif
342 342
343unsigned int uvc_queue_poll(struct uvc_video_queue *queue, struct file *file, 343__poll_t uvc_queue_poll(struct uvc_video_queue *queue, struct file *file,
344 poll_table *wait) 344 poll_table *wait)
345{ 345{
346 unsigned int ret; 346 __poll_t ret;
347 347
348 mutex_lock(&queue->mutex); 348 mutex_lock(&queue->mutex);
349 ret = vb2_poll(&queue->queue, file, wait); 349 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)
1423 return uvc_queue_mmap(&stream->queue, vma); 1423 return uvc_queue_mmap(&stream->queue, vma);
1424} 1424}
1425 1425
1426static unsigned int uvc_v4l2_poll(struct file *file, poll_table *wait) 1426static __poll_t uvc_v4l2_poll(struct file *file, poll_table *wait)
1427{ 1427{
1428 struct uvc_fh *handle = file->private_data; 1428 struct uvc_fh *handle = file->private_data;
1429 struct uvc_streaming *stream = handle->stream; 1429 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,
678 struct uvc_buffer *buf); 678 struct uvc_buffer *buf);
679extern int uvc_queue_mmap(struct uvc_video_queue *queue, 679extern int uvc_queue_mmap(struct uvc_video_queue *queue,
680 struct vm_area_struct *vma); 680 struct vm_area_struct *vma);
681extern unsigned int uvc_queue_poll(struct uvc_video_queue *queue, 681extern __poll_t uvc_queue_poll(struct uvc_video_queue *queue,
682 struct file *file, poll_table *wait); 682 struct file *file, poll_table *wait);
683#ifndef CONFIG_MMU 683#ifndef CONFIG_MMU
684extern unsigned long uvc_queue_get_unmapped_area(struct uvc_video_queue *queue, 684extern 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)
1287 return ret; 1287 return ret;
1288} 1288}
1289 1289
1290static unsigned int zr364xx_poll(struct file *file, 1290static __poll_t zr364xx_poll(struct file *file,
1291 struct poll_table_struct *wait) 1291 struct poll_table_struct *wait)
1292{ 1292{
1293 struct zr364xx_camera *cam = video_drvdata(file); 1293 struct zr364xx_camera *cam = video_drvdata(file);
1294 struct videobuf_queue *q = &cam->vb_vidq; 1294 struct videobuf_queue *q = &cam->vb_vidq;
1295 unsigned res = v4l2_ctrl_poll(file, wait); 1295 __poll_t res = v4l2_ctrl_poll(file, wait);
1296 1296
1297 _DBG("%s\n", __func__); 1297 _DBG("%s\n", __func__);
1298 1298
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index cbb2ef43945f..b07657149434 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -3457,7 +3457,7 @@ int v4l2_ctrl_subdev_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh,
3457} 3457}
3458EXPORT_SYMBOL(v4l2_ctrl_subdev_subscribe_event); 3458EXPORT_SYMBOL(v4l2_ctrl_subdev_subscribe_event);
3459 3459
3460unsigned int v4l2_ctrl_poll(struct file *file, struct poll_table_struct *wait) 3460__poll_t v4l2_ctrl_poll(struct file *file, struct poll_table_struct *wait)
3461{ 3461{
3462 struct v4l2_fh *fh = file->private_data; 3462 struct v4l2_fh *fh = file->private_data;
3463 3463
diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c
index c647ba648805..8ad8c1627768 100644
--- a/drivers/media/v4l2-core/v4l2-dev.c
+++ b/drivers/media/v4l2-core/v4l2-dev.c
@@ -331,10 +331,10 @@ static ssize_t v4l2_write(struct file *filp, const char __user *buf,
331 return ret; 331 return ret;
332} 332}
333 333
334static unsigned int v4l2_poll(struct file *filp, struct poll_table_struct *poll) 334static __poll_t v4l2_poll(struct file *filp, struct poll_table_struct *poll)
335{ 335{
336 struct video_device *vdev = video_devdata(filp); 336 struct video_device *vdev = video_devdata(filp);
337 unsigned int res = POLLERR | POLLHUP; 337 __poll_t res = POLLERR | POLLHUP;
338 338
339 if (!vdev->fops->poll) 339 if (!vdev->fops->poll)
340 return DEFAULT_POLLMASK; 340 return DEFAULT_POLLMASK;
diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c
index bc580fbe18fa..186156f8952a 100644
--- a/drivers/media/v4l2-core/v4l2-mem2mem.c
+++ b/drivers/media/v4l2-core/v4l2-mem2mem.c
@@ -500,14 +500,14 @@ int v4l2_m2m_streamoff(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
500} 500}
501EXPORT_SYMBOL_GPL(v4l2_m2m_streamoff); 501EXPORT_SYMBOL_GPL(v4l2_m2m_streamoff);
502 502
503unsigned int v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, 503__poll_t v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
504 struct poll_table_struct *wait) 504 struct poll_table_struct *wait)
505{ 505{
506 struct video_device *vfd = video_devdata(file); 506 struct video_device *vfd = video_devdata(file);
507 unsigned long req_events = poll_requested_events(wait); 507 __poll_t req_events = poll_requested_events(wait);
508 struct vb2_queue *src_q, *dst_q; 508 struct vb2_queue *src_q, *dst_q;
509 struct vb2_buffer *src_vb = NULL, *dst_vb = NULL; 509 struct vb2_buffer *src_vb = NULL, *dst_vb = NULL;
510 unsigned int rc = 0; 510 __poll_t rc = 0;
511 unsigned long flags; 511 unsigned long flags;
512 512
513 if (test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags)) { 513 if (test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags)) {
@@ -794,11 +794,11 @@ int v4l2_m2m_fop_mmap(struct file *file, struct vm_area_struct *vma)
794} 794}
795EXPORT_SYMBOL_GPL(v4l2_m2m_fop_mmap); 795EXPORT_SYMBOL_GPL(v4l2_m2m_fop_mmap);
796 796
797unsigned int v4l2_m2m_fop_poll(struct file *file, poll_table *wait) 797__poll_t v4l2_m2m_fop_poll(struct file *file, poll_table *wait)
798{ 798{
799 struct v4l2_fh *fh = file->private_data; 799 struct v4l2_fh *fh = file->private_data;
800 struct v4l2_m2m_ctx *m2m_ctx = fh->m2m_ctx; 800 struct v4l2_m2m_ctx *m2m_ctx = fh->m2m_ctx;
801 unsigned int ret; 801 __poll_t ret;
802 802
803 if (m2m_ctx->q_lock) 803 if (m2m_ctx->q_lock)
804 mutex_lock(m2m_ctx->q_lock); 804 mutex_lock(m2m_ctx->q_lock);
diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index 43fefa73e0a3..28966fa8c610 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -469,7 +469,7 @@ static long subdev_compat_ioctl32(struct file *file, unsigned int cmd,
469} 469}
470#endif 470#endif
471 471
472static unsigned int subdev_poll(struct file *file, poll_table *wait) 472static __poll_t subdev_poll(struct file *file, poll_table *wait)
473{ 473{
474 struct video_device *vdev = video_devdata(file); 474 struct video_device *vdev = video_devdata(file);
475 struct v4l2_subdev *sd = vdev_to_v4l2_subdev(vdev); 475 struct v4l2_subdev *sd = vdev_to_v4l2_subdev(vdev);
diff --git a/drivers/media/v4l2-core/videobuf-core.c b/drivers/media/v4l2-core/videobuf-core.c
index e87fb13b22dc..9a89d3ae170f 100644
--- a/drivers/media/v4l2-core/videobuf-core.c
+++ b/drivers/media/v4l2-core/videobuf-core.c
@@ -1118,13 +1118,13 @@ done:
1118} 1118}
1119EXPORT_SYMBOL_GPL(videobuf_read_stream); 1119EXPORT_SYMBOL_GPL(videobuf_read_stream);
1120 1120
1121unsigned int videobuf_poll_stream(struct file *file, 1121__poll_t videobuf_poll_stream(struct file *file,
1122 struct videobuf_queue *q, 1122 struct videobuf_queue *q,
1123 poll_table *wait) 1123 poll_table *wait)
1124{ 1124{
1125 unsigned long req_events = poll_requested_events(wait); 1125 __poll_t req_events = poll_requested_events(wait);
1126 struct videobuf_buffer *buf = NULL; 1126 struct videobuf_buffer *buf = NULL;
1127 unsigned int rc = 0; 1127 __poll_t rc = 0;
1128 1128
1129 videobuf_queue_lock(q); 1129 videobuf_queue_lock(q);
1130 if (q->streaming) { 1130 if (q->streaming) {
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
index a8589d96ef72..0d9f772d6d03 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -2018,10 +2018,10 @@ void vb2_core_queue_release(struct vb2_queue *q)
2018} 2018}
2019EXPORT_SYMBOL_GPL(vb2_core_queue_release); 2019EXPORT_SYMBOL_GPL(vb2_core_queue_release);
2020 2020
2021unsigned int vb2_core_poll(struct vb2_queue *q, struct file *file, 2021__poll_t vb2_core_poll(struct vb2_queue *q, struct file *file,
2022 poll_table *wait) 2022 poll_table *wait)
2023{ 2023{
2024 unsigned long req_events = poll_requested_events(wait); 2024 __poll_t req_events = poll_requested_events(wait);
2025 struct vb2_buffer *vb = NULL; 2025 struct vb2_buffer *vb = NULL;
2026 unsigned long flags; 2026 unsigned long flags;
2027 2027
diff --git a/drivers/media/v4l2-core/videobuf2-v4l2.c b/drivers/media/v4l2-core/videobuf2-v4l2.c
index 4075314a6989..a49f7eb98c2e 100644
--- a/drivers/media/v4l2-core/videobuf2-v4l2.c
+++ b/drivers/media/v4l2-core/videobuf2-v4l2.c
@@ -671,11 +671,11 @@ void vb2_queue_release(struct vb2_queue *q)
671} 671}
672EXPORT_SYMBOL_GPL(vb2_queue_release); 672EXPORT_SYMBOL_GPL(vb2_queue_release);
673 673
674unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait) 674__poll_t vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait)
675{ 675{
676 struct video_device *vfd = video_devdata(file); 676 struct video_device *vfd = video_devdata(file);
677 unsigned long req_events = poll_requested_events(wait); 677 __poll_t req_events = poll_requested_events(wait);
678 unsigned int res = 0; 678 __poll_t res = 0;
679 679
680 if (test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags)) { 680 if (test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags)) {
681 struct v4l2_fh *fh = file->private_data; 681 struct v4l2_fh *fh = file->private_data;
@@ -904,12 +904,12 @@ exit:
904} 904}
905EXPORT_SYMBOL_GPL(vb2_fop_read); 905EXPORT_SYMBOL_GPL(vb2_fop_read);
906 906
907unsigned int vb2_fop_poll(struct file *file, poll_table *wait) 907__poll_t vb2_fop_poll(struct file *file, poll_table *wait)
908{ 908{
909 struct video_device *vdev = video_devdata(file); 909 struct video_device *vdev = video_devdata(file);
910 struct vb2_queue *q = vdev->queue; 910 struct vb2_queue *q = vdev->queue;
911 struct mutex *lock = q->lock ? q->lock : vdev->lock; 911 struct mutex *lock = q->lock ? q->lock : vdev->lock;
912 unsigned res; 912 __poll_t res;
913 void *fileio; 913 void *fileio;
914 914
915 /* 915 /*
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)
427 return afu_mmap(file, vm); 427 return afu_mmap(file, vm);
428} 428}
429EXPORT_SYMBOL_GPL(cxl_fd_mmap); 429EXPORT_SYMBOL_GPL(cxl_fd_mmap);
430unsigned int cxl_fd_poll(struct file *file, struct poll_table_struct *poll) 430__poll_t cxl_fd_poll(struct file *file, struct poll_table_struct *poll)
431{ 431{
432 return afu_poll(file, poll); 432 return afu_poll(file, poll);
433} 433}
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);
1081int afu_release(struct inode *inode, struct file *file); 1081int afu_release(struct inode *inode, struct file *file);
1082long afu_ioctl(struct file *file, unsigned int cmd, unsigned long arg); 1082long afu_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
1083int afu_mmap(struct file *file, struct vm_area_struct *vm); 1083int afu_mmap(struct file *file, struct vm_area_struct *vm);
1084unsigned int afu_poll(struct file *file, struct poll_table_struct *poll); 1084__poll_t afu_poll(struct file *file, struct poll_table_struct *poll);
1085ssize_t afu_read(struct file *file, char __user *buf, size_t count, loff_t *off); 1085ssize_t afu_read(struct file *file, char __user *buf, size_t count, loff_t *off);
1086extern const struct file_operations afu_fops; 1086extern const struct file_operations afu_fops;
1087 1087
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)
354 return false; 354 return false;
355} 355}
356 356
357unsigned int afu_poll(struct file *file, struct poll_table_struct *poll) 357__poll_t afu_poll(struct file *file, struct poll_table_struct *poll)
358{ 358{
359 struct cxl_context *ctx = file->private_data; 359 struct cxl_context *ctx = file->private_data;
360 int mask = 0; 360 __poll_t mask = 0;
361 unsigned long flags; 361 unsigned long flags;
362 362
363 363
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,
514 return err ? -EFAULT : len; 514 return err ? -EFAULT : len;
515} 515}
516 516
517static unsigned int ilo_poll(struct file *fp, poll_table *wait) 517static __poll_t ilo_poll(struct file *fp, poll_table *wait)
518{ 518{
519 struct ccb_data *data = fp->private_data; 519 struct ccb_data *data = fp->private_data;
520 struct ccb *driver_ccb = &data->driver_ccb; 520 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:
651 return retval; 651 return retval;
652} 652}
653 653
654static unsigned int lis3lv02d_misc_poll(struct file *file, poll_table *wait) 654static __poll_t lis3lv02d_misc_poll(struct file *file, poll_table *wait)
655{ 655{
656 struct lis3lv02d *lis3 = container_of(file->private_data, 656 struct lis3lv02d *lis3 = container_of(file->private_data,
657 struct lis3lv02d, miscdev); 657 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,
542 * 542 *
543 * Return: poll mask 543 * Return: poll mask
544 */ 544 */
545static unsigned int mei_poll(struct file *file, poll_table *wait) 545static __poll_t mei_poll(struct file *file, poll_table *wait)
546{ 546{
547 unsigned long req_events = poll_requested_events(wait); 547 __poll_t req_events = poll_requested_events(wait);
548 struct mei_cl *cl = file->private_data; 548 struct mei_cl *cl = file->private_data;
549 struct mei_device *dev; 549 struct mei_device *dev;
550 unsigned int mask = 0; 550 __poll_t mask = 0;
551 bool notify_en; 551 bool notify_en;
552 552
553 if (WARN_ON(!cl || !cl->dev)) 553 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,
1311 spin_lock(&ep->lock); 1311 spin_lock(&ep->lock);
1312} 1312}
1313 1313
1314unsigned int 1314__poll_t
1315__scif_pollfd(struct file *f, poll_table *wait, struct scif_endpt *ep) 1315__scif_pollfd(struct file *f, poll_table *wait, struct scif_endpt *ep)
1316{ 1316{
1317 unsigned int mask = 0; 1317 __poll_t mask = 0;
1318 1318
1319 dev_dbg(scif_info.mdev.this_device, 1319 dev_dbg(scif_info.mdev.this_device,
1320 "SCIFAPI pollfd: ep %p %s\n", ep, scif_ep_states[ep->state]); 1320 "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)
1389{ 1389{
1390 struct poll_wqueues table; 1390 struct poll_wqueues table;
1391 poll_table *pt; 1391 poll_table *pt;
1392 int i, mask, count = 0, timed_out = timeout_msecs == 0; 1392 int i, count = 0, timed_out = timeout_msecs == 0;
1393 __poll_t mask;
1393 u64 timeout = timeout_msecs < 0 ? MAX_SCHEDULE_TIMEOUT 1394 u64 timeout = timeout_msecs < 0 ? MAX_SCHEDULE_TIMEOUT
1394 : msecs_to_jiffies(timeout_msecs); 1395 : msecs_to_jiffies(timeout_msecs);
1395 1396
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);
203int __scif_connect(scif_epd_t epd, struct scif_port_id *dst, bool non_block); 203int __scif_connect(scif_epd_t epd, struct scif_port_id *dst, bool non_block);
204int __scif_flush(scif_epd_t epd); 204int __scif_flush(scif_epd_t epd);
205int scif_mmap(struct vm_area_struct *vma, scif_epd_t epd); 205int scif_mmap(struct vm_area_struct *vma, scif_epd_t epd);
206unsigned int __scif_pollfd(struct file *f, poll_table *wait, 206__poll_t __scif_pollfd(struct file *f, poll_table *wait,
207 struct scif_endpt *ep); 207 struct scif_endpt *ep);
208int __scif_pin_pages(void *addr, size_t len, int *out_prot, 208int __scif_pin_pages(void *addr, size_t len, int *out_prot,
209 int map_flags, scif_pinned_pages_t *pages); 209 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)
41 return scif_mmap(vma, priv); 41 return scif_mmap(vma, priv);
42} 42}
43 43
44static unsigned int scif_fdpoll(struct file *f, poll_table *wait) 44static __poll_t scif_fdpoll(struct file *f, poll_table *wait)
45{ 45{
46 struct scif_endpt *priv = f->private_data; 46 struct scif_endpt *priv = f->private_data;
47 47
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:
1023 * in the card->host (TX) path, when userspace is unblocked by poll it 1023 * in the card->host (TX) path, when userspace is unblocked by poll it
1024 * must drain all available descriptors or it can stall. 1024 * must drain all available descriptors or it can stall.
1025 */ 1025 */
1026static unsigned int vop_poll(struct file *f, poll_table *wait) 1026static __poll_t vop_poll(struct file *f, poll_table *wait)
1027{ 1027{
1028 struct vop_vdev *vdev = f->private_data; 1028 struct vop_vdev *vdev = f->private_data;
1029 int mask = 0; 1029 __poll_t mask = 0;
1030 1030
1031 mutex_lock(&vdev->vdev_mutex); 1031 mutex_lock(&vdev->vdev_mutex);
1032 if (vop_vdev_inited(vdev)) { 1032 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)
256 return 0; 256 return 0;
257} 257}
258 258
259static unsigned int phantom_poll(struct file *file, poll_table *wait) 259static __poll_t phantom_poll(struct file *file, poll_table *wait)
260{ 260{
261 struct phantom_device *dev = file->private_data; 261 struct phantom_device *dev = file->private_data;
262 unsigned int mask = 0; 262 __poll_t mask = 0;
263 263
264 pr_debug("phantom_poll: %d\n", atomic_read(&dev->counter)); 264 pr_debug("phantom_poll: %d\n", atomic_read(&dev->counter));
265 poll_wait(file, &dev->wait, wait); 265 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)
166 * This is used to wake up the VMX when a VMCI call arrives, or 166 * This is used to wake up the VMX when a VMCI call arrives, or
167 * to wake up select() or poll() at the next clock tick. 167 * to wake up select() or poll() at the next clock tick.
168 */ 168 */
169static unsigned int vmci_host_poll(struct file *filp, poll_table *wait) 169static __poll_t vmci_host_poll(struct file *filp, poll_table *wait)
170{ 170{
171 struct vmci_host_dev *vmci_host_dev = filp->private_data; 171 struct vmci_host_dev *vmci_host_dev = filp->private_data;
172 struct vmci_ctx *context = vmci_host_dev->context; 172 struct vmci_ctx *context = vmci_host_dev->context;
173 unsigned int mask = 0; 173 __poll_t mask = 0;
174 174
175 if (vmci_host_dev->ct_type == VMCIOBJ_CONTEXT) { 175 if (vmci_host_dev->ct_type == VMCIOBJ_CONTEXT) {
176 /* Check for VMCI calls to this VM context. */ 176 /* Check for VMCI calls to this VM context. */
diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
index 7900ed066d8a..e412dfdda7dd 100644
--- a/drivers/net/ieee802154/ca8210.c
+++ b/drivers/net/ieee802154/ca8210.c
@@ -2638,12 +2638,12 @@ static long ca8210_test_int_ioctl(
2638 * 2638 *
2639 * Return: set of poll return flags 2639 * Return: set of poll return flags
2640 */ 2640 */
2641static unsigned int ca8210_test_int_poll( 2641static __poll_t ca8210_test_int_poll(
2642 struct file *filp, 2642 struct file *filp,
2643 struct poll_table_struct *ptable 2643 struct poll_table_struct *ptable
2644) 2644)
2645{ 2645{
2646 unsigned int return_flags = 0; 2646 __poll_t return_flags = 0;
2647 struct ca8210_priv *priv = filp->private_data; 2647 struct ca8210_priv *priv = filp->private_data;
2648 2648
2649 poll_wait(filp, &priv->test.readq, ptable); 2649 poll_wait(filp, &priv->test.readq, ptable);
diff --git a/drivers/net/ppp/ppp_async.c b/drivers/net/ppp/ppp_async.c
index 1b28e6e702f5..bdc4d23627c5 100644
--- a/drivers/net/ppp/ppp_async.c
+++ b/drivers/net/ppp/ppp_async.c
@@ -334,7 +334,7 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file,
334} 334}
335 335
336/* No kernel lock - fine */ 336/* No kernel lock - fine */
337static unsigned int 337static __poll_t
338ppp_asynctty_poll(struct tty_struct *tty, struct file *file, poll_table *wait) 338ppp_asynctty_poll(struct tty_struct *tty, struct file *file, poll_table *wait)
339{ 339{
340 return 0; 340 return 0;
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index 264d4af0bf69..ef6b2126b23a 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -531,10 +531,10 @@ static ssize_t ppp_write(struct file *file, const char __user *buf,
531} 531}
532 532
533/* No kernel lock - fine */ 533/* No kernel lock - fine */
534static unsigned int ppp_poll(struct file *file, poll_table *wait) 534static __poll_t ppp_poll(struct file *file, poll_table *wait)
535{ 535{
536 struct ppp_file *pf = file->private_data; 536 struct ppp_file *pf = file->private_data;
537 unsigned int mask; 537 __poll_t mask;
538 538
539 if (!pf) 539 if (!pf)
540 return 0; 540 return 0;
diff --git a/drivers/net/ppp/ppp_synctty.c b/drivers/net/ppp/ppp_synctty.c
index 7196f00f0991..047f6c68a441 100644
--- a/drivers/net/ppp/ppp_synctty.c
+++ b/drivers/net/ppp/ppp_synctty.c
@@ -327,7 +327,7 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file,
327} 327}
328 328
329/* No kernel lock - fine */ 329/* No kernel lock - fine */
330static unsigned int 330static __poll_t
331ppp_sync_poll(struct tty_struct *tty, struct file *file, poll_table *wait) 331ppp_sync_poll(struct tty_struct *tty, struct file *file, poll_table *wait)
332{ 332{
333 return 0; 333 return 0;
diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index 0a886fda0129..f39c6f876e67 100644
--- a/drivers/net/tap.c
+++ b/drivers/net/tap.c
@@ -572,10 +572,10 @@ static int tap_release(struct inode *inode, struct file *file)
572 return 0; 572 return 0;
573} 573}
574 574
575static unsigned int tap_poll(struct file *file, poll_table *wait) 575static __poll_t tap_poll(struct file *file, poll_table *wait)
576{ 576{
577 struct tap_queue *q = file->private_data; 577 struct tap_queue *q = file->private_data;
578 unsigned int mask = POLLERR; 578 __poll_t mask = POLLERR;
579 579
580 if (!q) 580 if (!q)
581 goto out; 581 goto out;
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index a8ec589d1359..7548d8a11bdf 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1257,12 +1257,12 @@ static void tun_net_init(struct net_device *dev)
1257/* Character device part */ 1257/* Character device part */
1258 1258
1259/* Poll */ 1259/* Poll */
1260static unsigned int tun_chr_poll(struct file *file, poll_table *wait) 1260static __poll_t tun_chr_poll(struct file *file, poll_table *wait)
1261{ 1261{
1262 struct tun_file *tfile = file->private_data; 1262 struct tun_file *tfile = file->private_data;
1263 struct tun_struct *tun = tun_get(tfile); 1263 struct tun_struct *tun = tun_get(tfile);
1264 struct sock *sk; 1264 struct sock *sk;
1265 unsigned int mask = 0; 1265 __poll_t mask = 0;
1266 1266
1267 if (!tun) 1267 if (!tun)
1268 return POLLERR; 1268 return POLLERR;
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index 6ea16260ec76..f6b000ddcd15 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -924,7 +924,7 @@ static int chrdev_tx_done(struct channel_data *chan, int size)
924 return 1; 924 return 1;
925} 925}
926 926
927static unsigned int cosa_poll(struct file *file, poll_table *poll) 927static __poll_t cosa_poll(struct file *file, poll_table *poll)
928{ 928{
929 pr_info("cosa_poll is here\n"); 929 pr_info("cosa_poll is here\n");
930 return 0; 930 return 0;
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c b/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c
index f4fdad2ed319..72c55d1f8903 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c
@@ -301,7 +301,7 @@ exit:
301 return status; 301 return status;
302} 302}
303 303
304static unsigned int rt2x00debug_poll_queue_dump(struct file *file, 304static __poll_t rt2x00debug_poll_queue_dump(struct file *file,
305 poll_table *wait) 305 poll_table *wait)
306{ 306{
307 struct rt2x00debug_intf *intf = file->private_data; 307 struct rt2x00debug_intf *intf = file->private_data;
diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
index 730cc897b94d..fab143a17f9c 100644
--- a/drivers/pci/switch/switchtec.c
+++ b/drivers/pci/switch/switchtec.c
@@ -510,11 +510,11 @@ out:
510 return -EBADMSG; 510 return -EBADMSG;
511} 511}
512 512
513static unsigned int switchtec_dev_poll(struct file *filp, poll_table *wait) 513static __poll_t switchtec_dev_poll(struct file *filp, poll_table *wait)
514{ 514{
515 struct switchtec_user *stuser = filp->private_data; 515 struct switchtec_user *stuser = filp->private_data;
516 struct switchtec_dev *stdev = stuser->stdev; 516 struct switchtec_dev *stdev = stuser->stdev;
517 int ret = 0; 517 __poll_t ret = 0;
518 518
519 poll_wait(filp, &stuser->comp.wait, wait); 519 poll_wait(filp, &stuser->comp.wait, wait);
520 poll_wait(filp, &stdev->event_wq, wait); 520 poll_wait(filp, &stdev->event_wq, wait);
diff --git a/drivers/platform/chrome/cros_ec_debugfs.c b/drivers/platform/chrome/cros_ec_debugfs.c
index 98a35d32f9dd..5473e602f7e0 100644
--- a/drivers/platform/chrome/cros_ec_debugfs.c
+++ b/drivers/platform/chrome/cros_ec_debugfs.c
@@ -188,11 +188,11 @@ error:
188 return ret; 188 return ret;
189} 189}
190 190
191static unsigned int cros_ec_console_log_poll(struct file *file, 191static __poll_t cros_ec_console_log_poll(struct file *file,
192 poll_table *wait) 192 poll_table *wait)
193{ 193{
194 struct cros_ec_debugfs *debug_info = file->private_data; 194 struct cros_ec_debugfs *debug_info = file->private_data;
195 unsigned int mask = 0; 195 __poll_t mask = 0;
196 196
197 poll_wait(file, &debug_info->log_wq, wait); 197 poll_wait(file, &debug_info->log_wq, wait);
198 198
diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c
index 0578d34eec3f..999f1152655a 100644
--- a/drivers/platform/goldfish/goldfish_pipe.c
+++ b/drivers/platform/goldfish/goldfish_pipe.c
@@ -536,10 +536,10 @@ static ssize_t goldfish_pipe_write(struct file *filp,
536 /* is_write */ 1); 536 /* is_write */ 1);
537} 537}
538 538
539static unsigned int goldfish_pipe_poll(struct file *filp, poll_table *wait) 539static __poll_t goldfish_pipe_poll(struct file *filp, poll_table *wait)
540{ 540{
541 struct goldfish_pipe *pipe = filp->private_data; 541 struct goldfish_pipe *pipe = filp->private_data;
542 unsigned int mask = 0; 542 __poll_t mask = 0;
543 int status; 543 int status;
544 544
545 poll_wait(filp, &pipe->wake_queue, wait); 545 poll_wait(filp, &pipe->wake_queue, wait);
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index 935121814c97..a4fabf9d75f3 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -4124,7 +4124,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf,
4124 return ret; 4124 return ret;
4125} 4125}
4126 4126
4127static unsigned int sonypi_misc_poll(struct file *file, poll_table *wait) 4127static __poll_t sonypi_misc_poll(struct file *file, poll_table *wait)
4128{ 4128{
4129 poll_wait(file, &sonypi_compat.fifo_proc_list, wait); 4129 poll_wait(file, &sonypi_compat.fifo_proc_list, wait);
4130 if (kfifo_len(&sonypi_compat.fifo)) 4130 if (kfifo_len(&sonypi_compat.fifo))
diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c
index 6eb0db37dd88..1d42385b1aa5 100644
--- a/drivers/pps/pps.c
+++ b/drivers/pps/pps.c
@@ -49,7 +49,7 @@ static DEFINE_IDR(pps_idr);
49 * Char device methods 49 * Char device methods
50 */ 50 */
51 51
52static unsigned int pps_cdev_poll(struct file *file, poll_table *wait) 52static __poll_t pps_cdev_poll(struct file *file, poll_table *wait)
53{ 53{
54 struct pps_device *pps = file->private_data; 54 struct pps_device *pps = file->private_data;
55 55
diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c
index 58a97d420572..a593b4cf47bf 100644
--- a/drivers/ptp/ptp_chardev.c
+++ b/drivers/ptp/ptp_chardev.c
@@ -280,7 +280,7 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
280 return err; 280 return err;
281} 281}
282 282
283unsigned int ptp_poll(struct posix_clock *pc, struct file *fp, poll_table *wait) 283__poll_t ptp_poll(struct posix_clock *pc, struct file *fp, poll_table *wait)
284{ 284{
285 struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock); 285 struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock);
286 286
diff --git a/drivers/ptp/ptp_private.h b/drivers/ptp/ptp_private.h
index b86f1bfecd6f..c7c62b782cb9 100644
--- a/drivers/ptp/ptp_private.h
+++ b/drivers/ptp/ptp_private.h
@@ -90,7 +90,7 @@ int ptp_open(struct posix_clock *pc, fmode_t fmode);
90ssize_t ptp_read(struct posix_clock *pc, 90ssize_t ptp_read(struct posix_clock *pc,
91 uint flags, char __user *buf, size_t cnt); 91 uint flags, char __user *buf, size_t cnt);
92 92
93uint ptp_poll(struct posix_clock *pc, 93__poll_t ptp_poll(struct posix_clock *pc,
94 struct file *fp, poll_table *wait); 94 struct file *fp, poll_table *wait);
95 95
96/* 96/*
diff --git a/drivers/rapidio/devices/rio_mport_cdev.c b/drivers/rapidio/devices/rio_mport_cdev.c
index ec4bc1515f0d..6092b3a5978e 100644
--- a/drivers/rapidio/devices/rio_mport_cdev.c
+++ b/drivers/rapidio/devices/rio_mport_cdev.c
@@ -2319,7 +2319,7 @@ static int mport_cdev_mmap(struct file *filp, struct vm_area_struct *vma)
2319 return ret; 2319 return ret;
2320} 2320}
2321 2321
2322static unsigned int mport_cdev_poll(struct file *filp, poll_table *wait) 2322static __poll_t mport_cdev_poll(struct file *filp, poll_table *wait)
2323{ 2323{
2324 struct mport_cdev_priv *priv = filp->private_data; 2324 struct mport_cdev_priv *priv = filp->private_data;
2325 2325
diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
index b01774e9fac0..e540ca362d08 100644
--- a/drivers/rpmsg/qcom_smd.c
+++ b/drivers/rpmsg/qcom_smd.c
@@ -919,12 +919,12 @@ static int qcom_smd_trysend(struct rpmsg_endpoint *ept, void *data, int len)
919 return __qcom_smd_send(qsept->qsch, data, len, false); 919 return __qcom_smd_send(qsept->qsch, data, len, false);
920} 920}
921 921
922static unsigned int qcom_smd_poll(struct rpmsg_endpoint *ept, 922static __poll_t qcom_smd_poll(struct rpmsg_endpoint *ept,
923 struct file *filp, poll_table *wait) 923 struct file *filp, poll_table *wait)
924{ 924{
925 struct qcom_smd_endpoint *qsept = to_smd_endpoint(ept); 925 struct qcom_smd_endpoint *qsept = to_smd_endpoint(ept);
926 struct qcom_smd_channel *channel = qsept->qsch; 926 struct qcom_smd_channel *channel = qsept->qsch;
927 unsigned int mask = 0; 927 __poll_t mask = 0;
928 928
929 poll_wait(filp, &channel->fblockread_event, wait); 929 poll_wait(filp, &channel->fblockread_event, wait);
930 930
diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c
index e0996fce3963..e622fcda30fa 100644
--- a/drivers/rpmsg/rpmsg_char.c
+++ b/drivers/rpmsg/rpmsg_char.c
@@ -256,10 +256,10 @@ free_kbuf:
256 return ret < 0 ? ret : len; 256 return ret < 0 ? ret : len;
257} 257}
258 258
259static unsigned int rpmsg_eptdev_poll(struct file *filp, poll_table *wait) 259static __poll_t rpmsg_eptdev_poll(struct file *filp, poll_table *wait)
260{ 260{
261 struct rpmsg_eptdev *eptdev = filp->private_data; 261 struct rpmsg_eptdev *eptdev = filp->private_data;
262 unsigned int mask = 0; 262 __poll_t mask = 0;
263 263
264 if (!eptdev->ept) 264 if (!eptdev->ept)
265 return POLLERR; 265 return POLLERR;
diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
index dffa3aab7178..5a081762afcc 100644
--- a/drivers/rpmsg/rpmsg_core.c
+++ b/drivers/rpmsg/rpmsg_core.c
@@ -247,7 +247,7 @@ EXPORT_SYMBOL(rpmsg_trysendto);
247 * 247 *
248 * Returns mask representing the current state of the endpoint's send buffers 248 * Returns mask representing the current state of the endpoint's send buffers
249 */ 249 */
250unsigned int rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp, 250__poll_t rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp,
251 poll_table *wait) 251 poll_table *wait)
252{ 252{
253 if (WARN_ON(!ept)) 253 if (WARN_ON(!ept))
diff --git a/drivers/rpmsg/rpmsg_internal.h b/drivers/rpmsg/rpmsg_internal.h
index 0cf9c7e2ee83..685aa70e9cbe 100644
--- a/drivers/rpmsg/rpmsg_internal.h
+++ b/drivers/rpmsg/rpmsg_internal.h
@@ -71,7 +71,7 @@ struct rpmsg_endpoint_ops {
71 int (*trysendto)(struct rpmsg_endpoint *ept, void *data, int len, u32 dst); 71 int (*trysendto)(struct rpmsg_endpoint *ept, void *data, int len, u32 dst);
72 int (*trysend_offchannel)(struct rpmsg_endpoint *ept, u32 src, u32 dst, 72 int (*trysend_offchannel)(struct rpmsg_endpoint *ept, u32 src, u32 dst,
73 void *data, int len); 73 void *data, int len);
74 unsigned int (*poll)(struct rpmsg_endpoint *ept, struct file *filp, 74 __poll_t (*poll)(struct rpmsg_endpoint *ept, struct file *filp,
75 poll_table *wait); 75 poll_table *wait);
76}; 76};
77 77
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c
index 215eac68ae2d..5a7b30d0773b 100644
--- a/drivers/rtc/rtc-dev.c
+++ b/drivers/rtc/rtc-dev.c
@@ -194,7 +194,7 @@ rtc_dev_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
194 return ret; 194 return ret;
195} 195}
196 196
197static unsigned int rtc_dev_poll(struct file *file, poll_table *wait) 197static __poll_t rtc_dev_poll(struct file *file, poll_table *wait)
198{ 198{
199 struct rtc_device *rtc = file->private_data; 199 struct rtc_device *rtc = file->private_data;
200 unsigned long data; 200 unsigned long data;
diff --git a/drivers/s390/block/dasd_eer.c b/drivers/s390/block/dasd_eer.c
index a7917d473774..0c075d100252 100644
--- a/drivers/s390/block/dasd_eer.c
+++ b/drivers/s390/block/dasd_eer.c
@@ -661,9 +661,9 @@ static ssize_t dasd_eer_read(struct file *filp, char __user *buf,
661 return effective_count; 661 return effective_count;
662} 662}
663 663
664static unsigned int dasd_eer_poll(struct file *filp, poll_table *ptable) 664static __poll_t dasd_eer_poll(struct file *filp, poll_table *ptable)
665{ 665{
666 unsigned int mask; 666 __poll_t mask;
667 unsigned long flags; 667 unsigned long flags;
668 struct eerbuffer *eerb; 668 struct eerbuffer *eerb;
669 669
diff --git a/drivers/s390/char/monreader.c b/drivers/s390/char/monreader.c
index bf4ab4efed73..956f662908a6 100644
--- a/drivers/s390/char/monreader.c
+++ b/drivers/s390/char/monreader.c
@@ -429,7 +429,7 @@ out_copy:
429 return count; 429 return count;
430} 430}
431 431
432static unsigned int mon_poll(struct file *filp, struct poll_table_struct *p) 432static __poll_t mon_poll(struct file *filp, struct poll_table_struct *p)
433{ 433{
434 struct mon_private *monpriv = filp->private_data; 434 struct mon_private *monpriv = filp->private_data;
435 435
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index cc54bdb5c712..2c8cfa27909d 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -7004,9 +7004,9 @@ static int megasas_mgmt_fasync(int fd, struct file *filep, int mode)
7004/** 7004/**
7005 * megasas_mgmt_poll - char node "poll" entry point 7005 * megasas_mgmt_poll - char node "poll" entry point
7006 * */ 7006 * */
7007static unsigned int megasas_mgmt_poll(struct file *file, poll_table *wait) 7007static __poll_t megasas_mgmt_poll(struct file *file, poll_table *wait)
7008{ 7008{
7009 unsigned int mask; 7009 __poll_t mask;
7010 unsigned long flags; 7010 unsigned long flags;
7011 7011
7012 poll_wait(file, &megasas_poll_wait, wait); 7012 poll_wait(file, &megasas_poll_wait, wait);
diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
index b4c374b08e5e..537de1b7e8e5 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
@@ -534,7 +534,7 @@ _ctl_fasync(int fd, struct file *filep, int mode)
534 * @wait - 534 * @wait -
535 * 535 *
536 */ 536 */
537static unsigned int 537static __poll_t
538_ctl_poll(struct file *filep, poll_table *wait) 538_ctl_poll(struct file *filep, poll_table *wait)
539{ 539{
540 struct MPT3SAS_ADAPTER *ioc; 540 struct MPT3SAS_ADAPTER *ioc;
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index f098877eed4a..0c434453aab3 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1140,10 +1140,10 @@ static long sg_compat_ioctl(struct file *filp, unsigned int cmd_in, unsigned lon
1140} 1140}
1141#endif 1141#endif
1142 1142
1143static unsigned int 1143static __poll_t
1144sg_poll(struct file *filp, poll_table * wait) 1144sg_poll(struct file *filp, poll_table * wait)
1145{ 1145{
1146 unsigned int res = 0; 1146 __poll_t res = 0;
1147 Sg_device *sdp; 1147 Sg_device *sdp;
1148 Sg_fd *sfp; 1148 Sg_fd *sfp;
1149 Sg_request *srp; 1149 Sg_request *srp;
@@ -1174,7 +1174,7 @@ sg_poll(struct file *filp, poll_table * wait)
1174 } else if (count < SG_MAX_QUEUE) 1174 } else if (count < SG_MAX_QUEUE)
1175 res |= POLLOUT | POLLWRNORM; 1175 res |= POLLOUT | POLLWRNORM;
1176 SCSI_LOG_TIMEOUT(3, sg_printk(KERN_INFO, sdp, 1176 SCSI_LOG_TIMEOUT(3, sg_printk(KERN_INFO, sdp,
1177 "sg_poll: res=0x%x\n", (int) res)); 1177 "sg_poll: res=0x%x\n", (__force u32) res));
1178 return res; 1178 return res;
1179} 1179}
1180 1180
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index e19e395b0e44..491b54d986eb 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2276,9 +2276,9 @@ done:
2276 return retval; 2276 return retval;
2277} 2277}
2278 2278
2279static unsigned int comedi_poll(struct file *file, poll_table *wait) 2279static __poll_t comedi_poll(struct file *file, poll_table *wait)
2280{ 2280{
2281 unsigned int mask = 0; 2281 __poll_t mask = 0;
2282 struct comedi_file *cfp = file->private_data; 2282 struct comedi_file *cfp = file->private_data;
2283 struct comedi_device *dev = cfp->dev; 2283 struct comedi_device *dev = cfp->dev;
2284 struct comedi_subdevice *s, *s_read; 2284 struct comedi_subdevice *s, *s_read;
diff --git a/drivers/staging/comedi/drivers/serial2002.c b/drivers/staging/comedi/drivers/serial2002.c
index cc18e25103ca..a557be8a5076 100644
--- a/drivers/staging/comedi/drivers/serial2002.c
+++ b/drivers/staging/comedi/drivers/serial2002.c
@@ -119,7 +119,7 @@ static void serial2002_tty_read_poll_wait(struct file *f, int timeout)
119 poll_initwait(&table); 119 poll_initwait(&table);
120 while (1) { 120 while (1) {
121 long elapsed; 121 long elapsed;
122 int mask; 122 __poll_t mask;
123 123
124 mask = f->f_op->poll(f, &table.pt); 124 mask = f->f_op->poll(f, &table.pt);
125 if (mask & (POLLRDNORM | POLLRDBAND | POLLIN | 125 if (mask & (POLLRDNORM | POLLRDBAND | POLLIN |
diff --git a/drivers/staging/irda/net/af_irda.c b/drivers/staging/irda/net/af_irda.c
index b82a47b9ef0b..f1d128b2dae9 100644
--- a/drivers/staging/irda/net/af_irda.c
+++ b/drivers/staging/irda/net/af_irda.c
@@ -1737,12 +1737,12 @@ static int irda_shutdown(struct socket *sock, int how)
1737/* 1737/*
1738 * Function irda_poll (file, sock, wait) 1738 * Function irda_poll (file, sock, wait)
1739 */ 1739 */
1740static unsigned int irda_poll(struct file * file, struct socket *sock, 1740static __poll_t irda_poll(struct file * file, struct socket *sock,
1741 poll_table *wait) 1741 poll_table *wait)
1742{ 1742{
1743 struct sock *sk = sock->sk; 1743 struct sock *sk = sock->sk;
1744 struct irda_sock *self = irda_sk(sk); 1744 struct irda_sock *self = irda_sk(sk);
1745 unsigned int mask; 1745 __poll_t mask;
1746 1746
1747 poll_wait(file, sk_sleep(sk), wait); 1747 poll_wait(file, sk_sleep(sk), wait);
1748 mask = 0; 1748 mask = 0;
diff --git a/drivers/staging/irda/net/irnet/irnet_ppp.c b/drivers/staging/irda/net/irnet/irnet_ppp.c
index 7025dcb853d0..75bf9e34311d 100644
--- a/drivers/staging/irda/net/irnet/irnet_ppp.c
+++ b/drivers/staging/irda/net/irnet/irnet_ppp.c
@@ -419,12 +419,12 @@ irnet_ctrl_read(irnet_socket * ap,
419 * Poll : called when someone do a select on /dev/irnet. 419 * Poll : called when someone do a select on /dev/irnet.
420 * Just check if there are new events... 420 * Just check if there are new events...
421 */ 421 */
422static inline unsigned int 422static inline __poll_t
423irnet_ctrl_poll(irnet_socket * ap, 423irnet_ctrl_poll(irnet_socket * ap,
424 struct file * file, 424 struct file * file,
425 poll_table * wait) 425 poll_table * wait)
426{ 426{
427 unsigned int mask; 427 __poll_t mask;
428 428
429 DENTER(CTRL_TRACE, "(ap=0x%p)\n", ap); 429 DENTER(CTRL_TRACE, "(ap=0x%p)\n", ap);
430 430
@@ -608,12 +608,12 @@ dev_irnet_read(struct file * file,
608/* 608/*
609 * Poll : called when someone do a select on /dev/irnet 609 * Poll : called when someone do a select on /dev/irnet
610 */ 610 */
611static unsigned int 611static __poll_t
612dev_irnet_poll(struct file * file, 612dev_irnet_poll(struct file * file,
613 poll_table * wait) 613 poll_table * wait)
614{ 614{
615 irnet_socket * ap = file->private_data; 615 irnet_socket * ap = file->private_data;
616 unsigned int mask; 616 __poll_t mask;
617 617
618 DENTER(FS_TRACE, "(file=0x%p, ap=0x%p)\n", 618 DENTER(FS_TRACE, "(file=0x%p, ap=0x%p)\n",
619 file, ap); 619 file, ap);
diff --git a/drivers/staging/irda/net/irnet/irnet_ppp.h b/drivers/staging/irda/net/irnet/irnet_ppp.h
index 32061442cc8e..e6d5aa2a8aac 100644
--- a/drivers/staging/irda/net/irnet/irnet_ppp.h
+++ b/drivers/staging/irda/net/irnet/irnet_ppp.h
@@ -70,7 +70,7 @@ static ssize_t
70 char __user *, 70 char __user *,
71 size_t, 71 size_t,
72 loff_t *); 72 loff_t *);
73static unsigned int 73static __poll_t
74 dev_irnet_poll(struct file *, 74 dev_irnet_poll(struct file *,
75 poll_table *); 75 poll_table *);
76static long 76static long
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c
index dd7596d8763d..6657ebbe068a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c
@@ -1255,7 +1255,7 @@ static int atomisp_file_mmap(struct file *file, struct vm_area_struct *vma)
1255 return videobuf_mmap_mapper(&pipe->outq, vma); 1255 return videobuf_mmap_mapper(&pipe->outq, vma);
1256} 1256}
1257 1257
1258static unsigned int atomisp_poll(struct file *file, 1258static __poll_t atomisp_poll(struct file *file,
1259 struct poll_table_struct *pt) 1259 struct poll_table_struct *pt)
1260{ 1260{
1261 struct video_device *vdev = video_devdata(file); 1261 struct video_device *vdev = video_devdata(file);
diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c
index 5d3b0e5a1283..4ffff6f8b809 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -2174,11 +2174,11 @@ static int bcm2048_fops_release(struct file *file)
2174 return 0; 2174 return 0;
2175} 2175}
2176 2176
2177static unsigned int bcm2048_fops_poll(struct file *file, 2177static __poll_t bcm2048_fops_poll(struct file *file,
2178 struct poll_table_struct *pts) 2178 struct poll_table_struct *pts)
2179{ 2179{
2180 struct bcm2048_device *bdev = video_drvdata(file); 2180 struct bcm2048_device *bdev = video_drvdata(file);
2181 int retval = 0; 2181 __poll_t retval = 0;
2182 2182
2183 poll_wait(file, &bdev->read_queue, pts); 2183 poll_wait(file, &bdev->read_queue, pts);
2184 2184
diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c b/drivers/staging/media/davinci_vpfe/vpfe_video.c
index 155e8c758e4b..588743a6fd8a 100644
--- a/drivers/staging/media/davinci_vpfe/vpfe_video.c
+++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c
@@ -573,7 +573,7 @@ static int vpfe_mmap(struct file *file, struct vm_area_struct *vma)
573/* 573/*
574 * vpfe_poll() - It is used for select/poll system call 574 * vpfe_poll() - It is used for select/poll system call
575 */ 575 */
576static unsigned int vpfe_poll(struct file *file, poll_table *wait) 576static __poll_t vpfe_poll(struct file *file, poll_table *wait)
577{ 577{
578 struct vpfe_video_device *video = video_drvdata(file); 578 struct vpfe_video_device *video = video_drvdata(file);
579 struct vpfe_device *vpfe_dev = video->vpfe_dev; 579 struct vpfe_device *vpfe_dev = video->vpfe_dev;
diff --git a/drivers/staging/media/lirc/lirc_zilog.c b/drivers/staging/media/lirc/lirc_zilog.c
index 6bd0717bf76e..a003603af725 100644
--- a/drivers/staging/media/lirc/lirc_zilog.c
+++ b/drivers/staging/media/lirc/lirc_zilog.c
@@ -1197,12 +1197,12 @@ static ssize_t write(struct file *filep, const char __user *buf, size_t n,
1197} 1197}
1198 1198
1199/* copied from lirc_dev */ 1199/* copied from lirc_dev */
1200static unsigned int poll(struct file *filep, poll_table *wait) 1200static __poll_t poll(struct file *filep, poll_table *wait)
1201{ 1201{
1202 struct IR *ir = lirc_get_pdata(filep); 1202 struct IR *ir = lirc_get_pdata(filep);
1203 struct IR_rx *rx; 1203 struct IR_rx *rx;
1204 struct lirc_buffer *rbuf = ir->l->buf; 1204 struct lirc_buffer *rbuf = ir->l->buf;
1205 unsigned int ret; 1205 __poll_t ret;
1206 1206
1207 dev_dbg(ir->dev, "%s called\n", __func__); 1207 dev_dbg(ir->dev, "%s called\n", __func__);
1208 1208
diff --git a/drivers/staging/media/omap4iss/iss_video.c b/drivers/staging/media/omap4iss/iss_video.c
index 9e2f0421a01e..a3a83424a926 100644
--- a/drivers/staging/media/omap4iss/iss_video.c
+++ b/drivers/staging/media/omap4iss/iss_video.c
@@ -1185,7 +1185,7 @@ static int iss_video_release(struct file *file)
1185 return 0; 1185 return 0;
1186} 1186}
1187 1187
1188static unsigned int iss_video_poll(struct file *file, poll_table *wait) 1188static __poll_t iss_video_poll(struct file *file, poll_table *wait)
1189{ 1189{
1190 struct iss_video_fh *vfh = to_iss_video_fh(file->private_data); 1190 struct iss_video_fh *vfh = to_iss_video_fh(file->private_data);
1191 1191
diff --git a/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/most/aim-cdev/cdev.c
index 1e5cbc893496..69f530972273 100644
--- a/drivers/staging/most/aim-cdev/cdev.c
+++ b/drivers/staging/most/aim-cdev/cdev.c
@@ -287,10 +287,10 @@ aim_read(struct file *filp, char __user *buf, size_t count, loff_t *offset)
287 return copied; 287 return copied;
288} 288}
289 289
290static unsigned int aim_poll(struct file *filp, poll_table *wait) 290static __poll_t aim_poll(struct file *filp, poll_table *wait)
291{ 291{
292 struct aim_channel *c = filp->private_data; 292 struct aim_channel *c = filp->private_data;
293 unsigned int mask = 0; 293 __poll_t mask = 0;
294 294
295 poll_wait(filp, &c->wq, wait); 295 poll_wait(filp, &c->wq, wait);
296 296
diff --git a/drivers/staging/most/aim-v4l2/video.c b/drivers/staging/most/aim-v4l2/video.c
index e0748416aee5..7783bc2dd9f5 100644
--- a/drivers/staging/most/aim-v4l2/video.c
+++ b/drivers/staging/most/aim-v4l2/video.c
@@ -209,11 +209,11 @@ static ssize_t aim_vdev_read(struct file *filp, char __user *buf,
209 return ret; 209 return ret;
210} 210}
211 211
212static unsigned int aim_vdev_poll(struct file *filp, poll_table *wait) 212static __poll_t aim_vdev_poll(struct file *filp, poll_table *wait)
213{ 213{
214 struct aim_fh *fh = filp->private_data; 214 struct aim_fh *fh = filp->private_data;
215 struct most_video_dev *mdev = fh->mdev; 215 struct most_video_dev *mdev = fh->mdev;
216 unsigned int mask = 0; 216 __poll_t mask = 0;
217 217
218 /* only wait if no data is available */ 218 /* only wait if no data is available */
219 if (!data_ready(mdev)) 219 if (!data_ready(mdev))
diff --git a/drivers/staging/speakup/speakup_soft.c b/drivers/staging/speakup/speakup_soft.c
index d99daf69e501..585c6aa124cd 100644
--- a/drivers/staging/speakup/speakup_soft.c
+++ b/drivers/staging/speakup/speakup_soft.c
@@ -326,10 +326,10 @@ static ssize_t softsynth_write(struct file *fp, const char __user *buf,
326 return count; 326 return count;
327} 327}
328 328
329static unsigned int softsynth_poll(struct file *fp, struct poll_table_struct *wait) 329static __poll_t softsynth_poll(struct file *fp, struct poll_table_struct *wait)
330{ 330{
331 unsigned long flags; 331 unsigned long flags;
332 int ret = 0; 332 __poll_t ret = 0;
333 333
334 poll_wait(fp, &speakup_event, wait); 334 poll_wait(fp, &speakup_event, wait);
335 335
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 5131bdc9e765..0edf4fcfea23 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -2457,10 +2457,10 @@ static ssize_t gsmld_write(struct tty_struct *tty, struct file *file,
2457 * Called without the kernel lock held - fine 2457 * Called without the kernel lock held - fine
2458 */ 2458 */
2459 2459
2460static unsigned int gsmld_poll(struct tty_struct *tty, struct file *file, 2460static __poll_t gsmld_poll(struct tty_struct *tty, struct file *file,
2461 poll_table *wait) 2461 poll_table *wait)
2462{ 2462{
2463 unsigned int mask = 0; 2463 __poll_t mask = 0;
2464 struct gsm_mux *gsm = tty->disc_data; 2464 struct gsm_mux *gsm = tty->disc_data;
2465 2465
2466 poll_wait(file, &tty->read_wait, wait); 2466 poll_wait(file, &tty->read_wait, wait);
diff --git a/drivers/tty/n_hdlc.c b/drivers/tty/n_hdlc.c
index eea7b6cb3cc4..929434ebee50 100644
--- a/drivers/tty/n_hdlc.c
+++ b/drivers/tty/n_hdlc.c
@@ -180,7 +180,7 @@ static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
180 const unsigned char *buf, size_t nr); 180 const unsigned char *buf, size_t nr);
181static int n_hdlc_tty_ioctl(struct tty_struct *tty, struct file *file, 181static int n_hdlc_tty_ioctl(struct tty_struct *tty, struct file *file,
182 unsigned int cmd, unsigned long arg); 182 unsigned int cmd, unsigned long arg);
183static unsigned int n_hdlc_tty_poll(struct tty_struct *tty, struct file *filp, 183static __poll_t n_hdlc_tty_poll(struct tty_struct *tty, struct file *filp,
184 poll_table *wait); 184 poll_table *wait);
185static int n_hdlc_tty_open(struct tty_struct *tty); 185static int n_hdlc_tty_open(struct tty_struct *tty);
186static void n_hdlc_tty_close(struct tty_struct *tty); 186static void n_hdlc_tty_close(struct tty_struct *tty);
@@ -796,11 +796,11 @@ static int n_hdlc_tty_ioctl(struct tty_struct *tty, struct file *file,
796 * to caller. 796 * to caller.
797 * Returns a bit mask containing info on which ops will not block. 797 * Returns a bit mask containing info on which ops will not block.
798 */ 798 */
799static unsigned int n_hdlc_tty_poll(struct tty_struct *tty, struct file *filp, 799static __poll_t n_hdlc_tty_poll(struct tty_struct *tty, struct file *filp,
800 poll_table *wait) 800 poll_table *wait)
801{ 801{
802 struct n_hdlc *n_hdlc = tty2n_hdlc (tty); 802 struct n_hdlc *n_hdlc = tty2n_hdlc (tty);
803 unsigned int mask = 0; 803 __poll_t mask = 0;
804 804
805 if (debuglevel >= DEBUG_LEVEL_INFO) 805 if (debuglevel >= DEBUG_LEVEL_INFO)
806 printk("%s(%d)n_hdlc_tty_poll() called\n",__FILE__,__LINE__); 806 printk("%s(%d)n_hdlc_tty_poll() called\n",__FILE__,__LINE__);
diff --git a/drivers/tty/n_r3964.c b/drivers/tty/n_r3964.c
index 30bb0900cd2f..e81d3db8ad63 100644
--- a/drivers/tty/n_r3964.c
+++ b/drivers/tty/n_r3964.c
@@ -135,7 +135,7 @@ static ssize_t r3964_write(struct tty_struct *tty, struct file *file,
135static int r3964_ioctl(struct tty_struct *tty, struct file *file, 135static int r3964_ioctl(struct tty_struct *tty, struct file *file,
136 unsigned int cmd, unsigned long arg); 136 unsigned int cmd, unsigned long arg);
137static void r3964_set_termios(struct tty_struct *tty, struct ktermios *old); 137static void r3964_set_termios(struct tty_struct *tty, struct ktermios *old);
138static unsigned int r3964_poll(struct tty_struct *tty, struct file *file, 138static __poll_t r3964_poll(struct tty_struct *tty, struct file *file,
139 struct poll_table_struct *wait); 139 struct poll_table_struct *wait);
140static void r3964_receive_buf(struct tty_struct *tty, const unsigned char *cp, 140static void r3964_receive_buf(struct tty_struct *tty, const unsigned char *cp,
141 char *fp, int count); 141 char *fp, int count);
@@ -1216,14 +1216,14 @@ static void r3964_set_termios(struct tty_struct *tty, struct ktermios *old)
1216} 1216}
1217 1217
1218/* Called without the kernel lock held - fine */ 1218/* Called without the kernel lock held - fine */
1219static unsigned int r3964_poll(struct tty_struct *tty, struct file *file, 1219static __poll_t r3964_poll(struct tty_struct *tty, struct file *file,
1220 struct poll_table_struct *wait) 1220 struct poll_table_struct *wait)
1221{ 1221{
1222 struct r3964_info *pInfo = tty->disc_data; 1222 struct r3964_info *pInfo = tty->disc_data;
1223 struct r3964_client_info *pClient; 1223 struct r3964_client_info *pClient;
1224 struct r3964_message *pMsg = NULL; 1224 struct r3964_message *pMsg = NULL;
1225 unsigned long flags; 1225 unsigned long flags;
1226 int result = POLLOUT; 1226 __poll_t result = POLLOUT;
1227 1227
1228 TRACE_L("POLL"); 1228 TRACE_L("POLL");
1229 1229
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 539b49adb6af..478a9b40fd03 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -2368,10 +2368,10 @@ break_out:
2368 * Called without the kernel lock held - fine 2368 * Called without the kernel lock held - fine
2369 */ 2369 */
2370 2370
2371static unsigned int n_tty_poll(struct tty_struct *tty, struct file *file, 2371static __poll_t n_tty_poll(struct tty_struct *tty, struct file *file,
2372 poll_table *wait) 2372 poll_table *wait)
2373{ 2373{
2374 unsigned int mask = 0; 2374 __poll_t mask = 0;
2375 2375
2376 poll_wait(file, &tty->read_wait, wait); 2376 poll_wait(file, &tty->read_wait, wait);
2377 poll_wait(file, &tty->write_wait, wait); 2377 poll_wait(file, &tty->write_wait, wait);
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index dc60aeea87d8..00d14d6a76bb 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -144,7 +144,7 @@ static ssize_t tty_read(struct file *, char __user *, size_t, loff_t *);
144static ssize_t tty_write(struct file *, const char __user *, size_t, loff_t *); 144static ssize_t tty_write(struct file *, const char __user *, size_t, loff_t *);
145ssize_t redirected_tty_write(struct file *, const char __user *, 145ssize_t redirected_tty_write(struct file *, const char __user *,
146 size_t, loff_t *); 146 size_t, loff_t *);
147static unsigned int tty_poll(struct file *, poll_table *); 147static __poll_t tty_poll(struct file *, poll_table *);
148static int tty_open(struct inode *, struct file *); 148static int tty_open(struct inode *, struct file *);
149long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg); 149long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
150#ifdef CONFIG_COMPAT 150#ifdef CONFIG_COMPAT
@@ -443,7 +443,7 @@ static ssize_t hung_up_tty_write(struct file *file, const char __user *buf,
443} 443}
444 444
445/* No kernel lock held - none needed ;) */ 445/* No kernel lock held - none needed ;) */
446static unsigned int hung_up_tty_poll(struct file *filp, poll_table *wait) 446static __poll_t hung_up_tty_poll(struct file *filp, poll_table *wait)
447{ 447{
448 return POLLIN | POLLOUT | POLLERR | POLLHUP | POLLRDNORM | POLLWRNORM; 448 return POLLIN | POLLOUT | POLLERR | POLLHUP | POLLRDNORM | POLLWRNORM;
449} 449}
@@ -2055,11 +2055,11 @@ retry_open:
2055 * may be re-entered freely by other callers. 2055 * may be re-entered freely by other callers.
2056 */ 2056 */
2057 2057
2058static unsigned int tty_poll(struct file *filp, poll_table *wait) 2058static __poll_t tty_poll(struct file *filp, poll_table *wait)
2059{ 2059{
2060 struct tty_struct *tty = file_tty(filp); 2060 struct tty_struct *tty = file_tty(filp);
2061 struct tty_ldisc *ld; 2061 struct tty_ldisc *ld;
2062 int ret = 0; 2062 __poll_t ret = 0;
2063 2063
2064 if (tty_paranoia_check(tty, file_inode(filp), "tty_poll")) 2064 if (tty_paranoia_check(tty, file_inode(filp), "tty_poll"))
2065 return 0; 2065 return 0;
diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c
index 85b6634f518a..3e64ccd0040f 100644
--- a/drivers/tty/vt/vc_screen.c
+++ b/drivers/tty/vt/vc_screen.c
@@ -559,11 +559,11 @@ unlock_out:
559 return ret; 559 return ret;
560} 560}
561 561
562static unsigned int 562static __poll_t
563vcs_poll(struct file *file, poll_table *wait) 563vcs_poll(struct file *file, poll_table *wait)
564{ 564{
565 struct vcs_poll_data *poll = vcs_poll_data_get(file); 565 struct vcs_poll_data *poll = vcs_poll_data_get(file);
566 int ret = DEFAULT_POLLMASK|POLLERR|POLLPRI; 566 __poll_t ret = DEFAULT_POLLMASK|POLLERR|POLLPRI;
567 567
568 if (poll) { 568 if (poll) {
569 poll_wait(file, &poll->waitq, wait); 569 poll_wait(file, &poll->waitq, wait);
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index ff04b7f8549f..85bc1aaea4a4 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -496,7 +496,7 @@ static int uio_release(struct inode *inode, struct file *filep)
496 return ret; 496 return ret;
497} 497}
498 498
499static unsigned int uio_poll(struct file *filep, poll_table *wait) 499static __poll_t uio_poll(struct file *filep, poll_table *wait)
500{ 500{
501 struct uio_listener *listener = filep->private_data; 501 struct uio_listener *listener = filep->private_data;
502 struct uio_device *idev = listener->dev; 502 struct uio_device *idev = listener->dev;
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 6c181a625daf..9627ea6ec3ae 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -595,11 +595,11 @@ static int wdm_flush(struct file *file, fl_owner_t id)
595 return usb_translate_errors(desc->werr); 595 return usb_translate_errors(desc->werr);
596} 596}
597 597
598static unsigned int wdm_poll(struct file *file, struct poll_table_struct *wait) 598static __poll_t wdm_poll(struct file *file, struct poll_table_struct *wait)
599{ 599{
600 struct wdm_device *desc = file->private_data; 600 struct wdm_device *desc = file->private_data;
601 unsigned long flags; 601 unsigned long flags;
602 unsigned int mask = 0; 602 __poll_t mask = 0;
603 603
604 spin_lock_irqsave(&desc->iuspin, flags); 604 spin_lock_irqsave(&desc->iuspin, flags);
605 if (test_bit(WDM_DISCONNECTING, &desc->flags)) { 605 if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index c454885ef4a0..f45e8877771a 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -469,9 +469,9 @@ static int usblp_release(struct inode *inode, struct file *file)
469} 469}
470 470
471/* No kernel lock - fine */ 471/* No kernel lock - fine */
472static unsigned int usblp_poll(struct file *file, struct poll_table_struct *wait) 472static __poll_t usblp_poll(struct file *file, struct poll_table_struct *wait)
473{ 473{
474 int ret; 474 __poll_t ret;
475 unsigned long flags; 475 unsigned long flags;
476 476
477 struct usblp *usblp = file->private_data; 477 struct usblp *usblp = file->private_data;
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 0b8b0f3bdd2f..7ea67a55be10 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -1257,10 +1257,10 @@ static int usbtmc_fasync(int fd, struct file *file, int on)
1257 return fasync_helper(fd, file, on, &data->fasync); 1257 return fasync_helper(fd, file, on, &data->fasync);
1258} 1258}
1259 1259
1260static unsigned int usbtmc_poll(struct file *file, poll_table *wait) 1260static __poll_t usbtmc_poll(struct file *file, poll_table *wait)
1261{ 1261{
1262 struct usbtmc_device_data *data = file->private_data; 1262 struct usbtmc_device_data *data = file->private_data;
1263 unsigned int mask; 1263 __poll_t mask;
1264 1264
1265 mutex_lock(&data->io_mutex); 1265 mutex_lock(&data->io_mutex);
1266 1266
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
index c2cf62b7043a..e2cec448779e 100644
--- a/drivers/usb/core/devices.c
+++ b/drivers/usb/core/devices.c
@@ -622,7 +622,7 @@ static ssize_t usb_device_read(struct file *file, char __user *buf,
622} 622}
623 623
624/* Kernel lock for "lastev" protection */ 624/* Kernel lock for "lastev" protection */
625static unsigned int usb_device_poll(struct file *file, 625static __poll_t usb_device_poll(struct file *file,
626 struct poll_table_struct *wait) 626 struct poll_table_struct *wait)
627{ 627{
628 unsigned int event_count; 628 unsigned int event_count;
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 3f9bd3e4c373..5e72bf36aca4 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -2572,11 +2572,11 @@ static long usbdev_compat_ioctl(struct file *file, unsigned int cmd,
2572#endif 2572#endif
2573 2573
2574/* No kernel lock - fine */ 2574/* No kernel lock - fine */
2575static unsigned int usbdev_poll(struct file *file, 2575static __poll_t usbdev_poll(struct file *file,
2576 struct poll_table_struct *wait) 2576 struct poll_table_struct *wait)
2577{ 2577{
2578 struct usb_dev_state *ps = file->private_data; 2578 struct usb_dev_state *ps = file->private_data;
2579 unsigned int mask = 0; 2579 __poll_t mask = 0;
2580 2580
2581 poll_wait(file, &ps->wait, wait); 2581 poll_wait(file, &ps->wait, wait);
2582 if (file->f_mode & FMODE_WRITE && !list_empty(&ps->async_completed)) 2582 if (file->f_mode & FMODE_WRITE && !list_empty(&ps->async_completed))
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index b6cf5ab5a0a1..b540935891af 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -638,10 +638,10 @@ static long ffs_ep0_ioctl(struct file *file, unsigned code, unsigned long value)
638 return ret; 638 return ret;
639} 639}
640 640
641static unsigned int ffs_ep0_poll(struct file *file, poll_table *wait) 641static __poll_t ffs_ep0_poll(struct file *file, poll_table *wait)
642{ 642{
643 struct ffs_data *ffs = file->private_data; 643 struct ffs_data *ffs = file->private_data;
644 unsigned int mask = POLLWRNORM; 644 __poll_t mask = POLLWRNORM;
645 int ret; 645 int ret;
646 646
647 poll_wait(file, &ffs->ev.waitq, wait); 647 poll_wait(file, &ffs->ev.waitq, wait);
diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c
index daae35318a3a..a73efb1c47d0 100644
--- a/drivers/usb/gadget/function/f_hid.c
+++ b/drivers/usb/gadget/function/f_hid.c
@@ -413,10 +413,10 @@ release_write_pending_unlocked:
413 return status; 413 return status;
414} 414}
415 415
416static unsigned int f_hidg_poll(struct file *file, poll_table *wait) 416static __poll_t f_hidg_poll(struct file *file, poll_table *wait)
417{ 417{
418 struct f_hidg *hidg = file->private_data; 418 struct f_hidg *hidg = file->private_data;
419 unsigned int ret = 0; 419 __poll_t ret = 0;
420 420
421 poll_wait(file, &hidg->read_queue, wait); 421 poll_wait(file, &hidg->read_queue, wait);
422 poll_wait(file, &hidg->write_queue, wait); 422 poll_wait(file, &hidg->write_queue, wait);
diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c
index dd607b99eb1d..453578c4af69 100644
--- a/drivers/usb/gadget/function/f_printer.c
+++ b/drivers/usb/gadget/function/f_printer.c
@@ -680,12 +680,12 @@ printer_fsync(struct file *fd, loff_t start, loff_t end, int datasync)
680 return 0; 680 return 0;
681} 681}
682 682
683static unsigned int 683static __poll_t
684printer_poll(struct file *fd, poll_table *wait) 684printer_poll(struct file *fd, poll_table *wait)
685{ 685{
686 struct printer_dev *dev = fd->private_data; 686 struct printer_dev *dev = fd->private_data;
687 unsigned long flags; 687 unsigned long flags;
688 int status = 0; 688 __poll_t status = 0;
689 689
690 mutex_lock(&dev->lock_printer_io); 690 mutex_lock(&dev->lock_printer_io);
691 spin_lock_irqsave(&dev->lock, flags); 691 spin_lock_irqsave(&dev->lock, flags);
diff --git a/drivers/usb/gadget/function/uvc_queue.c b/drivers/usb/gadget/function/uvc_queue.c
index 278d50ff1eea..9e33d5206d54 100644
--- a/drivers/usb/gadget/function/uvc_queue.c
+++ b/drivers/usb/gadget/function/uvc_queue.c
@@ -193,7 +193,7 @@ int uvcg_dequeue_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf,
193 * This function implements video queue polling and is intended to be used by 193 * This function implements video queue polling and is intended to be used by
194 * the device poll handler. 194 * the device poll handler.
195 */ 195 */
196unsigned int uvcg_queue_poll(struct uvc_video_queue *queue, struct file *file, 196__poll_t uvcg_queue_poll(struct uvc_video_queue *queue, struct file *file,
197 poll_table *wait) 197 poll_table *wait)
198{ 198{
199 return vb2_poll(&queue->queue, file, wait); 199 return vb2_poll(&queue->queue, file, wait);
diff --git a/drivers/usb/gadget/function/uvc_queue.h b/drivers/usb/gadget/function/uvc_queue.h
index 51ee94e5cf2b..f9f65b5c1062 100644
--- a/drivers/usb/gadget/function/uvc_queue.h
+++ b/drivers/usb/gadget/function/uvc_queue.h
@@ -72,7 +72,7 @@ int uvcg_queue_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf);
72int uvcg_dequeue_buffer(struct uvc_video_queue *queue, 72int uvcg_dequeue_buffer(struct uvc_video_queue *queue,
73 struct v4l2_buffer *buf, int nonblocking); 73 struct v4l2_buffer *buf, int nonblocking);
74 74
75unsigned int uvcg_queue_poll(struct uvc_video_queue *queue, 75__poll_t uvcg_queue_poll(struct uvc_video_queue *queue,
76 struct file *file, poll_table *wait); 76 struct file *file, poll_table *wait);
77 77
78int uvcg_queue_mmap(struct uvc_video_queue *queue, struct vm_area_struct *vma); 78int uvcg_queue_mmap(struct uvc_video_queue *queue, struct vm_area_struct *vma);
diff --git a/drivers/usb/gadget/function/uvc_v4l2.c b/drivers/usb/gadget/function/uvc_v4l2.c
index f3069db6f08e..9a9019625496 100644
--- a/drivers/usb/gadget/function/uvc_v4l2.c
+++ b/drivers/usb/gadget/function/uvc_v4l2.c
@@ -329,7 +329,7 @@ uvc_v4l2_mmap(struct file *file, struct vm_area_struct *vma)
329 return uvcg_queue_mmap(&uvc->video.queue, vma); 329 return uvcg_queue_mmap(&uvc->video.queue, vma);
330} 330}
331 331
332static unsigned int 332static __poll_t
333uvc_v4l2_poll(struct file *file, poll_table *wait) 333uvc_v4l2_poll(struct file *file, poll_table *wait)
334{ 334{
335 struct video_device *vdev = video_devdata(file); 335 struct video_device *vdev = video_devdata(file);
diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
index 9343ec436485..05691254d473 100644
--- a/drivers/usb/gadget/legacy/inode.c
+++ b/drivers/usb/gadget/legacy/inode.c
@@ -1209,11 +1209,11 @@ dev_release (struct inode *inode, struct file *fd)
1209 return 0; 1209 return 0;
1210} 1210}
1211 1211
1212static unsigned int 1212static __poll_t
1213ep0_poll (struct file *fd, poll_table *wait) 1213ep0_poll (struct file *fd, poll_table *wait)
1214{ 1214{
1215 struct dev_data *dev = fd->private_data; 1215 struct dev_data *dev = fd->private_data;
1216 int mask = 0; 1216 __poll_t mask = 0;
1217 1217
1218 if (dev->state <= STATE_DEV_OPENED) 1218 if (dev->state <= STATE_DEV_OPENED)
1219 return DEFAULT_POLLMASK; 1219 return DEFAULT_POLLMASK;
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index ad3109490c0f..1fa00b35f4ad 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -677,10 +677,10 @@ static int iowarrior_release(struct inode *inode, struct file *file)
677 return retval; 677 return retval;
678} 678}
679 679
680static unsigned iowarrior_poll(struct file *file, poll_table * wait) 680static __poll_t iowarrior_poll(struct file *file, poll_table * wait)
681{ 681{
682 struct iowarrior *dev = file->private_data; 682 struct iowarrior *dev = file->private_data;
683 unsigned int mask = 0; 683 __poll_t mask = 0;
684 684
685 if (!dev->present) 685 if (!dev->present)
686 return POLLERR | POLLHUP; 686 return POLLERR | POLLHUP;
diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c
index 5c1a3b852453..074398c1e410 100644
--- a/drivers/usb/misc/ldusb.c
+++ b/drivers/usb/misc/ldusb.c
@@ -409,10 +409,10 @@ exit:
409/** 409/**
410 * ld_usb_poll 410 * ld_usb_poll
411 */ 411 */
412static unsigned int ld_usb_poll(struct file *file, poll_table *wait) 412static __poll_t ld_usb_poll(struct file *file, poll_table *wait)
413{ 413{
414 struct ld_usb *dev; 414 struct ld_usb *dev;
415 unsigned int mask = 0; 415 __poll_t mask = 0;
416 416
417 dev = file->private_data; 417 dev = file->private_data;
418 418
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
index c5be6e9e24a5..941c45028828 100644
--- a/drivers/usb/misc/legousbtower.c
+++ b/drivers/usb/misc/legousbtower.c
@@ -224,7 +224,7 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t
224static inline void tower_delete (struct lego_usb_tower *dev); 224static inline void tower_delete (struct lego_usb_tower *dev);
225static int tower_open (struct inode *inode, struct file *file); 225static int tower_open (struct inode *inode, struct file *file);
226static int tower_release (struct inode *inode, struct file *file); 226static int tower_release (struct inode *inode, struct file *file);
227static unsigned int tower_poll (struct file *file, poll_table *wait); 227static __poll_t tower_poll (struct file *file, poll_table *wait);
228static loff_t tower_llseek (struct file *file, loff_t off, int whence); 228static loff_t tower_llseek (struct file *file, loff_t off, int whence);
229 229
230static void tower_abort_transfers (struct lego_usb_tower *dev); 230static void tower_abort_transfers (struct lego_usb_tower *dev);
@@ -509,10 +509,10 @@ static void tower_check_for_read_packet (struct lego_usb_tower *dev)
509/** 509/**
510 * tower_poll 510 * tower_poll
511 */ 511 */
512static unsigned int tower_poll (struct file *file, poll_table *wait) 512static __poll_t tower_poll (struct file *file, poll_table *wait)
513{ 513{
514 struct lego_usb_tower *dev; 514 struct lego_usb_tower *dev;
515 unsigned int mask = 0; 515 __poll_t mask = 0;
516 516
517 dev = file->private_data; 517 dev = file->private_data;
518 518
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
index f932f40302df..cc5b296bff3f 100644
--- a/drivers/usb/mon/mon_bin.c
+++ b/drivers/usb/mon/mon_bin.c
@@ -1191,11 +1191,11 @@ static long mon_bin_compat_ioctl(struct file *file,
1191} 1191}
1192#endif /* CONFIG_COMPAT */ 1192#endif /* CONFIG_COMPAT */
1193 1193
1194static unsigned int 1194static __poll_t
1195mon_bin_poll(struct file *file, struct poll_table_struct *wait) 1195mon_bin_poll(struct file *file, struct poll_table_struct *wait)
1196{ 1196{
1197 struct mon_reader_bin *rp = file->private_data; 1197 struct mon_reader_bin *rp = file->private_data;
1198 unsigned int mask = 0; 1198 __poll_t mask = 0;
1199 unsigned long flags; 1199 unsigned long flags;
1200 1200
1201 if (file->f_mode & FMODE_READ) 1201 if (file->f_mode & FMODE_READ)
diff --git a/drivers/vfio/virqfd.c b/drivers/vfio/virqfd.c
index 4797217e5e72..8cc4b48ff127 100644
--- a/drivers/vfio/virqfd.c
+++ b/drivers/vfio/virqfd.c
@@ -46,7 +46,7 @@ static void virqfd_deactivate(struct virqfd *virqfd)
46static int virqfd_wakeup(wait_queue_entry_t *wait, unsigned mode, int sync, void *key) 46static int virqfd_wakeup(wait_queue_entry_t *wait, unsigned mode, int sync, void *key)
47{ 47{
48 struct virqfd *virqfd = container_of(wait, struct virqfd, wait); 48 struct virqfd *virqfd = container_of(wait, struct virqfd, wait);
49 unsigned long flags = (unsigned long)key; 49 __poll_t flags = key_to_poll(key);
50 50
51 if (flags & POLLIN) { 51 if (flags & POLLIN) {
52 /* An event has been signaled, call function */ 52 /* An event has been signaled, call function */
@@ -113,7 +113,7 @@ int vfio_virqfd_enable(void *opaque,
113 struct eventfd_ctx *ctx; 113 struct eventfd_ctx *ctx;
114 struct virqfd *virqfd; 114 struct virqfd *virqfd;
115 int ret = 0; 115 int ret = 0;
116 unsigned int events; 116 __poll_t events;
117 117
118 virqfd = kzalloc(sizeof(*virqfd), GFP_KERNEL); 118 virqfd = kzalloc(sizeof(*virqfd), GFP_KERNEL);
119 if (!virqfd) 119 if (!virqfd)
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index c7bdeb655646..9524ee16878a 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -1353,7 +1353,7 @@ static ssize_t vhost_net_chr_write_iter(struct kiocb *iocb,
1353 return vhost_chr_write_iter(dev, from); 1353 return vhost_chr_write_iter(dev, from);
1354} 1354}
1355 1355
1356static unsigned int vhost_net_chr_poll(struct file *file, poll_table *wait) 1356static __poll_t vhost_net_chr_poll(struct file *file, poll_table *wait)
1357{ 1357{
1358 struct vhost_net *n = file->private_data; 1358 struct vhost_net *n = file->private_data;
1359 struct vhost_dev *dev = &n->dev; 1359 struct vhost_dev *dev = &n->dev;
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index e6bb0946d6e9..8d4374606756 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -170,7 +170,7 @@ static int vhost_poll_wakeup(wait_queue_entry_t *wait, unsigned mode, int sync,
170{ 170{
171 struct vhost_poll *poll = container_of(wait, struct vhost_poll, wait); 171 struct vhost_poll *poll = container_of(wait, struct vhost_poll, wait);
172 172
173 if (!((unsigned long)key & poll->mask)) 173 if (!(key_to_poll(key) & poll->mask))
174 return 0; 174 return 0;
175 175
176 vhost_poll_queue(poll); 176 vhost_poll_queue(poll);
@@ -187,7 +187,7 @@ EXPORT_SYMBOL_GPL(vhost_work_init);
187 187
188/* Init poll structure */ 188/* Init poll structure */
189void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, 189void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn,
190 unsigned long mask, struct vhost_dev *dev) 190 __poll_t mask, struct vhost_dev *dev)
191{ 191{
192 init_waitqueue_func_entry(&poll->wait, vhost_poll_wakeup); 192 init_waitqueue_func_entry(&poll->wait, vhost_poll_wakeup);
193 init_poll_funcptr(&poll->table, vhost_poll_func); 193 init_poll_funcptr(&poll->table, vhost_poll_func);
@@ -203,7 +203,7 @@ EXPORT_SYMBOL_GPL(vhost_poll_init);
203 * keep a reference to a file until after vhost_poll_stop is called. */ 203 * keep a reference to a file until after vhost_poll_stop is called. */
204int vhost_poll_start(struct vhost_poll *poll, struct file *file) 204int vhost_poll_start(struct vhost_poll *poll, struct file *file)
205{ 205{
206 unsigned long mask; 206 __poll_t mask;
207 int ret = 0; 207 int ret = 0;
208 208
209 if (poll->wqh) 209 if (poll->wqh)
@@ -211,7 +211,7 @@ int vhost_poll_start(struct vhost_poll *poll, struct file *file)
211 211
212 mask = file->f_op->poll(file, &poll->table); 212 mask = file->f_op->poll(file, &poll->table);
213 if (mask) 213 if (mask)
214 vhost_poll_wakeup(&poll->wait, 0, 0, (void *)mask); 214 vhost_poll_wakeup(&poll->wait, 0, 0, poll_to_key(mask));
215 if (mask & POLLERR) { 215 if (mask & POLLERR) {
216 if (poll->wqh) 216 if (poll->wqh)
217 remove_wait_queue(poll->wqh, &poll->wait); 217 remove_wait_queue(poll->wqh, &poll->wait);
@@ -1061,10 +1061,10 @@ done:
1061} 1061}
1062EXPORT_SYMBOL(vhost_chr_write_iter); 1062EXPORT_SYMBOL(vhost_chr_write_iter);
1063 1063
1064unsigned int vhost_chr_poll(struct file *file, struct vhost_dev *dev, 1064__poll_t vhost_chr_poll(struct file *file, struct vhost_dev *dev,
1065 poll_table *wait) 1065 poll_table *wait)
1066{ 1066{
1067 unsigned int mask = 0; 1067 __poll_t mask = 0;
1068 1068
1069 poll_wait(file, &dev->wait, wait); 1069 poll_wait(file, &dev->wait, wait);
1070 1070
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
index 79c6e7a60a5e..7876a3d7d1b3 100644
--- a/drivers/vhost/vhost.h
+++ b/drivers/vhost/vhost.h
@@ -34,7 +34,7 @@ struct vhost_poll {
34 wait_queue_head_t *wqh; 34 wait_queue_head_t *wqh;
35 wait_queue_entry_t wait; 35 wait_queue_entry_t wait;
36 struct vhost_work work; 36 struct vhost_work work;
37 unsigned long mask; 37 __poll_t mask;
38 struct vhost_dev *dev; 38 struct vhost_dev *dev;
39}; 39};
40 40
@@ -43,7 +43,7 @@ void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work);
43bool vhost_has_work(struct vhost_dev *dev); 43bool vhost_has_work(struct vhost_dev *dev);
44 44
45void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, 45void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn,
46 unsigned long mask, struct vhost_dev *dev); 46 __poll_t mask, struct vhost_dev *dev);
47int vhost_poll_start(struct vhost_poll *poll, struct file *file); 47int vhost_poll_start(struct vhost_poll *poll, struct file *file);
48void vhost_poll_stop(struct vhost_poll *poll); 48void vhost_poll_stop(struct vhost_poll *poll);
49void vhost_poll_flush(struct vhost_poll *poll); 49void vhost_poll_flush(struct vhost_poll *poll);
@@ -217,7 +217,7 @@ void vhost_enqueue_msg(struct vhost_dev *dev,
217 struct vhost_msg_node *node); 217 struct vhost_msg_node *node);
218struct vhost_msg_node *vhost_dequeue_msg(struct vhost_dev *dev, 218struct vhost_msg_node *vhost_dequeue_msg(struct vhost_dev *dev,
219 struct list_head *head); 219 struct list_head *head);
220unsigned int vhost_chr_poll(struct file *file, struct vhost_dev *dev, 220__poll_t vhost_chr_poll(struct file *file, struct vhost_dev *dev,
221 poll_table *wait); 221 poll_table *wait);
222ssize_t vhost_chr_read_iter(struct vhost_dev *dev, struct iov_iter *to, 222ssize_t vhost_chr_read_iter(struct vhost_dev *dev, struct iov_iter *to,
223 int noblock); 223 int noblock);
diff --git a/drivers/virt/fsl_hypervisor.c b/drivers/virt/fsl_hypervisor.c
index d70ad6d38879..b0597bef4555 100644
--- a/drivers/virt/fsl_hypervisor.c
+++ b/drivers/virt/fsl_hypervisor.c
@@ -565,11 +565,11 @@ static irqreturn_t fsl_hv_state_change_isr(int irq, void *data)
565/* 565/*
566 * Returns a bitmask indicating whether a read will block 566 * Returns a bitmask indicating whether a read will block
567 */ 567 */
568static unsigned int fsl_hv_poll(struct file *filp, struct poll_table_struct *p) 568static __poll_t fsl_hv_poll(struct file *filp, struct poll_table_struct *p)
569{ 569{
570 struct doorbell_queue *dbq = filp->private_data; 570 struct doorbell_queue *dbq = filp->private_data;
571 unsigned long flags; 571 unsigned long flags;
572 unsigned int mask; 572 __poll_t mask;
573 573
574 spin_lock_irqsave(&dbq->lock, flags); 574 spin_lock_irqsave(&dbq->lock, flags);
575 575
diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c
index 9729a64ea1a9..72c0416a01cc 100644
--- a/drivers/xen/evtchn.c
+++ b/drivers/xen/evtchn.c
@@ -621,9 +621,9 @@ static long evtchn_ioctl(struct file *file,
621 return rc; 621 return rc;
622} 622}
623 623
624static unsigned int evtchn_poll(struct file *file, poll_table *wait) 624static __poll_t evtchn_poll(struct file *file, poll_table *wait)
625{ 625{
626 unsigned int mask = POLLOUT | POLLWRNORM; 626 __poll_t mask = POLLOUT | POLLWRNORM;
627 struct per_user_data *u = file->private_data; 627 struct per_user_data *u = file->private_data;
628 628
629 poll_wait(file, &u->evtchn_wait, wait); 629 poll_wait(file, &u->evtchn_wait, wait);
diff --git a/drivers/xen/mcelog.c b/drivers/xen/mcelog.c
index 6cc1c15bcd84..9ade533d9e40 100644
--- a/drivers/xen/mcelog.c
+++ b/drivers/xen/mcelog.c
@@ -139,7 +139,7 @@ out:
139 return err ? err : buf - ubuf; 139 return err ? err : buf - ubuf;
140} 140}
141 141
142static unsigned int xen_mce_chrdev_poll(struct file *file, poll_table *wait) 142static __poll_t xen_mce_chrdev_poll(struct file *file, poll_table *wait)
143{ 143{
144 poll_wait(file, &xen_mce_chrdev_wait, wait); 144 poll_wait(file, &xen_mce_chrdev_wait, wait);
145 145
diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c
index 4c789e61554b..78804e71f9a6 100644
--- a/drivers/xen/pvcalls-front.c
+++ b/drivers/xen/pvcalls-front.c
@@ -878,7 +878,7 @@ received:
878 return ret; 878 return ret;
879} 879}
880 880
881static unsigned int pvcalls_front_poll_passive(struct file *file, 881static __poll_t pvcalls_front_poll_passive(struct file *file,
882 struct pvcalls_bedata *bedata, 882 struct pvcalls_bedata *bedata,
883 struct sock_mapping *map, 883 struct sock_mapping *map,
884 poll_table *wait) 884 poll_table *wait)
@@ -935,12 +935,12 @@ static unsigned int pvcalls_front_poll_passive(struct file *file,
935 return 0; 935 return 0;
936} 936}
937 937
938static unsigned int pvcalls_front_poll_active(struct file *file, 938static __poll_t pvcalls_front_poll_active(struct file *file,
939 struct pvcalls_bedata *bedata, 939 struct pvcalls_bedata *bedata,
940 struct sock_mapping *map, 940 struct sock_mapping *map,
941 poll_table *wait) 941 poll_table *wait)
942{ 942{
943 unsigned int mask = 0; 943 __poll_t mask = 0;
944 int32_t in_error, out_error; 944 int32_t in_error, out_error;
945 struct pvcalls_data_intf *intf = map->active.ring; 945 struct pvcalls_data_intf *intf = map->active.ring;
946 946
@@ -958,12 +958,12 @@ static unsigned int pvcalls_front_poll_active(struct file *file,
958 return mask; 958 return mask;
959} 959}
960 960
961unsigned int pvcalls_front_poll(struct file *file, struct socket *sock, 961__poll_t pvcalls_front_poll(struct file *file, struct socket *sock,
962 poll_table *wait) 962 poll_table *wait)
963{ 963{
964 struct pvcalls_bedata *bedata; 964 struct pvcalls_bedata *bedata;
965 struct sock_mapping *map; 965 struct sock_mapping *map;
966 int ret; 966 __poll_t ret;
967 967
968 pvcalls_enter(); 968 pvcalls_enter();
969 if (!pvcalls_front_dev) { 969 if (!pvcalls_front_dev) {
diff --git a/drivers/xen/xenbus/xenbus_dev_frontend.c b/drivers/xen/xenbus/xenbus_dev_frontend.c
index f3b089b7c0b6..e17ec3fce590 100644
--- a/drivers/xen/xenbus/xenbus_dev_frontend.c
+++ b/drivers/xen/xenbus/xenbus_dev_frontend.c
@@ -645,7 +645,7 @@ static int xenbus_file_release(struct inode *inode, struct file *filp)
645 return 0; 645 return 0;
646} 646}
647 647
648static unsigned int xenbus_file_poll(struct file *file, poll_table *wait) 648static __poll_t xenbus_file_poll(struct file *file, poll_table *wait)
649{ 649{
650 struct xenbus_file_priv *u = file->private_data; 650 struct xenbus_file_priv *u = file->private_data;
651 651
diff --git a/fs/cachefiles/daemon.c b/fs/cachefiles/daemon.c
index 1ee54ffd3a24..7edbd0679952 100644
--- a/fs/cachefiles/daemon.c
+++ b/fs/cachefiles/daemon.c
@@ -31,7 +31,7 @@ static ssize_t cachefiles_daemon_read(struct file *, char __user *, size_t,
31 loff_t *); 31 loff_t *);
32static ssize_t cachefiles_daemon_write(struct file *, const char __user *, 32static ssize_t cachefiles_daemon_write(struct file *, const char __user *,
33 size_t, loff_t *); 33 size_t, loff_t *);
34static unsigned int cachefiles_daemon_poll(struct file *, 34static __poll_t cachefiles_daemon_poll(struct file *,
35 struct poll_table_struct *); 35 struct poll_table_struct *);
36static int cachefiles_daemon_frun(struct cachefiles_cache *, char *); 36static int cachefiles_daemon_frun(struct cachefiles_cache *, char *);
37static int cachefiles_daemon_fcull(struct cachefiles_cache *, char *); 37static int cachefiles_daemon_fcull(struct cachefiles_cache *, char *);
@@ -291,11 +291,11 @@ found_command:
291 * poll for culling state 291 * poll for culling state
292 * - use POLLOUT to indicate culling state 292 * - use POLLOUT to indicate culling state
293 */ 293 */
294static unsigned int cachefiles_daemon_poll(struct file *file, 294static __poll_t cachefiles_daemon_poll(struct file *file,
295 struct poll_table_struct *poll) 295 struct poll_table_struct *poll)
296{ 296{
297 struct cachefiles_cache *cache = file->private_data; 297 struct cachefiles_cache *cache = file->private_data;
298 unsigned int mask; 298 __poll_t mask;
299 299
300 poll_wait(file, &cache->daemon_pollwq, poll); 300 poll_wait(file, &cache->daemon_pollwq, poll);
301 mask = 0; 301 mask = 0;
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c
index f40e3953e7fe..49d3c6fda89a 100644
--- a/fs/coda/psdev.c
+++ b/fs/coda/psdev.c
@@ -61,10 +61,10 @@ static struct class *coda_psdev_class;
61 * Device operations 61 * Device operations
62 */ 62 */
63 63
64static unsigned int coda_psdev_poll(struct file *file, poll_table * wait) 64static __poll_t coda_psdev_poll(struct file *file, poll_table * wait)
65{ 65{
66 struct venus_comm *vcp = (struct venus_comm *) file->private_data; 66 struct venus_comm *vcp = (struct venus_comm *) file->private_data;
67 unsigned int mask = POLLOUT | POLLWRNORM; 67 __poll_t mask = POLLOUT | POLLWRNORM;
68 68
69 poll_wait(file, &vcp->vc_waitq, wait); 69 poll_wait(file, &vcp->vc_waitq, wait);
70 mutex_lock(&vcp->vc_mutex); 70 mutex_lock(&vcp->vc_mutex);
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
index cd12e6576b48..6fdbf21be318 100644
--- a/fs/debugfs/file.c
+++ b/fs/debugfs/file.c
@@ -206,11 +206,11 @@ FULL_PROXY_FUNC(unlocked_ioctl, long, filp,
206 PROTO(struct file *filp, unsigned int cmd, unsigned long arg), 206 PROTO(struct file *filp, unsigned int cmd, unsigned long arg),
207 ARGS(filp, cmd, arg)); 207 ARGS(filp, cmd, arg));
208 208
209static unsigned int full_proxy_poll(struct file *filp, 209static __poll_t full_proxy_poll(struct file *filp,
210 struct poll_table_struct *wait) 210 struct poll_table_struct *wait)
211{ 211{
212 struct dentry *dentry = F_DENTRY(filp); 212 struct dentry *dentry = F_DENTRY(filp);
213 unsigned int r = 0; 213 __poll_t r = 0;
214 const struct file_operations *real_fops; 214 const struct file_operations *real_fops;
215 215
216 if (debugfs_file_get(dentry)) 216 if (debugfs_file_get(dentry))
diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c
index e631b1689228..a4c63e9e6385 100644
--- a/fs/dlm/plock.c
+++ b/fs/dlm/plock.c
@@ -463,9 +463,9 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count,
463 return count; 463 return count;
464} 464}
465 465
466static unsigned int dev_poll(struct file *file, poll_table *wait) 466static __poll_t dev_poll(struct file *file, poll_table *wait)
467{ 467{
468 unsigned int mask = 0; 468 __poll_t mask = 0;
469 469
470 poll_wait(file, &send_wq, wait); 470 poll_wait(file, &send_wq, wait);
471 471
diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index d18e7a539f11..662432af8ce8 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -887,7 +887,7 @@ static ssize_t device_read(struct file *file, char __user *buf, size_t count,
887 return rv; 887 return rv;
888} 888}
889 889
890static unsigned int device_poll(struct file *file, poll_table *wait) 890static __poll_t device_poll(struct file *file, poll_table *wait)
891{ 891{
892 struct dlm_user_proc *proc = file->private_data; 892 struct dlm_user_proc *proc = file->private_data;
893 893
diff --git a/fs/ecryptfs/miscdev.c b/fs/ecryptfs/miscdev.c
index f09cacaf8c80..7423e792a092 100644
--- a/fs/ecryptfs/miscdev.c
+++ b/fs/ecryptfs/miscdev.c
@@ -38,11 +38,11 @@ static atomic_t ecryptfs_num_miscdev_opens;
38 * 38 *
39 * Returns the poll mask 39 * Returns the poll mask
40 */ 40 */
41static unsigned int 41static __poll_t
42ecryptfs_miscdev_poll(struct file *file, poll_table *pt) 42ecryptfs_miscdev_poll(struct file *file, poll_table *pt)
43{ 43{
44 struct ecryptfs_daemon *daemon = file->private_data; 44 struct ecryptfs_daemon *daemon = file->private_data;
45 unsigned int mask = 0; 45 __poll_t mask = 0;
46 46
47 mutex_lock(&daemon->mux); 47 mutex_lock(&daemon->mux);
48 if (daemon->flags & ECRYPTFS_DAEMON_ZOMBIE) { 48 if (daemon->flags & ECRYPTFS_DAEMON_ZOMBIE) {
diff --git a/fs/eventfd.c b/fs/eventfd.c
index 2fb4eadaa118..6318a9b57e53 100644
--- a/fs/eventfd.c
+++ b/fs/eventfd.c
@@ -114,10 +114,10 @@ static int eventfd_release(struct inode *inode, struct file *file)
114 return 0; 114 return 0;
115} 115}
116 116
117static unsigned int eventfd_poll(struct file *file, poll_table *wait) 117static __poll_t eventfd_poll(struct file *file, poll_table *wait)
118{ 118{
119 struct eventfd_ctx *ctx = file->private_data; 119 struct eventfd_ctx *ctx = file->private_data;
120 unsigned int events = 0; 120 __poll_t events = 0;
121 u64 count; 121 u64 count;
122 122
123 poll_wait(file, &ctx->wqh, wait); 123 poll_wait(file, &ctx->wqh, wait);
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index afd548ebc328..42e35a6977c9 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -874,7 +874,8 @@ static void ep_ptable_queue_proc(struct file *file, wait_queue_head_t *whead,
874 * the ep->mtx so we need to start from depth=1, such that mutex_lock_nested() 874 * the ep->mtx so we need to start from depth=1, such that mutex_lock_nested()
875 * is correctly annotated. 875 * is correctly annotated.
876 */ 876 */
877static unsigned int ep_item_poll(struct epitem *epi, poll_table *pt, int depth) 877static unsigned int ep_item_poll(const struct epitem *epi, poll_table *pt,
878 int depth)
878{ 879{
879 struct eventpoll *ep; 880 struct eventpoll *ep;
880 bool locked; 881 bool locked;
@@ -920,7 +921,7 @@ static int ep_read_events_proc(struct eventpoll *ep, struct list_head *head,
920 return 0; 921 return 0;
921} 922}
922 923
923static unsigned int ep_eventpoll_poll(struct file *file, poll_table *wait) 924static __poll_t ep_eventpoll_poll(struct file *file, poll_table *wait)
924{ 925{
925 struct eventpoll *ep = file->private_data; 926 struct eventpoll *ep = file->private_data;
926 int depth = 0; 927 int depth = 0;
@@ -1117,6 +1118,7 @@ static int ep_poll_callback(wait_queue_entry_t *wait, unsigned mode, int sync, v
1117 unsigned long flags; 1118 unsigned long flags;
1118 struct epitem *epi = ep_item_from_wait(wait); 1119 struct epitem *epi = ep_item_from_wait(wait);
1119 struct eventpoll *ep = epi->ep; 1120 struct eventpoll *ep = epi->ep;
1121 __poll_t pollflags = key_to_poll(key);
1120 int ewake = 0; 1122 int ewake = 0;
1121 1123
1122 spin_lock_irqsave(&ep->lock, flags); 1124 spin_lock_irqsave(&ep->lock, flags);
@@ -1138,7 +1140,7 @@ static int ep_poll_callback(wait_queue_entry_t *wait, unsigned mode, int sync, v
1138 * callback. We need to be able to handle both cases here, hence the 1140 * callback. We need to be able to handle both cases here, hence the
1139 * test for "key" != NULL before the event match test. 1141 * test for "key" != NULL before the event match test.
1140 */ 1142 */
1141 if (key && !((unsigned long) key & epi->event.events)) 1143 if (pollflags && !(pollflags & epi->event.events))
1142 goto out_unlock; 1144 goto out_unlock;
1143 1145
1144 /* 1146 /*
@@ -1175,8 +1177,8 @@ static int ep_poll_callback(wait_queue_entry_t *wait, unsigned mode, int sync, v
1175 */ 1177 */
1176 if (waitqueue_active(&ep->wq)) { 1178 if (waitqueue_active(&ep->wq)) {
1177 if ((epi->event.events & EPOLLEXCLUSIVE) && 1179 if ((epi->event.events & EPOLLEXCLUSIVE) &&
1178 !((unsigned long)key & POLLFREE)) { 1180 !(pollflags & POLLFREE)) {
1179 switch ((unsigned long)key & EPOLLINOUT_BITS) { 1181 switch (pollflags & EPOLLINOUT_BITS) {
1180 case POLLIN: 1182 case POLLIN:
1181 if (epi->event.events & POLLIN) 1183 if (epi->event.events & POLLIN)
1182 ewake = 1; 1184 ewake = 1;
@@ -1205,7 +1207,7 @@ out_unlock:
1205 if (!(epi->event.events & EPOLLEXCLUSIVE)) 1207 if (!(epi->event.events & EPOLLEXCLUSIVE))
1206 ewake = 1; 1208 ewake = 1;
1207 1209
1208 if ((unsigned long)key & POLLFREE) { 1210 if (pollflags & POLLFREE) {
1209 /* 1211 /*
1210 * If we race with ep_remove_wait_queue() it can miss 1212 * If we race with ep_remove_wait_queue() it can miss
1211 * ->whead = NULL and do another remove_wait_queue() after 1213 * ->whead = NULL and do another remove_wait_queue() after
@@ -1409,7 +1411,7 @@ static noinline void ep_destroy_wakeup_source(struct epitem *epi)
1409/* 1411/*
1410 * Must be called with "mtx" held. 1412 * Must be called with "mtx" held.
1411 */ 1413 */
1412static int ep_insert(struct eventpoll *ep, struct epoll_event *event, 1414static int ep_insert(struct eventpoll *ep, const struct epoll_event *event,
1413 struct file *tfile, int fd, int full_check) 1415 struct file *tfile, int fd, int full_check)
1414{ 1416{
1415 int error, revents, pwake = 0; 1417 int error, revents, pwake = 0;
@@ -1486,7 +1488,7 @@ static int ep_insert(struct eventpoll *ep, struct epoll_event *event,
1486 ep_set_busy_poll_napi_id(epi); 1488 ep_set_busy_poll_napi_id(epi);
1487 1489
1488 /* If the file is already "ready" we drop it inside the ready list */ 1490 /* If the file is already "ready" we drop it inside the ready list */
1489 if ((revents & event->events) && !ep_is_linked(&epi->rdllink)) { 1491 if (revents && !ep_is_linked(&epi->rdllink)) {
1490 list_add_tail(&epi->rdllink, &ep->rdllist); 1492 list_add_tail(&epi->rdllink, &ep->rdllist);
1491 ep_pm_stay_awake(epi); 1493 ep_pm_stay_awake(epi);
1492 1494
@@ -1540,10 +1542,10 @@ error_create_wakeup_source:
1540 * Modify the interest event mask by dropping an event if the new mask 1542 * Modify the interest event mask by dropping an event if the new mask
1541 * has a match in the current file status. Must be called with "mtx" held. 1543 * has a match in the current file status. Must be called with "mtx" held.
1542 */ 1544 */
1543static int ep_modify(struct eventpoll *ep, struct epitem *epi, struct epoll_event *event) 1545static int ep_modify(struct eventpoll *ep, struct epitem *epi,
1546 const struct epoll_event *event)
1544{ 1547{
1545 int pwake = 0; 1548 int pwake = 0;
1546 unsigned int revents;
1547 poll_table pt; 1549 poll_table pt;
1548 1550
1549 init_poll_funcptr(&pt, NULL); 1551 init_poll_funcptr(&pt, NULL);
@@ -1585,14 +1587,10 @@ static int ep_modify(struct eventpoll *ep, struct epitem *epi, struct epoll_even
1585 /* 1587 /*
1586 * Get current event bits. We can safely use the file* here because 1588 * Get current event bits. We can safely use the file* here because
1587 * its usage count has been increased by the caller of this function. 1589 * its usage count has been increased by the caller of this function.
1588 */
1589 revents = ep_item_poll(epi, &pt, 1);
1590
1591 /*
1592 * If the item is "hot" and it is not registered inside the ready 1590 * If the item is "hot" and it is not registered inside the ready
1593 * list, push it inside. 1591 * list, push it inside.
1594 */ 1592 */
1595 if (revents & event->events) { 1593 if (ep_item_poll(epi, &pt, 1)) {
1596 spin_lock_irq(&ep->lock); 1594 spin_lock_irq(&ep->lock);
1597 if (!ep_is_linked(&epi->rdllink)) { 1595 if (!ep_is_linked(&epi->rdllink)) {
1598 list_add_tail(&epi->rdllink, &ep->rdllist); 1596 list_add_tail(&epi->rdllink, &ep->rdllist);
diff --git a/fs/fcntl.c b/fs/fcntl.c
index c17369659f4a..c7b9e0948107 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -690,7 +690,7 @@ COMPAT_SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd,
690 690
691/* Table to convert sigio signal codes into poll band bitmaps */ 691/* Table to convert sigio signal codes into poll band bitmaps */
692 692
693static const long band_table[NSIGPOLL] = { 693static const __poll_t band_table[NSIGPOLL] = {
694 POLLIN | POLLRDNORM, /* POLL_IN */ 694 POLLIN | POLLRDNORM, /* POLL_IN */
695 POLLOUT | POLLWRNORM | POLLWRBAND, /* POLL_OUT */ 695 POLLOUT | POLLWRNORM | POLLWRBAND, /* POLL_OUT */
696 POLLIN | POLLRDNORM | POLLMSG, /* POLL_MSG */ 696 POLLIN | POLLRDNORM | POLLMSG, /* POLL_MSG */
@@ -759,7 +759,7 @@ static void send_sigio_to_task(struct task_struct *p,
759 if (reason - POLL_IN >= NSIGPOLL) 759 if (reason - POLL_IN >= NSIGPOLL)
760 si.si_band = ~0L; 760 si.si_band = ~0L;
761 else 761 else
762 si.si_band = band_table[reason - POLL_IN]; 762 si.si_band = mangle_poll(band_table[reason - POLL_IN]);
763 si.si_fd = fd; 763 si.si_fd = fd;
764 if (!do_send_sig_info(signum, &si, p, group)) 764 if (!do_send_sig_info(signum, &si, p, group))
765 break; 765 break;
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 17f0d05bfd4c..aa089a6925d0 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -2004,9 +2004,9 @@ out:
2004 return ret; 2004 return ret;
2005} 2005}
2006 2006
2007static unsigned fuse_dev_poll(struct file *file, poll_table *wait) 2007static __poll_t fuse_dev_poll(struct file *file, poll_table *wait)
2008{ 2008{
2009 unsigned mask = POLLOUT | POLLWRNORM; 2009 __poll_t mask = POLLOUT | POLLWRNORM;
2010 struct fuse_iqueue *fiq; 2010 struct fuse_iqueue *fiq;
2011 struct fuse_dev *fud = fuse_get_dev(file); 2011 struct fuse_dev *fud = fuse_get_dev(file);
2012 2012
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index cb7dff5c45d7..e85e974dd211 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -2751,7 +2751,7 @@ static void fuse_register_polled_file(struct fuse_conn *fc,
2751 spin_unlock(&fc->lock); 2751 spin_unlock(&fc->lock);
2752} 2752}
2753 2753
2754unsigned fuse_file_poll(struct file *file, poll_table *wait) 2754__poll_t fuse_file_poll(struct file *file, poll_table *wait)
2755{ 2755{
2756 struct fuse_file *ff = file->private_data; 2756 struct fuse_file *ff = file->private_data;
2757 struct fuse_conn *fc = ff->fc; 2757 struct fuse_conn *fc = ff->fc;
@@ -2764,7 +2764,7 @@ unsigned fuse_file_poll(struct file *file, poll_table *wait)
2764 return DEFAULT_POLLMASK; 2764 return DEFAULT_POLLMASK;
2765 2765
2766 poll_wait(file, &ff->poll_wait, wait); 2766 poll_wait(file, &ff->poll_wait, wait);
2767 inarg.events = (__u32)poll_requested_events(wait); 2767 inarg.events = mangle_poll(poll_requested_events(wait));
2768 2768
2769 /* 2769 /*
2770 * Ask for notification iff there's someone waiting for it. 2770 * Ask for notification iff there's someone waiting for it.
@@ -2786,7 +2786,7 @@ unsigned fuse_file_poll(struct file *file, poll_table *wait)
2786 err = fuse_simple_request(fc, &args); 2786 err = fuse_simple_request(fc, &args);
2787 2787
2788 if (!err) 2788 if (!err)
2789 return outarg.revents; 2789 return demangle_poll(outarg.revents);
2790 if (err == -ENOSYS) { 2790 if (err == -ENOSYS) {
2791 fc->no_poll = 1; 2791 fc->no_poll = 1;
2792 return DEFAULT_POLLMASK; 2792 return DEFAULT_POLLMASK;
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index d5773ca67ad2..c4c093bbf456 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -951,7 +951,7 @@ long fuse_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg,
951 unsigned int flags); 951 unsigned int flags);
952long fuse_ioctl_common(struct file *file, unsigned int cmd, 952long fuse_ioctl_common(struct file *file, unsigned int cmd,
953 unsigned long arg, unsigned int flags); 953 unsigned long arg, unsigned int flags);
954unsigned fuse_file_poll(struct file *file, poll_table *wait); 954__poll_t fuse_file_poll(struct file *file, poll_table *wait);
955int fuse_dev_release(struct inode *inode, struct file *file); 955int fuse_dev_release(struct inode *inode, struct file *file);
956 956
957bool fuse_write_update_size(struct inode *inode, loff_t pos); 957bool fuse_write_update_size(struct inode *inode, loff_t pos);
diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c
index 9698e51656b1..c53d9cc5ae7a 100644
--- a/fs/kernfs/file.c
+++ b/fs/kernfs/file.c
@@ -832,7 +832,7 @@ void kernfs_drain_open_files(struct kernfs_node *kn)
832 * to see if it supports poll (Neither 'poll' nor 'select' return 832 * to see if it supports poll (Neither 'poll' nor 'select' return
833 * an appropriate error code). When in doubt, set a suitable timeout value. 833 * an appropriate error code). When in doubt, set a suitable timeout value.
834 */ 834 */
835static unsigned int kernfs_fop_poll(struct file *filp, poll_table *wait) 835static __poll_t kernfs_fop_poll(struct file *filp, poll_table *wait)
836{ 836{
837 struct kernfs_open_file *of = kernfs_of(filp); 837 struct kernfs_open_file *of = kernfs_of(filp);
838 struct kernfs_node *kn = kernfs_dentry_node(filp->f_path.dentry); 838 struct kernfs_node *kn = kernfs_dentry_node(filp->f_path.dentry);
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index d0d4bc4c4b70..ef08d64c84b8 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -239,10 +239,10 @@ out_close_fd:
239} 239}
240 240
241/* intofiy userspace file descriptor functions */ 241/* intofiy userspace file descriptor functions */
242static unsigned int fanotify_poll(struct file *file, poll_table *wait) 242static __poll_t fanotify_poll(struct file *file, poll_table *wait)
243{ 243{
244 struct fsnotify_group *group = file->private_data; 244 struct fsnotify_group *group = file->private_data;
245 int ret = 0; 245 __poll_t ret = 0;
246 246
247 poll_wait(file, &group->notification_waitq, wait); 247 poll_wait(file, &group->notification_waitq, wait);
248 spin_lock(&group->notification_lock); 248 spin_lock(&group->notification_lock);
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
index d3c20e0bb046..5c29bf16814f 100644
--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -107,10 +107,10 @@ static inline u32 inotify_mask_to_arg(__u32 mask)
107} 107}
108 108
109/* intofiy userspace file descriptor functions */ 109/* intofiy userspace file descriptor functions */
110static unsigned int inotify_poll(struct file *file, poll_table *wait) 110static __poll_t inotify_poll(struct file *file, poll_table *wait)
111{ 111{
112 struct fsnotify_group *group = file->private_data; 112 struct fsnotify_group *group = file->private_data;
113 int ret = 0; 113 __poll_t ret = 0;
114 114
115 poll_wait(file, &group->notification_waitq, wait); 115 poll_wait(file, &group->notification_waitq, wait);
116 spin_lock(&group->notification_lock); 116 spin_lock(&group->notification_lock);
diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c
index 9c7c18c0e129..385fcefa8bc5 100644
--- a/fs/ocfs2/dlmfs/dlmfs.c
+++ b/fs/ocfs2/dlmfs/dlmfs.c
@@ -220,9 +220,9 @@ static int dlmfs_file_setattr(struct dentry *dentry, struct iattr *attr)
220 return 0; 220 return 0;
221} 221}
222 222
223static unsigned int dlmfs_file_poll(struct file *file, poll_table *wait) 223static __poll_t dlmfs_file_poll(struct file *file, poll_table *wait)
224{ 224{
225 int event = 0; 225 __poll_t event = 0;
226 struct inode *inode = file_inode(file); 226 struct inode *inode = file_inode(file);
227 struct dlmfs_inode_private *ip = DLMFS_I(inode); 227 struct dlmfs_inode_private *ip = DLMFS_I(inode);
228 228
diff --git a/fs/orangefs/devorangefs-req.c b/fs/orangefs/devorangefs-req.c
index c584ad8d023c..f073cd9e6687 100644
--- a/fs/orangefs/devorangefs-req.c
+++ b/fs/orangefs/devorangefs-req.c
@@ -815,15 +815,15 @@ void orangefs_dev_cleanup(void)
815 ORANGEFS_REQDEVICE_NAME); 815 ORANGEFS_REQDEVICE_NAME);
816} 816}
817 817
818static unsigned int orangefs_devreq_poll(struct file *file, 818static __poll_t orangefs_devreq_poll(struct file *file,
819 struct poll_table_struct *poll_table) 819 struct poll_table_struct *poll_table)
820{ 820{
821 int poll_revent_mask = 0; 821 __poll_t poll_revent_mask = 0;
822 822
823 poll_wait(file, &orangefs_request_list_waitq, poll_table); 823 poll_wait(file, &orangefs_request_list_waitq, poll_table);
824 824
825 if (!list_empty(&orangefs_request_list)) 825 if (!list_empty(&orangefs_request_list))
826 poll_revent_mask |= POLL_IN; 826 poll_revent_mask |= POLLIN;
827 return poll_revent_mask; 827 return poll_revent_mask;
828} 828}
829 829
diff --git a/fs/pipe.c b/fs/pipe.c
index 6d98566201ef..a449ca0ec0c6 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -515,10 +515,10 @@ static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
515} 515}
516 516
517/* No kernel lock held - fine */ 517/* No kernel lock held - fine */
518static unsigned int 518static __poll_t
519pipe_poll(struct file *filp, poll_table *wait) 519pipe_poll(struct file *filp, poll_table *wait)
520{ 520{
521 unsigned int mask; 521 __poll_t mask;
522 struct pipe_inode_info *pipe = filp->private_data; 522 struct pipe_inode_info *pipe = filp->private_data;
523 int nrbufs; 523 int nrbufs;
524 524
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index dd0f82622427..8dacaabb9f37 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -234,11 +234,11 @@ static ssize_t proc_reg_write(struct file *file, const char __user *buf, size_t
234 return rv; 234 return rv;
235} 235}
236 236
237static unsigned int proc_reg_poll(struct file *file, struct poll_table_struct *pts) 237static __poll_t proc_reg_poll(struct file *file, struct poll_table_struct *pts)
238{ 238{
239 struct proc_dir_entry *pde = PDE(file_inode(file)); 239 struct proc_dir_entry *pde = PDE(file_inode(file));
240 unsigned int rv = DEFAULT_POLLMASK; 240 __poll_t rv = DEFAULT_POLLMASK;
241 unsigned int (*poll)(struct file *, struct poll_table_struct *); 241 __poll_t (*poll)(struct file *, struct poll_table_struct *);
242 if (use_pde(pde)) { 242 if (use_pde(pde)) {
243 poll = pde->proc_fops->poll; 243 poll = pde->proc_fops->poll;
244 if (poll) 244 if (poll)
diff --git a/fs/proc/kmsg.c b/fs/proc/kmsg.c
index e0f8774acd65..f0bfb45c3f9f 100644
--- a/fs/proc/kmsg.c
+++ b/fs/proc/kmsg.c
@@ -40,7 +40,7 @@ static ssize_t kmsg_read(struct file *file, char __user *buf,
40 return do_syslog(SYSLOG_ACTION_READ, buf, count, SYSLOG_FROM_PROC); 40 return do_syslog(SYSLOG_ACTION_READ, buf, count, SYSLOG_FROM_PROC);
41} 41}
42 42
43static unsigned int kmsg_poll(struct file *file, poll_table *wait) 43static __poll_t kmsg_poll(struct file *file, poll_table *wait)
44{ 44{
45 poll_wait(file, &log_wait, wait); 45 poll_wait(file, &log_wait, wait);
46 if (do_syslog(SYSLOG_ACTION_SIZE_UNREAD, NULL, 0, SYSLOG_FROM_PROC)) 46 if (do_syslog(SYSLOG_ACTION_SIZE_UNREAD, NULL, 0, SYSLOG_FROM_PROC))
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index c5cbbdff3c3d..63325377621a 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -630,12 +630,12 @@ static int proc_sys_open(struct inode *inode, struct file *filp)
630 return 0; 630 return 0;
631} 631}
632 632
633static unsigned int proc_sys_poll(struct file *filp, poll_table *wait) 633static __poll_t proc_sys_poll(struct file *filp, poll_table *wait)
634{ 634{
635 struct inode *inode = file_inode(filp); 635 struct inode *inode = file_inode(filp);
636 struct ctl_table_header *head = grab_header(inode); 636 struct ctl_table_header *head = grab_header(inode);
637 struct ctl_table *table = PROC_I(inode)->sysctl_entry; 637 struct ctl_table *table = PROC_I(inode)->sysctl_entry;
638 unsigned int ret = DEFAULT_POLLMASK; 638 __poll_t ret = DEFAULT_POLLMASK;
639 unsigned long event; 639 unsigned long event;
640 640
641 /* sysctl was unregistered */ 641 /* sysctl was unregistered */
diff --git a/fs/proc_namespace.c b/fs/proc_namespace.c
index b786840facd9..c8528d587e09 100644
--- a/fs/proc_namespace.c
+++ b/fs/proc_namespace.c
@@ -18,12 +18,12 @@
18#include "pnode.h" 18#include "pnode.h"
19#include "internal.h" 19#include "internal.h"
20 20
21static unsigned mounts_poll(struct file *file, poll_table *wait) 21static __poll_t mounts_poll(struct file *file, poll_table *wait)
22{ 22{
23 struct seq_file *m = file->private_data; 23 struct seq_file *m = file->private_data;
24 struct proc_mounts *p = m->private; 24 struct proc_mounts *p = m->private;
25 struct mnt_namespace *ns = p->ns; 25 struct mnt_namespace *ns = p->ns;
26 unsigned res = POLLIN | POLLRDNORM; 26 __poll_t res = POLLIN | POLLRDNORM;
27 int event; 27 int event;
28 28
29 poll_wait(file, &p->ns->poll, wait); 29 poll_wait(file, &p->ns->poll, wait);
diff --git a/fs/select.c b/fs/select.c
index 6de493bb42a4..ec14171dd78a 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -212,7 +212,7 @@ static int pollwake(wait_queue_entry_t *wait, unsigned mode, int sync, void *key
212 struct poll_table_entry *entry; 212 struct poll_table_entry *entry;
213 213
214 entry = container_of(wait, struct poll_table_entry, wait); 214 entry = container_of(wait, struct poll_table_entry, wait);
215 if (key && !((unsigned long)key & entry->key)) 215 if (key && !(key_to_poll(key) & entry->key))
216 return 0; 216 return 0;
217 return __pollwake(wait, mode, sync, key); 217 return __pollwake(wait, mode, sync, key);
218} 218}
@@ -438,7 +438,7 @@ get_max:
438 438
439static inline void wait_key_set(poll_table *wait, unsigned long in, 439static inline void wait_key_set(poll_table *wait, unsigned long in,
440 unsigned long out, unsigned long bit, 440 unsigned long out, unsigned long bit,
441 unsigned int ll_flag) 441 __poll_t ll_flag)
442{ 442{
443 wait->_key = POLLEX_SET | ll_flag; 443 wait->_key = POLLEX_SET | ll_flag;
444 if (in & bit) 444 if (in & bit)
@@ -454,7 +454,7 @@ static int do_select(int n, fd_set_bits *fds, struct timespec64 *end_time)
454 poll_table *wait; 454 poll_table *wait;
455 int retval, i, timed_out = 0; 455 int retval, i, timed_out = 0;
456 u64 slack = 0; 456 u64 slack = 0;
457 unsigned int busy_flag = net_busy_loop_on() ? POLL_BUSY_LOOP : 0; 457 __poll_t busy_flag = net_busy_loop_on() ? POLL_BUSY_LOOP : 0;
458 unsigned long busy_start = 0; 458 unsigned long busy_start = 0;
459 459
460 rcu_read_lock(); 460 rcu_read_lock();
@@ -484,8 +484,9 @@ static int do_select(int n, fd_set_bits *fds, struct timespec64 *end_time)
484 rinp = fds->res_in; routp = fds->res_out; rexp = fds->res_ex; 484 rinp = fds->res_in; routp = fds->res_out; rexp = fds->res_ex;
485 485
486 for (i = 0; i < n; ++rinp, ++routp, ++rexp) { 486 for (i = 0; i < n; ++rinp, ++routp, ++rexp) {
487 unsigned long in, out, ex, all_bits, bit = 1, mask, j; 487 unsigned long in, out, ex, all_bits, bit = 1, j;
488 unsigned long res_in = 0, res_out = 0, res_ex = 0; 488 unsigned long res_in = 0, res_out = 0, res_ex = 0;
489 __poll_t mask;
489 490
490 in = *inp++; out = *outp++; ex = *exp++; 491 in = *inp++; out = *outp++; ex = *exp++;
491 all_bits = in | out | ex; 492 all_bits = in | out | ex;
@@ -802,11 +803,11 @@ struct poll_list {
802 * pwait poll_table will be used by the fd-provided poll handler for waiting, 803 * pwait poll_table will be used by the fd-provided poll handler for waiting,
803 * if pwait->_qproc is non-NULL. 804 * if pwait->_qproc is non-NULL.
804 */ 805 */
805static inline unsigned int do_pollfd(struct pollfd *pollfd, poll_table *pwait, 806static inline __poll_t do_pollfd(struct pollfd *pollfd, poll_table *pwait,
806 bool *can_busy_poll, 807 bool *can_busy_poll,
807 unsigned int busy_flag) 808 __poll_t busy_flag)
808{ 809{
809 unsigned int mask; 810 __poll_t mask;
810 int fd; 811 int fd;
811 812
812 mask = 0; 813 mask = 0;
@@ -815,20 +816,24 @@ static inline unsigned int do_pollfd(struct pollfd *pollfd, poll_table *pwait,
815 struct fd f = fdget(fd); 816 struct fd f = fdget(fd);
816 mask = POLLNVAL; 817 mask = POLLNVAL;
817 if (f.file) { 818 if (f.file) {
819 /* userland u16 ->events contains POLL... bitmap */
820 __poll_t filter = demangle_poll(pollfd->events) |
821 POLLERR | POLLHUP;
818 mask = DEFAULT_POLLMASK; 822 mask = DEFAULT_POLLMASK;
819 if (f.file->f_op->poll) { 823 if (f.file->f_op->poll) {
820 pwait->_key = pollfd->events|POLLERR|POLLHUP; 824 pwait->_key = filter;
821 pwait->_key |= busy_flag; 825 pwait->_key |= busy_flag;
822 mask = f.file->f_op->poll(f.file, pwait); 826 mask = f.file->f_op->poll(f.file, pwait);
823 if (mask & busy_flag) 827 if (mask & busy_flag)
824 *can_busy_poll = true; 828 *can_busy_poll = true;
825 } 829 }
826 /* Mask out unneeded events. */ 830 /* Mask out unneeded events. */
827 mask &= pollfd->events | POLLERR | POLLHUP; 831 mask &= filter;
828 fdput(f); 832 fdput(f);
829 } 833 }
830 } 834 }
831 pollfd->revents = mask; 835 /* ... and so does ->revents */
836 pollfd->revents = mangle_poll(mask);
832 837
833 return mask; 838 return mask;
834} 839}
@@ -840,7 +845,7 @@ static int do_poll(struct poll_list *list, struct poll_wqueues *wait,
840 ktime_t expire, *to = NULL; 845 ktime_t expire, *to = NULL;
841 int timed_out = 0, count = 0; 846 int timed_out = 0, count = 0;
842 u64 slack = 0; 847 u64 slack = 0;
843 unsigned int busy_flag = net_busy_loop_on() ? POLL_BUSY_LOOP : 0; 848 __poll_t busy_flag = net_busy_loop_on() ? POLL_BUSY_LOOP : 0;
844 unsigned long busy_start = 0; 849 unsigned long busy_start = 0;
845 850
846 /* Optimise the no-wait case */ 851 /* Optimise the no-wait case */
diff --git a/fs/signalfd.c b/fs/signalfd.c
index 5f1ff8756595..31e923bec99a 100644
--- a/fs/signalfd.c
+++ b/fs/signalfd.c
@@ -58,10 +58,10 @@ static int signalfd_release(struct inode *inode, struct file *file)
58 return 0; 58 return 0;
59} 59}
60 60
61static unsigned int signalfd_poll(struct file *file, poll_table *wait) 61static __poll_t signalfd_poll(struct file *file, poll_table *wait)
62{ 62{
63 struct signalfd_ctx *ctx = file->private_data; 63 struct signalfd_ctx *ctx = file->private_data;
64 unsigned int events = 0; 64 __poll_t events = 0;
65 65
66 poll_wait(file, &current->sighand->signalfd_wqh, wait); 66 poll_wait(file, &current->sighand->signalfd_wqh, wait);
67 67
diff --git a/fs/timerfd.c b/fs/timerfd.c
index 040612ec9598..0510717f3a53 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -227,10 +227,10 @@ static int timerfd_release(struct inode *inode, struct file *file)
227 return 0; 227 return 0;
228} 228}
229 229
230static unsigned int timerfd_poll(struct file *file, poll_table *wait) 230static __poll_t timerfd_poll(struct file *file, poll_table *wait)
231{ 231{
232 struct timerfd_ctx *ctx = file->private_data; 232 struct timerfd_ctx *ctx = file->private_data;
233 unsigned int events = 0; 233 __poll_t events = 0;
234 unsigned long flags; 234 unsigned long flags;
235 235
236 poll_wait(file, &ctx->wqh, wait); 236 poll_wait(file, &ctx->wqh, wait);
diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
index 41a75f9f23fd..743eaa646898 100644
--- a/fs/userfaultfd.c
+++ b/fs/userfaultfd.c
@@ -937,10 +937,10 @@ static inline struct userfaultfd_wait_queue *find_userfault_evt(
937 return find_userfault_in(&ctx->event_wqh); 937 return find_userfault_in(&ctx->event_wqh);
938} 938}
939 939
940static unsigned int userfaultfd_poll(struct file *file, poll_table *wait) 940static __poll_t userfaultfd_poll(struct file *file, poll_table *wait)
941{ 941{
942 struct userfaultfd_ctx *ctx = file->private_data; 942 struct userfaultfd_ctx *ctx = file->private_data;
943 unsigned int ret; 943 __poll_t ret;
944 944
945 poll_wait(file, &ctx->fd_wqh, wait); 945 poll_wait(file, &ctx->fd_wqh, wait);
946 946
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h
index f38227a78eae..482461d8931d 100644
--- a/include/crypto/if_alg.h
+++ b/include/crypto/if_alg.h
@@ -245,7 +245,7 @@ ssize_t af_alg_sendpage(struct socket *sock, struct page *page,
245 int offset, size_t size, int flags); 245 int offset, size_t size, int flags);
246void af_alg_free_resources(struct af_alg_async_req *areq); 246void af_alg_free_resources(struct af_alg_async_req *areq);
247void af_alg_async_cb(struct crypto_async_request *_req, int err); 247void af_alg_async_cb(struct crypto_async_request *_req, int err);
248unsigned int af_alg_poll(struct file *file, struct socket *sock, 248__poll_t af_alg_poll(struct file *file, struct socket *sock,
249 poll_table *wait); 249 poll_table *wait);
250struct af_alg_async_req *af_alg_alloc_areq(struct sock *sk, 250struct af_alg_async_req *af_alg_alloc_areq(struct sock *sk,
251 unsigned int areqlen); 251 unsigned int areqlen);
diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
index 0e0c868451a5..5176c3797680 100644
--- a/include/drm/drm_file.h
+++ b/include/drm/drm_file.h
@@ -364,7 +364,7 @@ int drm_open(struct inode *inode, struct file *filp);
364ssize_t drm_read(struct file *filp, char __user *buffer, 364ssize_t drm_read(struct file *filp, char __user *buffer,
365 size_t count, loff_t *offset); 365 size_t count, loff_t *offset);
366int drm_release(struct inode *inode, struct file *filp); 366int drm_release(struct inode *inode, struct file *filp);
367unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); 367__poll_t drm_poll(struct file *filp, struct poll_table_struct *wait);
368int drm_event_reserve_init_locked(struct drm_device *dev, 368int drm_event_reserve_init_locked(struct drm_device *dev,
369 struct drm_file *file_priv, 369 struct drm_file *file_priv,
370 struct drm_pending_event *p, 370 struct drm_pending_event *p,
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
index 79f27d60ec66..085db2fee2d7 100644
--- a/include/linux/dma-buf.h
+++ b/include/linux/dma-buf.h
@@ -301,7 +301,7 @@ struct dma_buf {
301 struct dma_fence_cb cb; 301 struct dma_fence_cb cb;
302 wait_queue_head_t *poll; 302 wait_queue_head_t *poll;
303 303
304 unsigned long active; 304 __poll_t active;
305 } cb_excl, cb_shared; 305 } cb_excl, cb_shared;
306}; 306};
307 307
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 6804d075933e..569c51d37312 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1698,7 +1698,7 @@ struct file_operations {
1698 ssize_t (*write_iter) (struct kiocb *, struct iov_iter *); 1698 ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
1699 int (*iterate) (struct file *, struct dir_context *); 1699 int (*iterate) (struct file *, struct dir_context *);
1700 int (*iterate_shared) (struct file *, struct dir_context *); 1700 int (*iterate_shared) (struct file *, struct dir_context *);
1701 unsigned int (*poll) (struct file *, struct poll_table_struct *); 1701 __poll_t (*poll) (struct file *, struct poll_table_struct *);
1702 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); 1702 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
1703 long (*compat_ioctl) (struct file *, unsigned int, unsigned long); 1703 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
1704 int (*mmap) (struct file *, struct vm_area_struct *); 1704 int (*mmap) (struct file *, struct vm_area_struct *);
diff --git a/include/linux/net.h b/include/linux/net.h
index caeb159abda5..c2d468cb9821 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -147,7 +147,7 @@ struct proto_ops {
147 int (*getname) (struct socket *sock, 147 int (*getname) (struct socket *sock,
148 struct sockaddr *addr, 148 struct sockaddr *addr,
149 int *sockaddr_len, int peer); 149 int *sockaddr_len, int peer);
150 unsigned int (*poll) (struct file *file, struct socket *sock, 150 __poll_t (*poll) (struct file *file, struct socket *sock,
151 struct poll_table_struct *wait); 151 struct poll_table_struct *wait);
152 int (*ioctl) (struct socket *sock, unsigned int cmd, 152 int (*ioctl) (struct socket *sock, unsigned int cmd,
153 unsigned long arg); 153 unsigned long arg);
diff --git a/include/linux/poll.h b/include/linux/poll.h
index d384f12abdd5..04781a753326 100644
--- a/include/linux/poll.h
+++ b/include/linux/poll.h
@@ -37,7 +37,7 @@ typedef void (*poll_queue_proc)(struct file *, wait_queue_head_t *, struct poll_
37 */ 37 */
38typedef struct poll_table_struct { 38typedef struct poll_table_struct {
39 poll_queue_proc _qproc; 39 poll_queue_proc _qproc;
40 unsigned long _key; 40 __poll_t _key;
41} poll_table; 41} poll_table;
42 42
43static inline void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p) 43static inline void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p)
@@ -62,20 +62,20 @@ static inline bool poll_does_not_wait(const poll_table *p)
62 * to be started implicitly on poll(). You typically only want to do that 62 * to be started implicitly on poll(). You typically only want to do that
63 * if the application is actually polling for POLLIN and/or POLLOUT. 63 * if the application is actually polling for POLLIN and/or POLLOUT.
64 */ 64 */
65static inline unsigned long poll_requested_events(const poll_table *p) 65static inline __poll_t poll_requested_events(const poll_table *p)
66{ 66{
67 return p ? p->_key : ~0UL; 67 return p ? p->_key : ~(__poll_t)0;
68} 68}
69 69
70static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc) 70static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc)
71{ 71{
72 pt->_qproc = qproc; 72 pt->_qproc = qproc;
73 pt->_key = ~0UL; /* all events enabled */ 73 pt->_key = ~(__poll_t)0; /* all events enabled */
74} 74}
75 75
76struct poll_table_entry { 76struct poll_table_entry {
77 struct file *filp; 77 struct file *filp;
78 unsigned long key; 78 __poll_t key;
79 wait_queue_entry_t wait; 79 wait_queue_entry_t wait;
80 wait_queue_head_t *wait_address; 80 wait_queue_head_t *wait_address;
81}; 81};
diff --git a/include/linux/posix-clock.h b/include/linux/posix-clock.h
index 38d8225510f1..3a3bc71017d5 100644
--- a/include/linux/posix-clock.h
+++ b/include/linux/posix-clock.h
@@ -68,7 +68,7 @@ struct posix_clock_operations {
68 68
69 int (*open) (struct posix_clock *pc, fmode_t f_mode); 69 int (*open) (struct posix_clock *pc, fmode_t f_mode);
70 70
71 uint (*poll) (struct posix_clock *pc, 71 __poll_t (*poll) (struct posix_clock *pc,
72 struct file *file, poll_table *wait); 72 struct file *file, poll_table *wait);
73 73
74 int (*release) (struct posix_clock *pc); 74 int (*release) (struct posix_clock *pc);
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index 289e4d54e3e0..7d9eb39fa76a 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -96,7 +96,7 @@ __ring_buffer_alloc(unsigned long size, unsigned flags, struct lock_class_key *k
96}) 96})
97 97
98int ring_buffer_wait(struct ring_buffer *buffer, int cpu, bool full); 98int ring_buffer_wait(struct ring_buffer *buffer, int cpu, bool full);
99int ring_buffer_poll_wait(struct ring_buffer *buffer, int cpu, 99__poll_t ring_buffer_poll_wait(struct ring_buffer *buffer, int cpu,
100 struct file *filp, poll_table *poll_table); 100 struct file *filp, poll_table *poll_table);
101 101
102 102
diff --git a/include/linux/rpmsg.h b/include/linux/rpmsg.h
index 10d6ae8bbb7d..ca07366c4c33 100644
--- a/include/linux/rpmsg.h
+++ b/include/linux/rpmsg.h
@@ -157,7 +157,7 @@ int rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst);
157int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst, 157int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst,
158 void *data, int len); 158 void *data, int len);
159 159
160unsigned int rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp, 160__poll_t rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp,
161 poll_table *wait); 161 poll_table *wait);
162 162
163#else 163#else
@@ -258,7 +258,7 @@ static inline int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src,
258 return -ENXIO; 258 return -ENXIO;
259} 259}
260 260
261static inline unsigned int rpmsg_poll(struct rpmsg_endpoint *ept, 261static inline __poll_t rpmsg_poll(struct rpmsg_endpoint *ept,
262 struct file *filp, poll_table *wait) 262 struct file *filp, poll_table *wait)
263{ 263{
264 /* This shouldn't be possible */ 264 /* This shouldn't be possible */
diff --git a/include/linux/scif.h b/include/linux/scif.h
index 49a35d6edc94..7046111b8d0a 100644
--- a/include/linux/scif.h
+++ b/include/linux/scif.h
@@ -123,8 +123,8 @@ struct scif_range {
123 */ 123 */
124struct scif_pollepd { 124struct scif_pollepd {
125 scif_epd_t epd; 125 scif_epd_t epd;
126 short events; 126 __poll_t events;
127 short revents; 127 __poll_t revents;
128}; 128};
129 129
130/** 130/**
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index a38c80e9f91e..a87e43d16f44 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -3241,7 +3241,7 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags,
3241 int *peeked, int *off, int *err); 3241 int *peeked, int *off, int *err);
3242struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock, 3242struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock,
3243 int *err); 3243 int *err);
3244unsigned int datagram_poll(struct file *file, struct socket *sock, 3244__poll_t datagram_poll(struct file *file, struct socket *sock,
3245 struct poll_table_struct *wait); 3245 struct poll_table_struct *wait);
3246int skb_copy_datagram_iter(const struct sk_buff *from, int offset, 3246int skb_copy_datagram_iter(const struct sk_buff *from, int offset,
3247 struct iov_iter *to, int size); 3247 struct iov_iter *to, int size);
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index 3bc5144b1c7e..1ef64d4ad887 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -187,7 +187,7 @@ struct tty_ldisc_ops {
187 long (*compat_ioctl)(struct tty_struct *tty, struct file *file, 187 long (*compat_ioctl)(struct tty_struct *tty, struct file *file,
188 unsigned int cmd, unsigned long arg); 188 unsigned int cmd, unsigned long arg);
189 void (*set_termios)(struct tty_struct *tty, struct ktermios *old); 189 void (*set_termios)(struct tty_struct *tty, struct ktermios *old);
190 unsigned int (*poll)(struct tty_struct *, struct file *, 190 __poll_t (*poll)(struct tty_struct *, struct file *,
191 struct poll_table_struct *); 191 struct poll_table_struct *);
192 int (*hangup)(struct tty_struct *tty); 192 int (*hangup)(struct tty_struct *tty);
193 193
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 158715445ffb..55a611486bac 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -206,14 +206,16 @@ void __wake_up_sync(struct wait_queue_head *wq_head, unsigned int mode, int nr);
206/* 206/*
207 * Wakeup macros to be used to report events to the targets. 207 * Wakeup macros to be used to report events to the targets.
208 */ 208 */
209#define poll_to_key(m) ((void *)(__force uintptr_t)(__poll_t)(m))
210#define key_to_poll(m) ((__force __poll_t)(uintptr_t)(void *)(m))
209#define wake_up_poll(x, m) \ 211#define wake_up_poll(x, m) \
210 __wake_up(x, TASK_NORMAL, 1, (void *) (m)) 212 __wake_up(x, TASK_NORMAL, 1, poll_to_key(m))
211#define wake_up_locked_poll(x, m) \ 213#define wake_up_locked_poll(x, m) \
212 __wake_up_locked_key((x), TASK_NORMAL, (void *) (m)) 214 __wake_up_locked_key((x), TASK_NORMAL, poll_to_key(m))
213#define wake_up_interruptible_poll(x, m) \ 215#define wake_up_interruptible_poll(x, m) \
214 __wake_up(x, TASK_INTERRUPTIBLE, 1, (void *) (m)) 216 __wake_up(x, TASK_INTERRUPTIBLE, 1, poll_to_key(m))
215#define wake_up_interruptible_sync_poll(x, m) \ 217#define wake_up_interruptible_sync_poll(x, m) \
216 __wake_up_sync_key((x), TASK_INTERRUPTIBLE, 1, (void *) (m)) 218 __wake_up_sync_key((x), TASK_INTERRUPTIBLE, 1, poll_to_key(m))
217 219
218#define ___wait_cond_timeout(condition) \ 220#define ___wait_cond_timeout(condition) \
219({ \ 221({ \
diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h
index 857da67bd931..d9c143d17f70 100644
--- a/include/media/lirc_dev.h
+++ b/include/media/lirc_dev.h
@@ -185,7 +185,7 @@ void *lirc_get_pdata(struct file *file);
185 */ 185 */
186int lirc_dev_fop_open(struct inode *inode, struct file *file); 186int lirc_dev_fop_open(struct inode *inode, struct file *file);
187int lirc_dev_fop_close(struct inode *inode, struct file *file); 187int lirc_dev_fop_close(struct inode *inode, struct file *file);
188unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait); 188__poll_t lirc_dev_fop_poll(struct file *file, poll_table *wait);
189long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg); 189long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
190ssize_t lirc_dev_fop_read(struct file *file, char __user *buffer, size_t length, 190ssize_t lirc_dev_fop_read(struct file *file, char __user *buffer, size_t length,
191 loff_t *ppos); 191 loff_t *ppos);
diff --git a/include/media/media-devnode.h b/include/media/media-devnode.h
index 511615d3bf6f..dc2f64e1b08f 100644
--- a/include/media/media-devnode.h
+++ b/include/media/media-devnode.h
@@ -56,7 +56,7 @@ struct media_file_operations {
56 struct module *owner; 56 struct module *owner;
57 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); 57 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
58 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); 58 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
59 unsigned int (*poll) (struct file *, struct poll_table_struct *); 59 __poll_t (*poll) (struct file *, struct poll_table_struct *);
60 long (*ioctl) (struct file *, unsigned int, unsigned long); 60 long (*ioctl) (struct file *, unsigned int, unsigned long);
61 long (*compat_ioctl) (struct file *, unsigned int, unsigned long); 61 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
62 int (*open) (struct file *); 62 int (*open) (struct file *);
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 4d8cb0796bc6..b7e42a1b0910 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -117,7 +117,7 @@ struct soc_camera_host_ops {
117 int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *); 117 int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *);
118 int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *); 118 int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *);
119 int (*enum_framesizes)(struct soc_camera_device *, struct v4l2_frmsizeenum *); 119 int (*enum_framesizes)(struct soc_camera_device *, struct v4l2_frmsizeenum *);
120 unsigned int (*poll)(struct file *, poll_table *); 120 __poll_t (*poll)(struct file *, poll_table *);
121}; 121};
122 122
123#define SOCAM_SENSOR_INVERT_PCLK (1 << 0) 123#define SOCAM_SENSOR_INVERT_PCLK (1 << 0)
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index dacfe54057f8..a9ced6bbee55 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -1037,7 +1037,7 @@ int v4l2_ctrl_subscribe_event(struct v4l2_fh *fh,
1037 * @file: pointer to struct file 1037 * @file: pointer to struct file
1038 * @wait: pointer to struct poll_table_struct 1038 * @wait: pointer to struct poll_table_struct
1039 */ 1039 */
1040unsigned int v4l2_ctrl_poll(struct file *file, struct poll_table_struct *wait); 1040__poll_t v4l2_ctrl_poll(struct file *file, struct poll_table_struct *wait);
1041 1041
1042/* Helpers for ioctl_ops */ 1042/* Helpers for ioctl_ops */
1043 1043
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 28a686eb7d09..fa99f6f66712 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -152,7 +152,7 @@ struct v4l2_file_operations {
152 struct module *owner; 152 struct module *owner;
153 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); 153 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
154 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); 154 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
155 unsigned int (*poll) (struct file *, struct poll_table_struct *); 155 __poll_t (*poll) (struct file *, struct poll_table_struct *);
156 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); 156 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
157#ifdef CONFIG_COMPAT 157#ifdef CONFIG_COMPAT
158 long (*compat_ioctl32) (struct file *, unsigned int, unsigned long); 158 long (*compat_ioctl32) (struct file *, unsigned int, unsigned long);
diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h
index e157d5c9b224..3d07ba3a8262 100644
--- a/include/media/v4l2-mem2mem.h
+++ b/include/media/v4l2-mem2mem.h
@@ -297,7 +297,7 @@ int v4l2_m2m_streamoff(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
297 * indicate that a non-blocking write can be performed, while read will be 297 * indicate that a non-blocking write can be performed, while read will be
298 * returned in case of the destination queue. 298 * returned in case of the destination queue.
299 */ 299 */
300unsigned int v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, 300__poll_t v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
301 struct poll_table_struct *wait); 301 struct poll_table_struct *wait);
302 302
303/** 303/**
@@ -601,7 +601,7 @@ int v4l2_m2m_ioctl_streamon(struct file *file, void *fh,
601int v4l2_m2m_ioctl_streamoff(struct file *file, void *fh, 601int v4l2_m2m_ioctl_streamoff(struct file *file, void *fh,
602 enum v4l2_buf_type type); 602 enum v4l2_buf_type type);
603int v4l2_m2m_fop_mmap(struct file *file, struct vm_area_struct *vma); 603int v4l2_m2m_fop_mmap(struct file *file, struct vm_area_struct *vma);
604unsigned int v4l2_m2m_fop_poll(struct file *file, poll_table *wait); 604__poll_t v4l2_m2m_fop_poll(struct file *file, poll_table *wait);
605 605
606#endif /* _MEDIA_V4L2_MEM2MEM_H */ 606#endif /* _MEDIA_V4L2_MEM2MEM_H */
607 607
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h
index d760aa73ebbb..0bda0adc744f 100644
--- a/include/media/videobuf-core.h
+++ b/include/media/videobuf-core.h
@@ -219,7 +219,7 @@ ssize_t videobuf_read_stream(struct videobuf_queue *q,
219ssize_t videobuf_read_one(struct videobuf_queue *q, 219ssize_t videobuf_read_one(struct videobuf_queue *q,
220 char __user *data, size_t count, loff_t *ppos, 220 char __user *data, size_t count, loff_t *ppos,
221 int nonblocking); 221 int nonblocking);
222unsigned int videobuf_poll_stream(struct file *file, 222__poll_t videobuf_poll_stream(struct file *file,
223 struct videobuf_queue *q, 223 struct videobuf_queue *q,
224 poll_table *wait); 224 poll_table *wait);
225 225
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index ef9b64398c8c..e55efc62a950 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -871,7 +871,7 @@ unsigned long vb2_get_unmapped_area(struct vb2_queue *q,
871 * The return values from this function are intended to be directly returned 871 * The return values from this function are intended to be directly returned
872 * from poll handler in driver. 872 * from poll handler in driver.
873 */ 873 */
874unsigned int vb2_core_poll(struct vb2_queue *q, struct file *file, 874__poll_t vb2_core_poll(struct vb2_queue *q, struct file *file,
875 poll_table *wait); 875 poll_table *wait);
876 876
877size_t vb2_read(struct vb2_queue *q, char __user *data, size_t count, 877size_t vb2_read(struct vb2_queue *q, char __user *data, size_t count,
diff --git a/include/media/videobuf2-v4l2.h b/include/media/videobuf2-v4l2.h
index 036127c54bbf..c2fa55657440 100644
--- a/include/media/videobuf2-v4l2.h
+++ b/include/media/videobuf2-v4l2.h
@@ -226,8 +226,7 @@ void vb2_queue_release(struct vb2_queue *q);
226 * The return values from this function are intended to be directly returned 226 * The return values from this function are intended to be directly returned
227 * from poll handler in driver. 227 * from poll handler in driver.
228 */ 228 */
229unsigned int vb2_poll(struct vb2_queue *q, struct file *file, 229__poll_t vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait);
230 poll_table *wait);
231 230
232/* 231/*
233 * The following functions are not part of the vb2 core API, but are simple 232 * The following functions are not part of the vb2 core API, but are simple
@@ -262,7 +261,7 @@ ssize_t vb2_fop_write(struct file *file, const char __user *buf,
262 size_t count, loff_t *ppos); 261 size_t count, loff_t *ppos);
263ssize_t vb2_fop_read(struct file *file, char __user *buf, 262ssize_t vb2_fop_read(struct file *file, char __user *buf,
264 size_t count, loff_t *ppos); 263 size_t count, loff_t *ppos);
265unsigned int vb2_fop_poll(struct file *file, poll_table *wait); 264__poll_t vb2_fop_poll(struct file *file, poll_table *wait);
266#ifndef CONFIG_MMU 265#ifndef CONFIG_MMU
267unsigned long vb2_fop_get_unmapped_area(struct file *file, unsigned long addr, 266unsigned long vb2_fop_get_unmapped_area(struct file *file, unsigned long addr,
268 unsigned long len, unsigned long pgoff, unsigned long flags); 267 unsigned long len, unsigned long pgoff, unsigned long flags);
diff --git a/include/misc/cxl.h b/include/misc/cxl.h
index 480d50a0b8ba..b712be544f8c 100644
--- a/include/misc/cxl.h
+++ b/include/misc/cxl.h
@@ -267,7 +267,7 @@ int cxl_fd_open(struct inode *inode, struct file *file);
267int cxl_fd_release(struct inode *inode, struct file *file); 267int cxl_fd_release(struct inode *inode, struct file *file);
268long cxl_fd_ioctl(struct file *file, unsigned int cmd, unsigned long arg); 268long cxl_fd_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
269int cxl_fd_mmap(struct file *file, struct vm_area_struct *vm); 269int cxl_fd_mmap(struct file *file, struct vm_area_struct *vm);
270unsigned int cxl_fd_poll(struct file *file, struct poll_table_struct *poll); 270__poll_t cxl_fd_poll(struct file *file, struct poll_table_struct *poll);
271ssize_t cxl_fd_read(struct file *file, char __user *buf, size_t count, 271ssize_t cxl_fd_read(struct file *file, char __user *buf, size_t count,
272 loff_t *off); 272 loff_t *off);
273 273
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index e89cff0c4c23..ec9d6bc65855 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -271,7 +271,7 @@ int bt_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
271 int flags); 271 int flags);
272int bt_sock_stream_recvmsg(struct socket *sock, struct msghdr *msg, 272int bt_sock_stream_recvmsg(struct socket *sock, struct msghdr *msg,
273 size_t len, int flags); 273 size_t len, int flags);
274uint bt_sock_poll(struct file *file, struct socket *sock, poll_table *wait); 274__poll_t bt_sock_poll(struct file *file, struct socket *sock, poll_table *wait);
275int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); 275int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
276int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); 276int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo);
277int bt_sock_wait_ready(struct sock *sk, unsigned long flags); 277int bt_sock_wait_ready(struct sock *sk, unsigned long flags);
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
index 0358745ea059..ec72cdb5bc39 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -305,7 +305,7 @@ void inet_csk_prepare_forced_close(struct sock *sk);
305/* 305/*
306 * LISTEN is a special case for poll.. 306 * LISTEN is a special case for poll..
307 */ 307 */
308static inline unsigned int inet_csk_listen_poll(const struct sock *sk) 308static inline __poll_t inet_csk_listen_poll(const struct sock *sk)
309{ 309{
310 return !reqsk_queue_empty(&inet_csk(sk)->icsk_accept_queue) ? 310 return !reqsk_queue_empty(&inet_csk(sk)->icsk_accept_queue) ?
311 (POLLIN | POLLRDNORM) : 0; 311 (POLLIN | POLLRDNORM) : 0;
diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h
index 070e93a17c59..f4c21b5a1242 100644
--- a/include/net/iucv/af_iucv.h
+++ b/include/net/iucv/af_iucv.h
@@ -153,7 +153,7 @@ struct iucv_sock_list {
153 atomic_t autobind_name; 153 atomic_t autobind_name;
154}; 154};
155 155
156unsigned int iucv_sock_poll(struct file *file, struct socket *sock, 156__poll_t iucv_sock_poll(struct file *file, struct socket *sock,
157 poll_table *wait); 157 poll_table *wait);
158void iucv_sock_link(struct iucv_sock_list *l, struct sock *s); 158void iucv_sock_link(struct iucv_sock_list *l, struct sock *s);
159void iucv_sock_unlink(struct iucv_sock_list *l, struct sock *s); 159void iucv_sock_unlink(struct iucv_sock_list *l, struct sock *s);
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 906a9c0efa71..608d123ef25f 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -107,7 +107,7 @@ int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb);
107int sctp_inet_listen(struct socket *sock, int backlog); 107int sctp_inet_listen(struct socket *sock, int backlog);
108void sctp_write_space(struct sock *sk); 108void sctp_write_space(struct sock *sk);
109void sctp_data_ready(struct sock *sk); 109void sctp_data_ready(struct sock *sk);
110unsigned int sctp_poll(struct file *file, struct socket *sock, 110__poll_t sctp_poll(struct file *file, struct socket *sock,
111 poll_table *wait); 111 poll_table *wait);
112void sctp_sock_rfree(struct sk_buff *skb); 112void sctp_sock_rfree(struct sk_buff *skb);
113void sctp_copy_sock(struct sock *newsk, struct sock *sk, 113void sctp_copy_sock(struct sock *newsk, struct sock *sk,
diff --git a/include/net/sock.h b/include/net/sock.h
index c4a424fe6fdd..c47c635c9d19 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1581,7 +1581,7 @@ int sock_no_connect(struct socket *, struct sockaddr *, int, int);
1581int sock_no_socketpair(struct socket *, struct socket *); 1581int sock_no_socketpair(struct socket *, struct socket *);
1582int sock_no_accept(struct socket *, struct socket *, int, bool); 1582int sock_no_accept(struct socket *, struct socket *, int, bool);
1583int sock_no_getname(struct socket *, struct sockaddr *, int *, int); 1583int sock_no_getname(struct socket *, struct sockaddr *, int *, int);
1584unsigned int sock_no_poll(struct file *, struct socket *, 1584__poll_t sock_no_poll(struct file *, struct socket *,
1585 struct poll_table_struct *); 1585 struct poll_table_struct *);
1586int sock_no_ioctl(struct socket *, unsigned int, unsigned long); 1586int sock_no_ioctl(struct socket *, unsigned int, unsigned long);
1587int sock_no_listen(struct socket *, int); 1587int sock_no_listen(struct socket *, int);
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 6da880d2f022..50b21a49d870 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -387,7 +387,7 @@ bool tcp_peer_is_proven(struct request_sock *req, struct dst_entry *dst);
387void tcp_close(struct sock *sk, long timeout); 387void tcp_close(struct sock *sk, long timeout);
388void tcp_init_sock(struct sock *sk); 388void tcp_init_sock(struct sock *sk);
389void tcp_init_transfer(struct sock *sk, int bpf_op); 389void tcp_init_transfer(struct sock *sk, int bpf_op);
390unsigned int tcp_poll(struct file *file, struct socket *sock, 390__poll_t tcp_poll(struct file *file, struct socket *sock,
391 struct poll_table_struct *wait); 391 struct poll_table_struct *wait);
392int tcp_getsockopt(struct sock *sk, int level, int optname, 392int tcp_getsockopt(struct sock *sk, int level, int optname,
393 char __user *optval, int __user *optlen); 393 char __user *optval, int __user *optlen);
diff --git a/include/net/udp.h b/include/net/udp.h
index 6c759c8594e2..850a8e581cce 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -275,7 +275,7 @@ int udp_ioctl(struct sock *sk, int cmd, unsigned long arg);
275int udp_init_sock(struct sock *sk); 275int udp_init_sock(struct sock *sk);
276int __udp_disconnect(struct sock *sk, int flags); 276int __udp_disconnect(struct sock *sk, int flags);
277int udp_disconnect(struct sock *sk, int flags); 277int udp_disconnect(struct sock *sk, int flags);
278unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait); 278__poll_t udp_poll(struct file *file, struct socket *sock, poll_table *wait);
279struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb, 279struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb,
280 netdev_features_t features, 280 netdev_features_t features,
281 bool is_ipv6); 281 bool is_ipv6);
diff --git a/include/sound/hwdep.h b/include/sound/hwdep.h
index ab9fcb2f97f0..afeca593188a 100644
--- a/include/sound/hwdep.h
+++ b/include/sound/hwdep.h
@@ -37,7 +37,7 @@ struct snd_hwdep_ops {
37 long count, loff_t *offset); 37 long count, loff_t *offset);
38 int (*open)(struct snd_hwdep *hw, struct file * file); 38 int (*open)(struct snd_hwdep *hw, struct file * file);
39 int (*release)(struct snd_hwdep *hw, struct file * file); 39 int (*release)(struct snd_hwdep *hw, struct file * file);
40 unsigned int (*poll)(struct snd_hwdep *hw, struct file *file, 40 __poll_t (*poll)(struct snd_hwdep *hw, struct file *file,
41 poll_table *wait); 41 poll_table *wait);
42 int (*ioctl)(struct snd_hwdep *hw, struct file *file, 42 int (*ioctl)(struct snd_hwdep *hw, struct file *file,
43 unsigned int cmd, unsigned long arg); 43 unsigned int cmd, unsigned long arg);
diff --git a/include/sound/info.h b/include/sound/info.h
index 67390ee846aa..becdf66d2825 100644
--- a/include/sound/info.h
+++ b/include/sound/info.h
@@ -62,7 +62,7 @@ struct snd_info_entry_ops {
62 loff_t (*llseek)(struct snd_info_entry *entry, 62 loff_t (*llseek)(struct snd_info_entry *entry,
63 void *file_private_data, struct file *file, 63 void *file_private_data, struct file *file,
64 loff_t offset, int orig); 64 loff_t offset, int orig);
65 unsigned int (*poll)(struct snd_info_entry *entry, 65 __poll_t (*poll)(struct snd_info_entry *entry,
66 void *file_private_data, struct file *file, 66 void *file_private_data, struct file *file,
67 poll_table *wait); 67 poll_table *wait);
68 int (*ioctl)(struct snd_info_entry *entry, void *file_private_data, 68 int (*ioctl)(struct snd_info_entry *entry, void *file_private_data,
diff --git a/include/uapi/asm-generic/poll.h b/include/uapi/asm-generic/poll.h
index fefb3d2c3fac..639fade14b23 100644
--- a/include/uapi/asm-generic/poll.h
+++ b/include/uapi/asm-generic/poll.h
@@ -3,35 +3,49 @@
3#define __ASM_GENERIC_POLL_H 3#define __ASM_GENERIC_POLL_H
4 4
5/* These are specified by iBCS2 */ 5/* These are specified by iBCS2 */
6#define POLLIN 0x0001 6#define POLLIN (__force __poll_t)0x0001
7#define POLLPRI 0x0002 7#define POLLPRI (__force __poll_t)0x0002
8#define POLLOUT 0x0004 8#define POLLOUT (__force __poll_t)0x0004
9#define POLLERR 0x0008 9#define POLLERR (__force __poll_t)0x0008
10#define POLLHUP 0x0010 10#define POLLHUP (__force __poll_t)0x0010
11#define POLLNVAL 0x0020 11#define POLLNVAL (__force __poll_t)0x0020
12 12
13/* The rest seem to be more-or-less nonstandard. Check them! */ 13/* The rest seem to be more-or-less nonstandard. Check them! */
14#define POLLRDNORM 0x0040 14#define POLLRDNORM (__force __poll_t)0x0040
15#define POLLRDBAND 0x0080 15#define POLLRDBAND (__force __poll_t)0x0080
16#ifndef POLLWRNORM 16#ifndef POLLWRNORM
17#define POLLWRNORM 0x0100 17#define POLLWRNORM (__force __poll_t)0x0100
18#endif 18#endif
19#ifndef POLLWRBAND 19#ifndef POLLWRBAND
20#define POLLWRBAND 0x0200 20#define POLLWRBAND (__force __poll_t)0x0200
21#endif 21#endif
22#ifndef POLLMSG 22#ifndef POLLMSG
23#define POLLMSG 0x0400 23#define POLLMSG (__force __poll_t)0x0400
24#endif 24#endif
25#ifndef POLLREMOVE 25#ifndef POLLREMOVE
26#define POLLREMOVE 0x1000 26#define POLLREMOVE (__force __poll_t)0x1000
27#endif 27#endif
28#ifndef POLLRDHUP 28#ifndef POLLRDHUP
29#define POLLRDHUP 0x2000 29#define POLLRDHUP (__force __poll_t)0x2000
30#endif 30#endif
31 31
32#define POLLFREE 0x4000 /* currently only for epoll */ 32#define POLLFREE (__force __poll_t)0x4000 /* currently only for epoll */
33 33
34#define POLL_BUSY_LOOP 0x8000 34#define POLL_BUSY_LOOP (__force __poll_t)0x8000
35
36#ifdef __KERNEL__
37#ifndef __ARCH_HAS_MANGLED_POLL
38static inline __u16 mangle_poll(__poll_t val)
39{
40 return (__force __u16)val;
41}
42
43static inline __poll_t demangle_poll(__u16 v)
44{
45 return (__force __poll_t)v;
46}
47#endif
48#endif
35 49
36struct pollfd { 50struct pollfd {
37 int fd; 51 int fd;
diff --git a/include/uapi/linux/types.h b/include/uapi/linux/types.h
index e3d1d0c78f3c..cd4f0b897a48 100644
--- a/include/uapi/linux/types.h
+++ b/include/uapi/linux/types.h
@@ -49,5 +49,11 @@ typedef __u32 __bitwise __wsum;
49#define __aligned_be64 __be64 __attribute__((aligned(8))) 49#define __aligned_be64 __be64 __attribute__((aligned(8)))
50#define __aligned_le64 __le64 __attribute__((aligned(8))) 50#define __aligned_le64 __le64 __attribute__((aligned(8)))
51 51
52#ifdef __CHECK_POLL
53typedef unsigned __bitwise __poll_t;
54#else
55typedef unsigned __poll_t;
56#endif
57
52#endif /* __ASSEMBLY__ */ 58#endif /* __ASSEMBLY__ */
53#endif /* _UAPI_LINUX_TYPES_H */ 59#endif /* _UAPI_LINUX_TYPES_H */
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 17bc8b874d92..3bc5bb7d6827 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -519,10 +519,10 @@ static int mqueue_flush_file(struct file *filp, fl_owner_t id)
519 return 0; 519 return 0;
520} 520}
521 521
522static unsigned int mqueue_poll_file(struct file *filp, struct poll_table_struct *poll_tab) 522static __poll_t mqueue_poll_file(struct file *filp, struct poll_table_struct *poll_tab)
523{ 523{
524 struct mqueue_inode_info *info = MQUEUE_I(file_inode(filp)); 524 struct mqueue_inode_info *info = MQUEUE_I(file_inode(filp));
525 int retval = 0; 525 __poll_t retval = 0;
526 526
527 poll_wait(filp, &info->wait_q, poll_tab); 527 poll_wait(filp, &info->wait_q, poll_tab);
528 528
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 02f7d6e57d9e..d0d9bfb47d2e 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -4520,11 +4520,11 @@ perf_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
4520 return ret; 4520 return ret;
4521} 4521}
4522 4522
4523static unsigned int perf_poll(struct file *file, poll_table *wait) 4523static __poll_t perf_poll(struct file *file, poll_table *wait)
4524{ 4524{
4525 struct perf_event *event = file->private_data; 4525 struct perf_event *event = file->private_data;
4526 struct ring_buffer *rb; 4526 struct ring_buffer *rb;
4527 unsigned int events = POLLHUP; 4527 __poll_t events = POLLHUP;
4528 4528
4529 poll_wait(file, &event->waitq, wait); 4529 poll_wait(file, &event->waitq, wait);
4530 4530
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index b9006617710f..c2e713f6ae2e 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -920,10 +920,10 @@ static loff_t devkmsg_llseek(struct file *file, loff_t offset, int whence)
920 return ret; 920 return ret;
921} 921}
922 922
923static unsigned int devkmsg_poll(struct file *file, poll_table *wait) 923static __poll_t devkmsg_poll(struct file *file, poll_table *wait)
924{ 924{
925 struct devkmsg_user *user = file->private_data; 925 struct devkmsg_user *user = file->private_data;
926 int ret = 0; 926 __poll_t ret = 0;
927 927
928 if (!user) 928 if (!user)
929 return POLLERR|POLLNVAL; 929 return POLLERR|POLLNVAL;
diff --git a/kernel/relay.c b/kernel/relay.c
index 39a9dfc69486..41280033a4c5 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -919,9 +919,9 @@ static int relay_file_mmap(struct file *filp, struct vm_area_struct *vma)
919 * 919 *
920 * Poll implemention. 920 * Poll implemention.
921 */ 921 */
922static unsigned int relay_file_poll(struct file *filp, poll_table *wait) 922static __poll_t relay_file_poll(struct file *filp, poll_table *wait)
923{ 923{
924 unsigned int mask = 0; 924 __poll_t mask = 0;
925 struct rchan_buf *buf = filp->private_data; 925 struct rchan_buf *buf = filp->private_data;
926 926
927 if (buf->finalized) 927 if (buf->finalized)
diff --git a/kernel/time/posix-clock.c b/kernel/time/posix-clock.c
index cc91d90abd84..94ad46d50b56 100644
--- a/kernel/time/posix-clock.c
+++ b/kernel/time/posix-clock.c
@@ -68,10 +68,10 @@ static ssize_t posix_clock_read(struct file *fp, char __user *buf,
68 return err; 68 return err;
69} 69}
70 70
71static unsigned int posix_clock_poll(struct file *fp, poll_table *wait) 71static __poll_t posix_clock_poll(struct file *fp, poll_table *wait)
72{ 72{
73 struct posix_clock *clk = get_posix_clock(fp); 73 struct posix_clock *clk = get_posix_clock(fp);
74 unsigned int result = 0; 74 __poll_t result = 0;
75 75
76 if (!clk) 76 if (!clk)
77 return POLLERR; 77 return POLLERR;
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 5af2842dea96..ca6930e0d25e 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -630,7 +630,7 @@ int ring_buffer_wait(struct ring_buffer *buffer, int cpu, bool full)
630 * Returns POLLIN | POLLRDNORM if data exists in the buffers, 630 * Returns POLLIN | POLLRDNORM if data exists in the buffers,
631 * zero otherwise. 631 * zero otherwise.
632 */ 632 */
633int ring_buffer_poll_wait(struct ring_buffer *buffer, int cpu, 633__poll_t ring_buffer_poll_wait(struct ring_buffer *buffer, int cpu,
634 struct file *filp, poll_table *poll_table) 634 struct file *filp, poll_table *poll_table)
635{ 635{
636 struct ring_buffer_per_cpu *cpu_buffer; 636 struct ring_buffer_per_cpu *cpu_buffer;
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 4f3a8e24b426..32c069bbf41b 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -5616,7 +5616,7 @@ static int tracing_release_pipe(struct inode *inode, struct file *file)
5616 return 0; 5616 return 0;
5617} 5617}
5618 5618
5619static unsigned int 5619static __poll_t
5620trace_poll(struct trace_iterator *iter, struct file *filp, poll_table *poll_table) 5620trace_poll(struct trace_iterator *iter, struct file *filp, poll_table *poll_table)
5621{ 5621{
5622 struct trace_array *tr = iter->tr; 5622 struct trace_array *tr = iter->tr;
@@ -5635,7 +5635,7 @@ trace_poll(struct trace_iterator *iter, struct file *filp, poll_table *poll_tabl
5635 filp, poll_table); 5635 filp, poll_table);
5636} 5636}
5637 5637
5638static unsigned int 5638static __poll_t
5639tracing_poll_pipe(struct file *filp, poll_table *poll_table) 5639tracing_poll_pipe(struct file *filp, poll_table *poll_table)
5640{ 5640{
5641 struct trace_iterator *iter = filp->private_data; 5641 struct trace_iterator *iter = filp->private_data;
@@ -6589,7 +6589,7 @@ static int tracing_buffers_open(struct inode *inode, struct file *filp)
6589 return ret; 6589 return ret;
6590} 6590}
6591 6591
6592static unsigned int 6592static __poll_t
6593tracing_buffers_poll(struct file *filp, poll_table *poll_table) 6593tracing_buffers_poll(struct file *filp, poll_table *poll_table)
6594{ 6594{
6595 struct ftrace_buffer_info *info = filp->private_data; 6595 struct ftrace_buffer_info *info = filp->private_data;
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index ac2ffd5e02b9..9011997d8a5c 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3777,7 +3777,7 @@ static int memcg_event_wake(wait_queue_entry_t *wait, unsigned mode,
3777 struct mem_cgroup_event *event = 3777 struct mem_cgroup_event *event =
3778 container_of(wait, struct mem_cgroup_event, wait); 3778 container_of(wait, struct mem_cgroup_event, wait);
3779 struct mem_cgroup *memcg = event->memcg; 3779 struct mem_cgroup *memcg = event->memcg;
3780 unsigned long flags = (unsigned long)key; 3780 __poll_t flags = key_to_poll(key);
3781 3781
3782 if (flags & POLLHUP) { 3782 if (flags & POLLHUP) {
3783 /* 3783 /*
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 3074b02eaa09..42fe5653814a 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2697,7 +2697,7 @@ out:
2697} 2697}
2698 2698
2699#ifdef CONFIG_PROC_FS 2699#ifdef CONFIG_PROC_FS
2700static unsigned swaps_poll(struct file *file, poll_table *wait) 2700static __poll_t swaps_poll(struct file *file, poll_table *wait)
2701{ 2701{
2702 struct seq_file *seq = file->private_data; 2702 struct seq_file *seq = file->private_data;
2703 2703
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index 80f5c79053a4..d6f7f7cb79c4 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -228,32 +228,31 @@ static void p9_conn_cancel(struct p9_conn *m, int err)
228 } 228 }
229} 229}
230 230
231static int 231static __poll_t
232p9_fd_poll(struct p9_client *client, struct poll_table_struct *pt) 232p9_fd_poll(struct p9_client *client, struct poll_table_struct *pt, int *err)
233{ 233{
234 int ret, n; 234 __poll_t ret, n;
235 struct p9_trans_fd *ts = NULL; 235 struct p9_trans_fd *ts = NULL;
236 236
237 if (client && client->status == Connected) 237 if (client && client->status == Connected)
238 ts = client->trans; 238 ts = client->trans;
239 239
240 if (!ts) 240 if (!ts) {
241 return -EREMOTEIO; 241 if (err)
242 *err = -EREMOTEIO;
243 return POLLERR;
244 }
242 245
243 if (!ts->rd->f_op->poll) 246 if (!ts->rd->f_op->poll)
244 return -EIO; 247 ret = DEFAULT_POLLMASK;
245 248 else
246 if (!ts->wr->f_op->poll) 249 ret = ts->rd->f_op->poll(ts->rd, pt);
247 return -EIO;
248
249 ret = ts->rd->f_op->poll(ts->rd, pt);
250 if (ret < 0)
251 return ret;
252 250
253 if (ts->rd != ts->wr) { 251 if (ts->rd != ts->wr) {
254 n = ts->wr->f_op->poll(ts->wr, pt); 252 if (!ts->wr->f_op->poll)
255 if (n < 0) 253 n = DEFAULT_POLLMASK;
256 return n; 254 else
255 n = ts->wr->f_op->poll(ts->wr, pt);
257 ret = (ret & ~POLLOUT) | (n & ~POLLIN); 256 ret = (ret & ~POLLOUT) | (n & ~POLLIN);
258 } 257 }
259 258
@@ -298,7 +297,8 @@ static int p9_fd_read(struct p9_client *client, void *v, int len)
298 297
299static void p9_read_work(struct work_struct *work) 298static void p9_read_work(struct work_struct *work)
300{ 299{
301 int n, err; 300 __poll_t n;
301 int err;
302 struct p9_conn *m; 302 struct p9_conn *m;
303 int status = REQ_STATUS_ERROR; 303 int status = REQ_STATUS_ERROR;
304 304
@@ -398,7 +398,7 @@ end_clear:
398 if (test_and_clear_bit(Rpending, &m->wsched)) 398 if (test_and_clear_bit(Rpending, &m->wsched))
399 n = POLLIN; 399 n = POLLIN;
400 else 400 else
401 n = p9_fd_poll(m->client, NULL); 401 n = p9_fd_poll(m->client, NULL, NULL);
402 402
403 if ((n & POLLIN) && !test_and_set_bit(Rworksched, &m->wsched)) { 403 if ((n & POLLIN) && !test_and_set_bit(Rworksched, &m->wsched)) {
404 p9_debug(P9_DEBUG_TRANS, "sched read work %p\n", m); 404 p9_debug(P9_DEBUG_TRANS, "sched read work %p\n", m);
@@ -448,7 +448,8 @@ static int p9_fd_write(struct p9_client *client, void *v, int len)
448 448
449static void p9_write_work(struct work_struct *work) 449static void p9_write_work(struct work_struct *work)
450{ 450{
451 int n, err; 451 __poll_t n;
452 int err;
452 struct p9_conn *m; 453 struct p9_conn *m;
453 struct p9_req_t *req; 454 struct p9_req_t *req;
454 455
@@ -506,7 +507,7 @@ end_clear:
506 if (test_and_clear_bit(Wpending, &m->wsched)) 507 if (test_and_clear_bit(Wpending, &m->wsched))
507 n = POLLOUT; 508 n = POLLOUT;
508 else 509 else
509 n = p9_fd_poll(m->client, NULL); 510 n = p9_fd_poll(m->client, NULL, NULL);
510 511
511 if ((n & POLLOUT) && 512 if ((n & POLLOUT) &&
512 !test_and_set_bit(Wworksched, &m->wsched)) { 513 !test_and_set_bit(Wworksched, &m->wsched)) {
@@ -581,7 +582,7 @@ p9_pollwait(struct file *filp, wait_queue_head_t *wait_address, poll_table *p)
581 582
582static void p9_conn_create(struct p9_client *client) 583static void p9_conn_create(struct p9_client *client)
583{ 584{
584 int n; 585 __poll_t n;
585 struct p9_trans_fd *ts = client->trans; 586 struct p9_trans_fd *ts = client->trans;
586 struct p9_conn *m = &ts->conn; 587 struct p9_conn *m = &ts->conn;
587 588
@@ -597,7 +598,7 @@ static void p9_conn_create(struct p9_client *client)
597 INIT_LIST_HEAD(&m->poll_pending_link); 598 INIT_LIST_HEAD(&m->poll_pending_link);
598 init_poll_funcptr(&m->pt, p9_pollwait); 599 init_poll_funcptr(&m->pt, p9_pollwait);
599 600
600 n = p9_fd_poll(client, &m->pt); 601 n = p9_fd_poll(client, &m->pt, NULL);
601 if (n & POLLIN) { 602 if (n & POLLIN) {
602 p9_debug(P9_DEBUG_TRANS, "mux %p can read\n", m); 603 p9_debug(P9_DEBUG_TRANS, "mux %p can read\n", m);
603 set_bit(Rpending, &m->wsched); 604 set_bit(Rpending, &m->wsched);
@@ -617,17 +618,16 @@ static void p9_conn_create(struct p9_client *client)
617 618
618static void p9_poll_mux(struct p9_conn *m) 619static void p9_poll_mux(struct p9_conn *m)
619{ 620{
620 int n; 621 __poll_t n;
622 int err = -ECONNRESET;
621 623
622 if (m->err < 0) 624 if (m->err < 0)
623 return; 625 return;
624 626
625 n = p9_fd_poll(m->client, NULL); 627 n = p9_fd_poll(m->client, NULL, &err);
626 if (n < 0 || n & (POLLERR | POLLHUP | POLLNVAL)) { 628 if (n & (POLLERR | POLLHUP | POLLNVAL)) {
627 p9_debug(P9_DEBUG_TRANS, "error mux %p err %d\n", m, n); 629 p9_debug(P9_DEBUG_TRANS, "error mux %p err %d\n", m, n);
628 if (n >= 0) 630 p9_conn_cancel(m, err);
629 n = -ECONNRESET;
630 p9_conn_cancel(m, n);
631 } 631 }
632 632
633 if (n & POLLIN) { 633 if (n & POLLIN) {
@@ -663,7 +663,7 @@ static void p9_poll_mux(struct p9_conn *m)
663 663
664static int p9_fd_request(struct p9_client *client, struct p9_req_t *req) 664static int p9_fd_request(struct p9_client *client, struct p9_req_t *req)
665{ 665{
666 int n; 666 __poll_t n;
667 struct p9_trans_fd *ts = client->trans; 667 struct p9_trans_fd *ts = client->trans;
668 struct p9_conn *m = &ts->conn; 668 struct p9_conn *m = &ts->conn;
669 669
@@ -680,7 +680,7 @@ static int p9_fd_request(struct p9_client *client, struct p9_req_t *req)
680 if (test_and_clear_bit(Wpending, &m->wsched)) 680 if (test_and_clear_bit(Wpending, &m->wsched))
681 n = POLLOUT; 681 n = POLLOUT;
682 else 682 else
683 n = p9_fd_poll(m->client, NULL); 683 n = p9_fd_poll(m->client, NULL, NULL);
684 684
685 if (n & POLLOUT && !test_and_set_bit(Wworksched, &m->wsched)) 685 if (n & POLLOUT && !test_and_set_bit(Wworksched, &m->wsched))
686 schedule_work(&m->wq); 686 schedule_work(&m->wq);
diff --git a/net/atm/common.c b/net/atm/common.c
index 8a4f99114cd2..8f12f1c6fa14 100644
--- a/net/atm/common.c
+++ b/net/atm/common.c
@@ -648,11 +648,11 @@ out:
648 return error; 648 return error;
649} 649}
650 650
651unsigned int vcc_poll(struct file *file, struct socket *sock, poll_table *wait) 651__poll_t vcc_poll(struct file *file, struct socket *sock, poll_table *wait)
652{ 652{
653 struct sock *sk = sock->sk; 653 struct sock *sk = sock->sk;
654 struct atm_vcc *vcc; 654 struct atm_vcc *vcc;
655 unsigned int mask; 655 __poll_t mask;
656 656
657 sock_poll_wait(file, sk_sleep(sk), wait); 657 sock_poll_wait(file, sk_sleep(sk), wait);
658 mask = 0; 658 mask = 0;
diff --git a/net/atm/common.h b/net/atm/common.h
index d9d583712a91..5850649068bb 100644
--- a/net/atm/common.h
+++ b/net/atm/common.h
@@ -17,7 +17,7 @@ int vcc_connect(struct socket *sock, int itf, short vpi, int vci);
17int vcc_recvmsg(struct socket *sock, struct msghdr *msg, size_t size, 17int vcc_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
18 int flags); 18 int flags);
19int vcc_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len); 19int vcc_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len);
20unsigned int vcc_poll(struct file *file, struct socket *sock, poll_table *wait); 20__poll_t vcc_poll(struct file *file, struct socket *sock, poll_table *wait);
21int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); 21int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
22int vcc_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); 22int vcc_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
23int vcc_setsockopt(struct socket *sock, int level, int optname, 23int vcc_setsockopt(struct socket *sock, int level, int optname,
diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c
index bded31121d12..a98e0a986cef 100644
--- a/net/batman-adv/icmp_socket.c
+++ b/net/batman-adv/icmp_socket.c
@@ -292,7 +292,7 @@ out:
292 return len; 292 return len;
293} 293}
294 294
295static unsigned int batadv_socket_poll(struct file *file, poll_table *wait) 295static __poll_t batadv_socket_poll(struct file *file, poll_table *wait)
296{ 296{
297 struct batadv_socket_client *socket_client = file->private_data; 297 struct batadv_socket_client *socket_client = file->private_data;
298 298
diff --git a/net/batman-adv/log.c b/net/batman-adv/log.c
index 4ef4bde2cc2d..76451460c98d 100644
--- a/net/batman-adv/log.c
+++ b/net/batman-adv/log.c
@@ -176,7 +176,7 @@ static ssize_t batadv_log_read(struct file *file, char __user *buf,
176 return error; 176 return error;
177} 177}
178 178
179static unsigned int batadv_log_poll(struct file *file, poll_table *wait) 179static __poll_t batadv_log_poll(struct file *file, poll_table *wait)
180{ 180{
181 struct batadv_priv *bat_priv = file->private_data; 181 struct batadv_priv *bat_priv = file->private_data;
182 struct batadv_priv_debug_log *debug_log = bat_priv->debug_log; 182 struct batadv_priv_debug_log *debug_log = bat_priv->debug_log;
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
index 91e3ba280706..671b907ba678 100644
--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
@@ -421,7 +421,7 @@ out:
421} 421}
422EXPORT_SYMBOL(bt_sock_stream_recvmsg); 422EXPORT_SYMBOL(bt_sock_stream_recvmsg);
423 423
424static inline unsigned int bt_accept_poll(struct sock *parent) 424static inline __poll_t bt_accept_poll(struct sock *parent)
425{ 425{
426 struct bt_sock *s, *n; 426 struct bt_sock *s, *n;
427 struct sock *sk; 427 struct sock *sk;
@@ -437,11 +437,11 @@ static inline unsigned int bt_accept_poll(struct sock *parent)
437 return 0; 437 return 0;
438} 438}
439 439
440unsigned int bt_sock_poll(struct file *file, struct socket *sock, 440__poll_t bt_sock_poll(struct file *file, struct socket *sock,
441 poll_table *wait) 441 poll_table *wait)
442{ 442{
443 struct sock *sk = sock->sk; 443 struct sock *sk = sock->sk;
444 unsigned int mask = 0; 444 __poll_t mask = 0;
445 445
446 BT_DBG("sock %p, sk %p", sock, sk); 446 BT_DBG("sock %p, sk %p", sock, sk);
447 447
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c
index 632d5a416d97..64048cec41e0 100644
--- a/net/caif/caif_socket.c
+++ b/net/caif/caif_socket.c
@@ -934,11 +934,11 @@ static int caif_release(struct socket *sock)
934} 934}
935 935
936/* Copied from af_unix.c:unix_poll(), added CAIF tx_flow handling */ 936/* Copied from af_unix.c:unix_poll(), added CAIF tx_flow handling */
937static unsigned int caif_poll(struct file *file, 937static __poll_t caif_poll(struct file *file,
938 struct socket *sock, poll_table *wait) 938 struct socket *sock, poll_table *wait)
939{ 939{
940 struct sock *sk = sock->sk; 940 struct sock *sk = sock->sk;
941 unsigned int mask; 941 __poll_t mask;
942 struct caifsock *cf_sk = container_of(sk, struct caifsock, sk); 942 struct caifsock *cf_sk = container_of(sk, struct caifsock, sk);
943 943
944 sock_poll_wait(file, sk_sleep(sk), wait); 944 sock_poll_wait(file, sk_sleep(sk), wait);
diff --git a/net/core/datagram.c b/net/core/datagram.c
index 522873ed120b..b7d9293940b5 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -72,12 +72,10 @@ static inline int connection_based(struct sock *sk)
72static int receiver_wake_function(wait_queue_entry_t *wait, unsigned int mode, int sync, 72static int receiver_wake_function(wait_queue_entry_t *wait, unsigned int mode, int sync,
73 void *key) 73 void *key)
74{ 74{
75 unsigned long bits = (unsigned long)key;
76
77 /* 75 /*
78 * Avoid a wakeup if event not interesting for us 76 * Avoid a wakeup if event not interesting for us
79 */ 77 */
80 if (bits && !(bits & (POLLIN | POLLERR))) 78 if (key && !(key_to_poll(key) & (POLLIN | POLLERR)))
81 return 0; 79 return 0;
82 return autoremove_wake_function(wait, mode, sync, key); 80 return autoremove_wake_function(wait, mode, sync, key);
83} 81}
@@ -833,11 +831,11 @@ EXPORT_SYMBOL(skb_copy_and_csum_datagram_msg);
833 * and you use a different write policy from sock_writeable() 831 * and you use a different write policy from sock_writeable()
834 * then please supply your own write_space callback. 832 * then please supply your own write_space callback.
835 */ 833 */
836unsigned int datagram_poll(struct file *file, struct socket *sock, 834__poll_t datagram_poll(struct file *file, struct socket *sock,
837 poll_table *wait) 835 poll_table *wait)
838{ 836{
839 struct sock *sk = sock->sk; 837 struct sock *sk = sock->sk;
840 unsigned int mask; 838 __poll_t mask;
841 839
842 sock_poll_wait(file, sk_sleep(sk), wait); 840 sock_poll_wait(file, sk_sleep(sk), wait);
843 mask = 0; 841 mask = 0;
diff --git a/net/core/sock.c b/net/core/sock.c
index c0b5b2f17412..1211159718ad 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2496,7 +2496,7 @@ int sock_no_getname(struct socket *sock, struct sockaddr *saddr,
2496} 2496}
2497EXPORT_SYMBOL(sock_no_getname); 2497EXPORT_SYMBOL(sock_no_getname);
2498 2498
2499unsigned int sock_no_poll(struct file *file, struct socket *sock, poll_table *pt) 2499__poll_t sock_no_poll(struct file *file, struct socket *sock, poll_table *pt)
2500{ 2500{
2501 return 0; 2501 return 0;
2502} 2502}
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h
index 0c55ffb859bf..f91e3816806b 100644
--- a/net/dccp/dccp.h
+++ b/net/dccp/dccp.h
@@ -316,7 +316,7 @@ int dccp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock,
316 int flags, int *addr_len); 316 int flags, int *addr_len);
317void dccp_shutdown(struct sock *sk, int how); 317void dccp_shutdown(struct sock *sk, int how);
318int inet_dccp_listen(struct socket *sock, int backlog); 318int inet_dccp_listen(struct socket *sock, int backlog);
319unsigned int dccp_poll(struct file *file, struct socket *sock, 319__poll_t dccp_poll(struct file *file, struct socket *sock,
320 poll_table *wait); 320 poll_table *wait);
321int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); 321int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len);
322void dccp_req_err(struct sock *sk, u64 seq); 322void dccp_req_err(struct sock *sk, u64 seq);
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 9d43c1f40274..8b8db3d481bd 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -318,10 +318,10 @@ EXPORT_SYMBOL_GPL(dccp_disconnect);
318 * take care of normal races (between the test and the event) and we don't 318 * take care of normal races (between the test and the event) and we don't
319 * go look at any of the socket buffers directly. 319 * go look at any of the socket buffers directly.
320 */ 320 */
321unsigned int dccp_poll(struct file *file, struct socket *sock, 321__poll_t dccp_poll(struct file *file, struct socket *sock,
322 poll_table *wait) 322 poll_table *wait)
323{ 323{
324 unsigned int mask; 324 __poll_t mask;
325 struct sock *sk = sock->sk; 325 struct sock *sk = sock->sk;
326 326
327 sock_poll_wait(file, sk_sleep(sk), wait); 327 sock_poll_wait(file, sk_sleep(sk), wait);
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index 518cea17b811..9c2dde819817 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -1209,11 +1209,11 @@ static int dn_getname(struct socket *sock, struct sockaddr *uaddr,int *uaddr_len
1209} 1209}
1210 1210
1211 1211
1212static unsigned int dn_poll(struct file *file, struct socket *sock, poll_table *wait) 1212static __poll_t dn_poll(struct file *file, struct socket *sock, poll_table *wait)
1213{ 1213{
1214 struct sock *sk = sock->sk; 1214 struct sock *sk = sock->sk;
1215 struct dn_scp *scp = DN_SK(sk); 1215 struct dn_scp *scp = DN_SK(sk);
1216 int mask = datagram_poll(file, sock, wait); 1216 __poll_t mask = datagram_poll(file, sock, wait);
1217 1217
1218 if (!skb_queue_empty(&scp->other_receive_queue)) 1218 if (!skb_queue_empty(&scp->other_receive_queue))
1219 mask |= POLLRDBAND; 1219 mask |= POLLRDBAND;
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 8e053ad7cae2..1b38b4282cc9 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -493,9 +493,9 @@ static void tcp_tx_timestamp(struct sock *sk, u16 tsflags)
493 * take care of normal races (between the test and the event) and we don't 493 * take care of normal races (between the test and the event) and we don't
494 * go look at any of the socket buffers directly. 494 * go look at any of the socket buffers directly.
495 */ 495 */
496unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait) 496__poll_t tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
497{ 497{
498 unsigned int mask; 498 __poll_t mask;
499 struct sock *sk = sock->sk; 499 struct sock *sk = sock->sk;
500 const struct tcp_sock *tp = tcp_sk(sk); 500 const struct tcp_sock *tp = tcp_sk(sk);
501 int state; 501 int state;
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index e4ff25c947c5..ef45adfc0edb 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2502,9 +2502,9 @@ int compat_udp_getsockopt(struct sock *sk, int level, int optname,
2502 * but then block when reading it. Add special case code 2502 * but then block when reading it. Add special case code
2503 * to work around these arguably broken applications. 2503 * to work around these arguably broken applications.
2504 */ 2504 */
2505unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait) 2505__poll_t udp_poll(struct file *file, struct socket *sock, poll_table *wait)
2506{ 2506{
2507 unsigned int mask = datagram_poll(file, sock, wait); 2507 __poll_t mask = datagram_poll(file, sock, wait);
2508 struct sock *sk = sock->sk; 2508 struct sock *sk = sock->sk;
2509 2509
2510 if (!skb_queue_empty(&udp_sk(sk)->reader_queue)) 2510 if (!skb_queue_empty(&udp_sk(sk)->reader_queue))
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index 148533169b1d..64331158d693 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -1474,7 +1474,7 @@ done:
1474 return copied; 1474 return copied;
1475} 1475}
1476 1476
1477static inline unsigned int iucv_accept_poll(struct sock *parent) 1477static inline __poll_t iucv_accept_poll(struct sock *parent)
1478{ 1478{
1479 struct iucv_sock *isk, *n; 1479 struct iucv_sock *isk, *n;
1480 struct sock *sk; 1480 struct sock *sk;
@@ -1489,11 +1489,11 @@ static inline unsigned int iucv_accept_poll(struct sock *parent)
1489 return 0; 1489 return 0;
1490} 1490}
1491 1491
1492unsigned int iucv_sock_poll(struct file *file, struct socket *sock, 1492__poll_t iucv_sock_poll(struct file *file, struct socket *sock,
1493 poll_table *wait) 1493 poll_table *wait)
1494{ 1494{
1495 struct sock *sk = sock->sk; 1495 struct sock *sk = sock->sk;
1496 unsigned int mask = 0; 1496 __poll_t mask = 0;
1497 1497
1498 sock_poll_wait(file, sk_sleep(sk), wait); 1498 sock_poll_wait(file, sk_sleep(sk), wait);
1499 1499
diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c
index fb7afcaa3004..985909f105eb 100644
--- a/net/nfc/llcp_sock.c
+++ b/net/nfc/llcp_sock.c
@@ -531,7 +531,7 @@ static int llcp_sock_getname(struct socket *sock, struct sockaddr *uaddr,
531 return 0; 531 return 0;
532} 532}
533 533
534static inline unsigned int llcp_accept_poll(struct sock *parent) 534static inline __poll_t llcp_accept_poll(struct sock *parent)
535{ 535{
536 struct nfc_llcp_sock *llcp_sock, *parent_sock; 536 struct nfc_llcp_sock *llcp_sock, *parent_sock;
537 struct sock *sk; 537 struct sock *sk;
@@ -549,11 +549,11 @@ static inline unsigned int llcp_accept_poll(struct sock *parent)
549 return 0; 549 return 0;
550} 550}
551 551
552static unsigned int llcp_sock_poll(struct file *file, struct socket *sock, 552static __poll_t llcp_sock_poll(struct file *file, struct socket *sock,
553 poll_table *wait) 553 poll_table *wait)
554{ 554{
555 struct sock *sk = sock->sk; 555 struct sock *sk = sock->sk;
556 unsigned int mask = 0; 556 __poll_t mask = 0;
557 557
558 pr_debug("%p\n", sk); 558 pr_debug("%p\n", sk);
559 559
diff --git a/net/nfc/nci/uart.c b/net/nfc/nci/uart.c
index 8d104c1db628..a66f102c6c01 100644
--- a/net/nfc/nci/uart.c
+++ b/net/nfc/nci/uart.c
@@ -305,7 +305,7 @@ static ssize_t nci_uart_tty_write(struct tty_struct *tty, struct file *file,
305 return 0; 305 return 0;
306} 306}
307 307
308static unsigned int nci_uart_tty_poll(struct tty_struct *tty, 308static __poll_t nci_uart_tty_poll(struct tty_struct *tty,
309 struct file *filp, poll_table *wait) 309 struct file *filp, poll_table *wait)
310{ 310{
311 return 0; 311 return 0;
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index da215e5c1399..3b4d6a3cf190 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -4073,12 +4073,12 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd,
4073 return 0; 4073 return 0;
4074} 4074}
4075 4075
4076static unsigned int packet_poll(struct file *file, struct socket *sock, 4076static __poll_t packet_poll(struct file *file, struct socket *sock,
4077 poll_table *wait) 4077 poll_table *wait)
4078{ 4078{
4079 struct sock *sk = sock->sk; 4079 struct sock *sk = sock->sk;
4080 struct packet_sock *po = pkt_sk(sk); 4080 struct packet_sock *po = pkt_sk(sk);
4081 unsigned int mask = datagram_poll(file, sock, wait); 4081 __poll_t mask = datagram_poll(file, sock, wait);
4082 4082
4083 spin_lock_bh(&sk->sk_receive_queue.lock); 4083 spin_lock_bh(&sk->sk_receive_queue.lock);
4084 if (po->rx_ring.pg_vec) { 4084 if (po->rx_ring.pg_vec) {
diff --git a/net/phonet/socket.c b/net/phonet/socket.c
index 1b050dd17393..44417480dab7 100644
--- a/net/phonet/socket.c
+++ b/net/phonet/socket.c
@@ -341,12 +341,12 @@ static int pn_socket_getname(struct socket *sock, struct sockaddr *addr,
341 return 0; 341 return 0;
342} 342}
343 343
344static unsigned int pn_socket_poll(struct file *file, struct socket *sock, 344static __poll_t pn_socket_poll(struct file *file, struct socket *sock,
345 poll_table *wait) 345 poll_table *wait)
346{ 346{
347 struct sock *sk = sock->sk; 347 struct sock *sk = sock->sk;
348 struct pep_sock *pn = pep_sk(sk); 348 struct pep_sock *pn = pep_sk(sk);
349 unsigned int mask = 0; 349 __poll_t mask = 0;
350 350
351 poll_wait(file, sk_sleep(sk), wait); 351 poll_wait(file, sk_sleep(sk), wait);
352 352
diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c
index b405f77d664c..88aa8ad0f5b6 100644
--- a/net/rds/af_rds.c
+++ b/net/rds/af_rds.c
@@ -152,12 +152,12 @@ static int rds_getname(struct socket *sock, struct sockaddr *uaddr,
152 * to send to a congested destination, the system call may still fail (and 152 * to send to a congested destination, the system call may still fail (and
153 * return ENOBUFS). 153 * return ENOBUFS).
154 */ 154 */
155static unsigned int rds_poll(struct file *file, struct socket *sock, 155static __poll_t rds_poll(struct file *file, struct socket *sock,
156 poll_table *wait) 156 poll_table *wait)
157{ 157{
158 struct sock *sk = sock->sk; 158 struct sock *sk = sock->sk;
159 struct rds_sock *rs = rds_sk_to_rs(sk); 159 struct rds_sock *rs = rds_sk_to_rs(sk);
160 unsigned int mask = 0; 160 __poll_t mask = 0;
161 unsigned long flags; 161 unsigned long flags;
162 162
163 poll_wait(file, sk_sleep(sk), wait); 163 poll_wait(file, sk_sleep(sk), wait);
diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index 2064c3a35ef8..124c77e9d058 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -1139,10 +1139,10 @@ static int rfkill_fop_open(struct inode *inode, struct file *file)
1139 return -ENOMEM; 1139 return -ENOMEM;
1140} 1140}
1141 1141
1142static unsigned int rfkill_fop_poll(struct file *file, poll_table *wait) 1142static __poll_t rfkill_fop_poll(struct file *file, poll_table *wait)
1143{ 1143{
1144 struct rfkill_data *data = file->private_data; 1144 struct rfkill_data *data = file->private_data;
1145 unsigned int res = POLLOUT | POLLWRNORM; 1145 __poll_t res = POLLOUT | POLLWRNORM;
1146 1146
1147 poll_wait(file, &data->read_wait, wait); 1147 poll_wait(file, &data->read_wait, wait);
1148 1148
diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c
index dcd818fa837e..21ad6a3a465c 100644
--- a/net/rxrpc/af_rxrpc.c
+++ b/net/rxrpc/af_rxrpc.c
@@ -729,12 +729,12 @@ static int rxrpc_getsockopt(struct socket *sock, int level, int optname,
729/* 729/*
730 * permit an RxRPC socket to be polled 730 * permit an RxRPC socket to be polled
731 */ 731 */
732static unsigned int rxrpc_poll(struct file *file, struct socket *sock, 732static __poll_t rxrpc_poll(struct file *file, struct socket *sock,
733 poll_table *wait) 733 poll_table *wait)
734{ 734{
735 struct sock *sk = sock->sk; 735 struct sock *sk = sock->sk;
736 struct rxrpc_sock *rx = rxrpc_sk(sk); 736 struct rxrpc_sock *rx = rxrpc_sk(sk);
737 unsigned int mask; 737 __poll_t mask;
738 738
739 sock_poll_wait(file, sk_sleep(sk), wait); 739 sock_poll_wait(file, sk_sleep(sk), wait);
740 mask = 0; 740 mask = 0;
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 039fcb618c34..37382317fba4 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -7518,11 +7518,11 @@ out:
7518 * here, again, by modeling the current TCP/UDP code. We don't have 7518 * here, again, by modeling the current TCP/UDP code. We don't have
7519 * a good way to test with it yet. 7519 * a good way to test with it yet.
7520 */ 7520 */
7521unsigned int sctp_poll(struct file *file, struct socket *sock, poll_table *wait) 7521__poll_t sctp_poll(struct file *file, struct socket *sock, poll_table *wait)
7522{ 7522{
7523 struct sock *sk = sock->sk; 7523 struct sock *sk = sock->sk;
7524 struct sctp_sock *sp = sctp_sk(sk); 7524 struct sctp_sock *sp = sctp_sk(sk);
7525 unsigned int mask; 7525 __poll_t mask;
7526 7526
7527 poll_wait(file, sk_sleep(sk), wait); 7527 poll_wait(file, sk_sleep(sk), wait);
7528 7528
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 6451c5013e06..449f62e1e270 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -1107,7 +1107,7 @@ out:
1107 return rc; 1107 return rc;
1108} 1108}
1109 1109
1110static unsigned int smc_accept_poll(struct sock *parent) 1110static __poll_t smc_accept_poll(struct sock *parent)
1111{ 1111{
1112 struct smc_sock *isk; 1112 struct smc_sock *isk;
1113 struct sock *sk; 1113 struct sock *sk;
@@ -1126,11 +1126,11 @@ static unsigned int smc_accept_poll(struct sock *parent)
1126 return 0; 1126 return 0;
1127} 1127}
1128 1128
1129static unsigned int smc_poll(struct file *file, struct socket *sock, 1129static __poll_t smc_poll(struct file *file, struct socket *sock,
1130 poll_table *wait) 1130 poll_table *wait)
1131{ 1131{
1132 struct sock *sk = sock->sk; 1132 struct sock *sk = sock->sk;
1133 unsigned int mask = 0; 1133 __poll_t mask = 0;
1134 struct smc_sock *smc; 1134 struct smc_sock *smc;
1135 int rc; 1135 int rc;
1136 1136
diff --git a/net/socket.c b/net/socket.c
index 6f05d5c4bf30..2f378449bc1b 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -118,7 +118,7 @@ static ssize_t sock_write_iter(struct kiocb *iocb, struct iov_iter *from);
118static int sock_mmap(struct file *file, struct vm_area_struct *vma); 118static int sock_mmap(struct file *file, struct vm_area_struct *vma);
119 119
120static int sock_close(struct inode *inode, struct file *file); 120static int sock_close(struct inode *inode, struct file *file);
121static unsigned int sock_poll(struct file *file, 121static __poll_t sock_poll(struct file *file,
122 struct poll_table_struct *wait); 122 struct poll_table_struct *wait);
123static long sock_ioctl(struct file *file, unsigned int cmd, unsigned long arg); 123static long sock_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
124#ifdef CONFIG_COMPAT 124#ifdef CONFIG_COMPAT
@@ -1097,9 +1097,9 @@ out_release:
1097EXPORT_SYMBOL(sock_create_lite); 1097EXPORT_SYMBOL(sock_create_lite);
1098 1098
1099/* No kernel lock held - perfect */ 1099/* No kernel lock held - perfect */
1100static unsigned int sock_poll(struct file *file, poll_table *wait) 1100static __poll_t sock_poll(struct file *file, poll_table *wait)
1101{ 1101{
1102 unsigned int busy_flag = 0; 1102 __poll_t busy_flag = 0;
1103 struct socket *sock; 1103 struct socket *sock;
1104 1104
1105 /* 1105 /*
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index e68943895be4..aa36dad32db1 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -930,10 +930,10 @@ out:
930 930
931static DECLARE_WAIT_QUEUE_HEAD(queue_wait); 931static DECLARE_WAIT_QUEUE_HEAD(queue_wait);
932 932
933static unsigned int cache_poll(struct file *filp, poll_table *wait, 933static __poll_t cache_poll(struct file *filp, poll_table *wait,
934 struct cache_detail *cd) 934 struct cache_detail *cd)
935{ 935{
936 unsigned int mask; 936 __poll_t mask;
937 struct cache_reader *rp = filp->private_data; 937 struct cache_reader *rp = filp->private_data;
938 struct cache_queue *cq; 938 struct cache_queue *cq;
939 939
@@ -1501,7 +1501,7 @@ static ssize_t cache_write_procfs(struct file *filp, const char __user *buf,
1501 return cache_write(filp, buf, count, ppos, cd); 1501 return cache_write(filp, buf, count, ppos, cd);
1502} 1502}
1503 1503
1504static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait) 1504static __poll_t cache_poll_procfs(struct file *filp, poll_table *wait)
1505{ 1505{
1506 struct cache_detail *cd = PDE_DATA(file_inode(filp)); 1506 struct cache_detail *cd = PDE_DATA(file_inode(filp));
1507 1507
@@ -1720,7 +1720,7 @@ static ssize_t cache_write_pipefs(struct file *filp, const char __user *buf,
1720 return cache_write(filp, buf, count, ppos, cd); 1720 return cache_write(filp, buf, count, ppos, cd);
1721} 1721}
1722 1722
1723static unsigned int cache_poll_pipefs(struct file *filp, poll_table *wait) 1723static __poll_t cache_poll_pipefs(struct file *filp, poll_table *wait)
1724{ 1724{
1725 struct cache_detail *cd = RPC_I(file_inode(filp))->private; 1725 struct cache_detail *cd = RPC_I(file_inode(filp))->private;
1726 1726
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 7803f3b6aa53..5c4330325787 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -340,12 +340,12 @@ rpc_pipe_write(struct file *filp, const char __user *buf, size_t len, loff_t *of
340 return res; 340 return res;
341} 341}
342 342
343static unsigned int 343static __poll_t
344rpc_pipe_poll(struct file *filp, struct poll_table_struct *wait) 344rpc_pipe_poll(struct file *filp, struct poll_table_struct *wait)
345{ 345{
346 struct inode *inode = file_inode(filp); 346 struct inode *inode = file_inode(filp);
347 struct rpc_inode *rpci = RPC_I(inode); 347 struct rpc_inode *rpci = RPC_I(inode);
348 unsigned int mask = POLLOUT | POLLWRNORM; 348 __poll_t mask = POLLOUT | POLLWRNORM;
349 349
350 poll_wait(filp, &rpci->waitq, wait); 350 poll_wait(filp, &rpci->waitq, wait);
351 351
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 3b4084480377..2aa46e8cd8fe 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -710,13 +710,13 @@ static int tipc_getname(struct socket *sock, struct sockaddr *uaddr,
710 * imply that the operation will succeed, merely that it should be performed 710 * imply that the operation will succeed, merely that it should be performed
711 * and will not block. 711 * and will not block.
712 */ 712 */
713static unsigned int tipc_poll(struct file *file, struct socket *sock, 713static __poll_t tipc_poll(struct file *file, struct socket *sock,
714 poll_table *wait) 714 poll_table *wait)
715{ 715{
716 struct sock *sk = sock->sk; 716 struct sock *sk = sock->sk;
717 struct tipc_sock *tsk = tipc_sk(sk); 717 struct tipc_sock *tsk = tipc_sk(sk);
718 struct tipc_group *grp = tsk->group; 718 struct tipc_group *grp = tsk->group;
719 u32 revents = 0; 719 __poll_t revents = 0;
720 720
721 sock_poll_wait(file, sk_sleep(sk), wait); 721 sock_poll_wait(file, sk_sleep(sk), wait);
722 722
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index a9ee634f3c42..6b7678df41e5 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -367,7 +367,7 @@ static int unix_dgram_peer_wake_relay(wait_queue_entry_t *q, unsigned mode, int
367 /* relaying can only happen while the wq still exists */ 367 /* relaying can only happen while the wq still exists */
368 u_sleep = sk_sleep(&u->sk); 368 u_sleep = sk_sleep(&u->sk);
369 if (u_sleep) 369 if (u_sleep)
370 wake_up_interruptible_poll(u_sleep, key); 370 wake_up_interruptible_poll(u_sleep, key_to_poll(key));
371 371
372 return 0; 372 return 0;
373} 373}
@@ -638,8 +638,8 @@ static int unix_stream_connect(struct socket *, struct sockaddr *,
638static int unix_socketpair(struct socket *, struct socket *); 638static int unix_socketpair(struct socket *, struct socket *);
639static int unix_accept(struct socket *, struct socket *, int, bool); 639static int unix_accept(struct socket *, struct socket *, int, bool);
640static int unix_getname(struct socket *, struct sockaddr *, int *, int); 640static int unix_getname(struct socket *, struct sockaddr *, int *, int);
641static unsigned int unix_poll(struct file *, struct socket *, poll_table *); 641static __poll_t unix_poll(struct file *, struct socket *, poll_table *);
642static unsigned int unix_dgram_poll(struct file *, struct socket *, 642static __poll_t unix_dgram_poll(struct file *, struct socket *,
643 poll_table *); 643 poll_table *);
644static int unix_ioctl(struct socket *, unsigned int, unsigned long); 644static int unix_ioctl(struct socket *, unsigned int, unsigned long);
645static int unix_shutdown(struct socket *, int); 645static int unix_shutdown(struct socket *, int);
@@ -2640,10 +2640,10 @@ static int unix_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
2640 return err; 2640 return err;
2641} 2641}
2642 2642
2643static unsigned int unix_poll(struct file *file, struct socket *sock, poll_table *wait) 2643static __poll_t unix_poll(struct file *file, struct socket *sock, poll_table *wait)
2644{ 2644{
2645 struct sock *sk = sock->sk; 2645 struct sock *sk = sock->sk;
2646 unsigned int mask; 2646 __poll_t mask;
2647 2647
2648 sock_poll_wait(file, sk_sleep(sk), wait); 2648 sock_poll_wait(file, sk_sleep(sk), wait);
2649 mask = 0; 2649 mask = 0;
@@ -2675,11 +2675,12 @@ static unsigned int unix_poll(struct file *file, struct socket *sock, poll_table
2675 return mask; 2675 return mask;
2676} 2676}
2677 2677
2678static unsigned int unix_dgram_poll(struct file *file, struct socket *sock, 2678static __poll_t unix_dgram_poll(struct file *file, struct socket *sock,
2679 poll_table *wait) 2679 poll_table *wait)
2680{ 2680{
2681 struct sock *sk = sock->sk, *other; 2681 struct sock *sk = sock->sk, *other;
2682 unsigned int mask, writable; 2682 unsigned int writable;
2683 __poll_t mask;
2683 2684
2684 sock_poll_wait(file, sk_sleep(sk), wait); 2685 sock_poll_wait(file, sk_sleep(sk), wait);
2685 mask = 0; 2686 mask = 0;
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index c9473d698525..9d95e773f4c8 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -850,11 +850,11 @@ static int vsock_shutdown(struct socket *sock, int mode)
850 return err; 850 return err;
851} 851}
852 852
853static unsigned int vsock_poll(struct file *file, struct socket *sock, 853static __poll_t vsock_poll(struct file *file, struct socket *sock,
854 poll_table *wait) 854 poll_table *wait)
855{ 855{
856 struct sock *sk; 856 struct sock *sk;
857 unsigned int mask; 857 __poll_t mask;
858 struct vsock_sock *vsk; 858 struct vsock_sock *vsk;
859 859
860 sk = sock->sk; 860 sk = sock->sk;
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index d4fa04d91439..4d202b73a0e1 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -571,10 +571,10 @@ static int ns_revision_open(struct inode *inode, struct file *file)
571 return 0; 571 return 0;
572} 572}
573 573
574static unsigned int ns_revision_poll(struct file *file, poll_table *pt) 574static __poll_t ns_revision_poll(struct file *file, poll_table *pt)
575{ 575{
576 struct aa_revision *rev = file->private_data; 576 struct aa_revision *rev = file->private_data;
577 unsigned int mask = 0; 577 __poll_t mask = 0;
578 578
579 if (rev) { 579 if (rev) {
580 mutex_lock_nested(&rev->ns->lock, rev->ns->level); 580 mutex_lock_nested(&rev->ns->lock, rev->ns->level);
diff --git a/security/tomoyo/audit.c b/security/tomoyo/audit.c
index 0f73fe30e37a..558e3076d38c 100644
--- a/security/tomoyo/audit.c
+++ b/security/tomoyo/audit.c
@@ -458,7 +458,7 @@ void tomoyo_read_log(struct tomoyo_io_buffer *head)
458 * 458 *
459 * Returns POLLIN | POLLRDNORM when ready to read an audit log. 459 * Returns POLLIN | POLLRDNORM when ready to read an audit log.
460 */ 460 */
461unsigned int tomoyo_poll_log(struct file *file, poll_table *wait) 461__poll_t tomoyo_poll_log(struct file *file, poll_table *wait)
462{ 462{
463 if (tomoyo_log_count) 463 if (tomoyo_log_count)
464 return POLLIN | POLLRDNORM; 464 return POLLIN | POLLRDNORM;
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index 25eed4b0b0e8..70c73bf66c88 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -2120,7 +2120,7 @@ static struct tomoyo_domain_info *tomoyo_find_domain_by_qid
2120 * 2120 *
2121 * Waits for access requests which violated policy in enforcing mode. 2121 * Waits for access requests which violated policy in enforcing mode.
2122 */ 2122 */
2123static unsigned int tomoyo_poll_query(struct file *file, poll_table *wait) 2123static __poll_t tomoyo_poll_query(struct file *file, poll_table *wait)
2124{ 2124{
2125 if (!list_empty(&tomoyo_query_list)) 2125 if (!list_empty(&tomoyo_query_list))
2126 return POLLIN | POLLRDNORM; 2126 return POLLIN | POLLRDNORM;
@@ -2453,7 +2453,7 @@ int tomoyo_open_control(const u8 type, struct file *file)
2453 * Returns POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM if ready to read/write, 2453 * Returns POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM if ready to read/write,
2454 * POLLOUT | POLLWRNORM otherwise. 2454 * POLLOUT | POLLWRNORM otherwise.
2455 */ 2455 */
2456unsigned int tomoyo_poll_control(struct file *file, poll_table *wait) 2456__poll_t tomoyo_poll_control(struct file *file, poll_table *wait)
2457{ 2457{
2458 struct tomoyo_io_buffer *head = file->private_data; 2458 struct tomoyo_io_buffer *head = file->private_data;
2459 if (head->poll) 2459 if (head->poll)
diff --git a/security/tomoyo/common.h b/security/tomoyo/common.h
index 7adccdd8e36d..539bcdd30bb8 100644
--- a/security/tomoyo/common.h
+++ b/security/tomoyo/common.h
@@ -789,7 +789,7 @@ struct tomoyo_acl_param {
789struct tomoyo_io_buffer { 789struct tomoyo_io_buffer {
790 void (*read) (struct tomoyo_io_buffer *); 790 void (*read) (struct tomoyo_io_buffer *);
791 int (*write) (struct tomoyo_io_buffer *); 791 int (*write) (struct tomoyo_io_buffer *);
792 unsigned int (*poll) (struct file *file, poll_table *wait); 792 __poll_t (*poll) (struct file *file, poll_table *wait);
793 /* Exclusive lock for this structure. */ 793 /* Exclusive lock for this structure. */
794 struct mutex io_sem; 794 struct mutex io_sem;
795 char __user *read_user_buf; 795 char __user *read_user_buf;
@@ -981,8 +981,8 @@ int tomoyo_path_number_perm(const u8 operation, const struct path *path,
981 unsigned long number); 981 unsigned long number);
982int tomoyo_path_perm(const u8 operation, const struct path *path, 982int tomoyo_path_perm(const u8 operation, const struct path *path,
983 const char *target); 983 const char *target);
984unsigned int tomoyo_poll_control(struct file *file, poll_table *wait); 984__poll_t tomoyo_poll_control(struct file *file, poll_table *wait);
985unsigned int tomoyo_poll_log(struct file *file, poll_table *wait); 985__poll_t tomoyo_poll_log(struct file *file, poll_table *wait);
986int tomoyo_socket_bind_permission(struct socket *sock, struct sockaddr *addr, 986int tomoyo_socket_bind_permission(struct socket *sock, struct sockaddr *addr,
987 int addr_len); 987 int addr_len);
988int tomoyo_socket_connect_permission(struct socket *sock, 988int tomoyo_socket_connect_permission(struct socket *sock,
diff --git a/security/tomoyo/securityfs_if.c b/security/tomoyo/securityfs_if.c
index 49393c2a3f8b..fb9bf99deb35 100644
--- a/security/tomoyo/securityfs_if.c
+++ b/security/tomoyo/securityfs_if.c
@@ -157,7 +157,7 @@ static int tomoyo_release(struct inode *inode, struct file *file)
157 * Returns POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM if ready to read/write, 157 * Returns POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM if ready to read/write,
158 * POLLOUT | POLLWRNORM otherwise. 158 * POLLOUT | POLLWRNORM otherwise.
159 */ 159 */
160static unsigned int tomoyo_poll(struct file *file, poll_table *wait) 160static __poll_t tomoyo_poll(struct file *file, poll_table *wait)
161{ 161{
162 return tomoyo_poll_control(file, wait); 162 return tomoyo_poll_control(file, wait);
163} 163}
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index 4490a699030b..a12b9555e910 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -396,7 +396,7 @@ static int snd_compr_mmap(struct file *f, struct vm_area_struct *vma)
396 return -ENXIO; 396 return -ENXIO;
397} 397}
398 398
399static inline int snd_compr_get_poll(struct snd_compr_stream *stream) 399static __poll_t snd_compr_get_poll(struct snd_compr_stream *stream)
400{ 400{
401 if (stream->direction == SND_COMPRESS_PLAYBACK) 401 if (stream->direction == SND_COMPRESS_PLAYBACK)
402 return POLLOUT | POLLWRNORM; 402 return POLLOUT | POLLWRNORM;
@@ -404,12 +404,12 @@ static inline int snd_compr_get_poll(struct snd_compr_stream *stream)
404 return POLLIN | POLLRDNORM; 404 return POLLIN | POLLRDNORM;
405} 405}
406 406
407static unsigned int snd_compr_poll(struct file *f, poll_table *wait) 407static __poll_t snd_compr_poll(struct file *f, poll_table *wait)
408{ 408{
409 struct snd_compr_file *data = f->private_data; 409 struct snd_compr_file *data = f->private_data;
410 struct snd_compr_stream *stream; 410 struct snd_compr_stream *stream;
411 size_t avail; 411 size_t avail;
412 int retval = 0; 412 __poll_t retval = 0;
413 413
414 if (snd_BUG_ON(!data)) 414 if (snd_BUG_ON(!data))
415 return POLLERR; 415 return POLLERR;
diff --git a/sound/core/control.c b/sound/core/control.c
index 56b3e2d49c82..494389fb966c 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -1666,9 +1666,9 @@ static ssize_t snd_ctl_read(struct file *file, char __user *buffer,
1666 return result > 0 ? result : err; 1666 return result > 0 ? result : err;
1667} 1667}
1668 1668
1669static unsigned int snd_ctl_poll(struct file *file, poll_table * wait) 1669static __poll_t snd_ctl_poll(struct file *file, poll_table * wait)
1670{ 1670{
1671 unsigned int mask; 1671 __poll_t mask;
1672 struct snd_ctl_file *ctl; 1672 struct snd_ctl_file *ctl;
1673 1673
1674 ctl = file->private_data; 1674 ctl = file->private_data;
diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c
index 8faae3d1455d..cbda5c8b675f 100644
--- a/sound/core/hwdep.c
+++ b/sound/core/hwdep.c
@@ -177,7 +177,7 @@ static int snd_hwdep_release(struct inode *inode, struct file * file)
177 return err; 177 return err;
178} 178}
179 179
180static unsigned int snd_hwdep_poll(struct file * file, poll_table * wait) 180static __poll_t snd_hwdep_poll(struct file * file, poll_table * wait)
181{ 181{
182 struct snd_hwdep *hw = file->private_data; 182 struct snd_hwdep *hw = file->private_data;
183 if (hw->ops.poll) 183 if (hw->ops.poll)
diff --git a/sound/core/info.c b/sound/core/info.c
index bcf6a48cc70d..aa86f3f8e056 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -203,11 +203,11 @@ static ssize_t snd_info_entry_write(struct file *file, const char __user *buffer
203 return size; 203 return size;
204} 204}
205 205
206static unsigned int snd_info_entry_poll(struct file *file, poll_table *wait) 206static __poll_t snd_info_entry_poll(struct file *file, poll_table *wait)
207{ 207{
208 struct snd_info_private_data *data = file->private_data; 208 struct snd_info_private_data *data = file->private_data;
209 struct snd_info_entry *entry = data->entry; 209 struct snd_info_entry *entry = data->entry;
210 unsigned int mask = 0; 210 __poll_t mask = 0;
211 211
212 if (entry->c.ops->poll) 212 if (entry->c.ops->poll)
213 return entry->c.ops->poll(entry, 213 return entry->c.ops->poll(entry,
diff --git a/sound/core/init.c b/sound/core/init.c
index 168ae03d3a1c..8753440c3a6e 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -344,7 +344,7 @@ static int snd_disconnect_release(struct inode *inode, struct file *file)
344 panic("%s(%p, %p) failed!", __func__, inode, file); 344 panic("%s(%p, %p) failed!", __func__, inode, file);
345} 345}
346 346
347static unsigned int snd_disconnect_poll(struct file * file, poll_table * wait) 347static __poll_t snd_disconnect_poll(struct file * file, poll_table * wait)
348{ 348{
349 return POLLERR | POLLNVAL; 349 return POLLERR | POLLNVAL;
350} 350}
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index e8b19876c420..3ebba9c7f86e 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -2686,10 +2686,10 @@ static int snd_pcm_oss_capture_ready(struct snd_pcm_substream *substream)
2686 runtime->oss.period_frames; 2686 runtime->oss.period_frames;
2687} 2687}
2688 2688
2689static unsigned int snd_pcm_oss_poll(struct file *file, poll_table * wait) 2689static __poll_t snd_pcm_oss_poll(struct file *file, poll_table * wait)
2690{ 2690{
2691 struct snd_pcm_oss_file *pcm_oss_file; 2691 struct snd_pcm_oss_file *pcm_oss_file;
2692 unsigned int mask; 2692 __poll_t mask;
2693 struct snd_pcm_substream *psubstream = NULL, *csubstream = NULL; 2693 struct snd_pcm_substream *psubstream = NULL, *csubstream = NULL;
2694 2694
2695 pcm_oss_file = file->private_data; 2695 pcm_oss_file = file->private_data;
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 484a18d96371..51104df924e1 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -3135,12 +3135,12 @@ static ssize_t snd_pcm_writev(struct kiocb *iocb, struct iov_iter *from)
3135 return result; 3135 return result;
3136} 3136}
3137 3137
3138static unsigned int snd_pcm_playback_poll(struct file *file, poll_table * wait) 3138static __poll_t snd_pcm_playback_poll(struct file *file, poll_table * wait)
3139{ 3139{
3140 struct snd_pcm_file *pcm_file; 3140 struct snd_pcm_file *pcm_file;
3141 struct snd_pcm_substream *substream; 3141 struct snd_pcm_substream *substream;
3142 struct snd_pcm_runtime *runtime; 3142 struct snd_pcm_runtime *runtime;
3143 unsigned int mask; 3143 __poll_t mask;
3144 snd_pcm_uframes_t avail; 3144 snd_pcm_uframes_t avail;
3145 3145
3146 pcm_file = file->private_data; 3146 pcm_file = file->private_data;
@@ -3174,12 +3174,12 @@ static unsigned int snd_pcm_playback_poll(struct file *file, poll_table * wait)
3174 return mask; 3174 return mask;
3175} 3175}
3176 3176
3177static unsigned int snd_pcm_capture_poll(struct file *file, poll_table * wait) 3177static __poll_t snd_pcm_capture_poll(struct file *file, poll_table * wait)
3178{ 3178{
3179 struct snd_pcm_file *pcm_file; 3179 struct snd_pcm_file *pcm_file;
3180 struct snd_pcm_substream *substream; 3180 struct snd_pcm_substream *substream;
3181 struct snd_pcm_runtime *runtime; 3181 struct snd_pcm_runtime *runtime;
3182 unsigned int mask; 3182 __poll_t mask;
3183 snd_pcm_uframes_t avail; 3183 snd_pcm_uframes_t avail;
3184 3184
3185 pcm_file = file->private_data; 3185 pcm_file = file->private_data;
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index f055ca10bbc1..fae21311723f 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -1366,11 +1366,11 @@ static ssize_t snd_rawmidi_write(struct file *file, const char __user *buf,
1366 return result; 1366 return result;
1367} 1367}
1368 1368
1369static unsigned int snd_rawmidi_poll(struct file *file, poll_table * wait) 1369static __poll_t snd_rawmidi_poll(struct file *file, poll_table * wait)
1370{ 1370{
1371 struct snd_rawmidi_file *rfile; 1371 struct snd_rawmidi_file *rfile;
1372 struct snd_rawmidi_runtime *runtime; 1372 struct snd_rawmidi_runtime *runtime;
1373 unsigned int mask; 1373 __poll_t mask;
1374 1374
1375 rfile = file->private_data; 1375 rfile = file->private_data;
1376 if (rfile->input != NULL) { 1376 if (rfile->input != NULL) {
diff --git a/sound/core/seq/oss/seq_oss.c b/sound/core/seq/oss/seq_oss.c
index 8cdf489df80e..5f64d0d88320 100644
--- a/sound/core/seq/oss/seq_oss.c
+++ b/sound/core/seq/oss/seq_oss.c
@@ -59,7 +59,7 @@ static int odev_release(struct inode *inode, struct file *file);
59static ssize_t odev_read(struct file *file, char __user *buf, size_t count, loff_t *offset); 59static ssize_t odev_read(struct file *file, char __user *buf, size_t count, loff_t *offset);
60static ssize_t odev_write(struct file *file, const char __user *buf, size_t count, loff_t *offset); 60static ssize_t odev_write(struct file *file, const char __user *buf, size_t count, loff_t *offset);
61static long odev_ioctl(struct file *file, unsigned int cmd, unsigned long arg); 61static long odev_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
62static unsigned int odev_poll(struct file *file, poll_table * wait); 62static __poll_t odev_poll(struct file *file, poll_table * wait);
63 63
64 64
65/* 65/*
@@ -197,7 +197,7 @@ static long odev_ioctl_compat(struct file *file, unsigned int cmd,
197#define odev_ioctl_compat NULL 197#define odev_ioctl_compat NULL
198#endif 198#endif
199 199
200static unsigned int 200static __poll_t
201odev_poll(struct file *file, poll_table * wait) 201odev_poll(struct file *file, poll_table * wait)
202{ 202{
203 struct seq_oss_devinfo *dp; 203 struct seq_oss_devinfo *dp;
diff --git a/sound/core/seq/oss/seq_oss_device.h b/sound/core/seq/oss/seq_oss_device.h
index afa007c0cc2d..2d0e9eaf13aa 100644
--- a/sound/core/seq/oss/seq_oss_device.h
+++ b/sound/core/seq/oss/seq_oss_device.h
@@ -124,7 +124,7 @@ void snd_seq_oss_release(struct seq_oss_devinfo *dp);
124int snd_seq_oss_ioctl(struct seq_oss_devinfo *dp, unsigned int cmd, unsigned long arg); 124int snd_seq_oss_ioctl(struct seq_oss_devinfo *dp, unsigned int cmd, unsigned long arg);
125int snd_seq_oss_read(struct seq_oss_devinfo *dev, char __user *buf, int count); 125int snd_seq_oss_read(struct seq_oss_devinfo *dev, char __user *buf, int count);
126int snd_seq_oss_write(struct seq_oss_devinfo *dp, const char __user *buf, int count, struct file *opt); 126int snd_seq_oss_write(struct seq_oss_devinfo *dp, const char __user *buf, int count, struct file *opt);
127unsigned int snd_seq_oss_poll(struct seq_oss_devinfo *dp, struct file *file, poll_table * wait); 127__poll_t snd_seq_oss_poll(struct seq_oss_devinfo *dp, struct file *file, poll_table * wait);
128 128
129void snd_seq_oss_reset(struct seq_oss_devinfo *dp); 129void snd_seq_oss_reset(struct seq_oss_devinfo *dp);
130 130
diff --git a/sound/core/seq/oss/seq_oss_rw.c b/sound/core/seq/oss/seq_oss_rw.c
index 6a7b6aceeca9..c538e78ca310 100644
--- a/sound/core/seq/oss/seq_oss_rw.c
+++ b/sound/core/seq/oss/seq_oss_rw.c
@@ -196,10 +196,10 @@ insert_queue(struct seq_oss_devinfo *dp, union evrec *rec, struct file *opt)
196 * select / poll 196 * select / poll
197 */ 197 */
198 198
199unsigned int 199__poll_t
200snd_seq_oss_poll(struct seq_oss_devinfo *dp, struct file *file, poll_table * wait) 200snd_seq_oss_poll(struct seq_oss_devinfo *dp, struct file *file, poll_table * wait)
201{ 201{
202 unsigned int mask = 0; 202 __poll_t mask = 0;
203 203
204 /* input */ 204 /* input */
205 if (dp->readq && is_read_mode(dp->file_mode)) { 205 if (dp->readq && is_read_mode(dp->file_mode)) {
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
index d01913404581..b611deef81f5 100644
--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -1087,10 +1087,10 @@ static ssize_t snd_seq_write(struct file *file, const char __user *buf,
1087/* 1087/*
1088 * handle polling 1088 * handle polling
1089 */ 1089 */
1090static unsigned int snd_seq_poll(struct file *file, poll_table * wait) 1090static __poll_t snd_seq_poll(struct file *file, poll_table * wait)
1091{ 1091{
1092 struct snd_seq_client *client = file->private_data; 1092 struct snd_seq_client *client = file->private_data;
1093 unsigned int mask = 0; 1093 __poll_t mask = 0;
1094 1094
1095 /* check client structures are in place */ 1095 /* check client structures are in place */
1096 if (snd_BUG_ON(!client)) 1096 if (snd_BUG_ON(!client))
diff --git a/sound/core/timer.c b/sound/core/timer.c
index ee09dace8bb1..da05e314917f 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -2072,9 +2072,9 @@ static ssize_t snd_timer_user_read(struct file *file, char __user *buffer,
2072 return result > 0 ? result : err; 2072 return result > 0 ? result : err;
2073} 2073}
2074 2074
2075static unsigned int snd_timer_user_poll(struct file *file, poll_table * wait) 2075static __poll_t snd_timer_user_poll(struct file *file, poll_table * wait)
2076{ 2076{
2077 unsigned int mask; 2077 __poll_t mask;
2078 struct snd_timer_user *tu; 2078 struct snd_timer_user *tu;
2079 2079
2080 tu = file->private_data; 2080 tu = file->private_data;
diff --git a/sound/firewire/bebob/bebob_hwdep.c b/sound/firewire/bebob/bebob_hwdep.c
index 2b367c21b80c..83e791810c52 100644
--- a/sound/firewire/bebob/bebob_hwdep.c
+++ b/sound/firewire/bebob/bebob_hwdep.c
@@ -53,11 +53,11 @@ hwdep_read(struct snd_hwdep *hwdep, char __user *buf, long count,
53 return count; 53 return count;
54} 54}
55 55
56static unsigned int 56static __poll_t
57hwdep_poll(struct snd_hwdep *hwdep, struct file *file, poll_table *wait) 57hwdep_poll(struct snd_hwdep *hwdep, struct file *file, poll_table *wait)
58{ 58{
59 struct snd_bebob *bebob = hwdep->private_data; 59 struct snd_bebob *bebob = hwdep->private_data;
60 unsigned int events; 60 __poll_t events;
61 61
62 poll_wait(file, &bebob->hwdep_wait, wait); 62 poll_wait(file, &bebob->hwdep_wait, wait);
63 63
diff --git a/sound/firewire/dice/dice-hwdep.c b/sound/firewire/dice/dice-hwdep.c
index a4dc02a86f12..7a8af0f91c96 100644
--- a/sound/firewire/dice/dice-hwdep.c
+++ b/sound/firewire/dice/dice-hwdep.c
@@ -52,11 +52,11 @@ static long hwdep_read(struct snd_hwdep *hwdep, char __user *buf,
52 return count; 52 return count;
53} 53}
54 54
55static unsigned int hwdep_poll(struct snd_hwdep *hwdep, struct file *file, 55static __poll_t hwdep_poll(struct snd_hwdep *hwdep, struct file *file,
56 poll_table *wait) 56 poll_table *wait)
57{ 57{
58 struct snd_dice *dice = hwdep->private_data; 58 struct snd_dice *dice = hwdep->private_data;
59 unsigned int events; 59 __poll_t events;
60 60
61 poll_wait(file, &dice->hwdep_wait, wait); 61 poll_wait(file, &dice->hwdep_wait, wait);
62 62
diff --git a/sound/firewire/digi00x/digi00x-hwdep.c b/sound/firewire/digi00x/digi00x-hwdep.c
index 463c6b8e864d..a084c2a834db 100644
--- a/sound/firewire/digi00x/digi00x-hwdep.c
+++ b/sound/firewire/digi00x/digi00x-hwdep.c
@@ -60,11 +60,11 @@ static long hwdep_read(struct snd_hwdep *hwdep, char __user *buf, long count,
60 return count; 60 return count;
61} 61}
62 62
63static unsigned int hwdep_poll(struct snd_hwdep *hwdep, struct file *file, 63static __poll_t hwdep_poll(struct snd_hwdep *hwdep, struct file *file,
64 poll_table *wait) 64 poll_table *wait)
65{ 65{
66 struct snd_dg00x *dg00x = hwdep->private_data; 66 struct snd_dg00x *dg00x = hwdep->private_data;
67 unsigned int events; 67 __poll_t events;
68 68
69 poll_wait(file, &dg00x->hwdep_wait, wait); 69 poll_wait(file, &dg00x->hwdep_wait, wait);
70 70
diff --git a/sound/firewire/fireface/ff-hwdep.c b/sound/firewire/fireface/ff-hwdep.c
index 3ee04b054585..68e273fa5d23 100644
--- a/sound/firewire/fireface/ff-hwdep.c
+++ b/sound/firewire/fireface/ff-hwdep.c
@@ -52,11 +52,11 @@ static long hwdep_read(struct snd_hwdep *hwdep, char __user *buf, long count,
52 return count; 52 return count;
53} 53}
54 54
55static unsigned int hwdep_poll(struct snd_hwdep *hwdep, struct file *file, 55static __poll_t hwdep_poll(struct snd_hwdep *hwdep, struct file *file,
56 poll_table *wait) 56 poll_table *wait)
57{ 57{
58 struct snd_ff *ff = hwdep->private_data; 58 struct snd_ff *ff = hwdep->private_data;
59 unsigned int events; 59 __poll_t events;
60 60
61 poll_wait(file, &ff->hwdep_wait, wait); 61 poll_wait(file, &ff->hwdep_wait, wait);
62 62
diff --git a/sound/firewire/fireworks/fireworks_hwdep.c b/sound/firewire/fireworks/fireworks_hwdep.c
index a3a3a16f5e08..e0eff9328ee1 100644
--- a/sound/firewire/fireworks/fireworks_hwdep.c
+++ b/sound/firewire/fireworks/fireworks_hwdep.c
@@ -184,11 +184,11 @@ end:
184 return count; 184 return count;
185} 185}
186 186
187static unsigned int 187static __poll_t
188hwdep_poll(struct snd_hwdep *hwdep, struct file *file, poll_table *wait) 188hwdep_poll(struct snd_hwdep *hwdep, struct file *file, poll_table *wait)
189{ 189{
190 struct snd_efw *efw = hwdep->private_data; 190 struct snd_efw *efw = hwdep->private_data;
191 unsigned int events; 191 __poll_t events;
192 192
193 poll_wait(file, &efw->hwdep_wait, wait); 193 poll_wait(file, &efw->hwdep_wait, wait);
194 194
diff --git a/sound/firewire/motu/motu-hwdep.c b/sound/firewire/motu/motu-hwdep.c
index b87ccb69d597..7b6a086866e7 100644
--- a/sound/firewire/motu/motu-hwdep.c
+++ b/sound/firewire/motu/motu-hwdep.c
@@ -59,11 +59,11 @@ static long hwdep_read(struct snd_hwdep *hwdep, char __user *buf, long count,
59 return count; 59 return count;
60} 60}
61 61
62static unsigned int hwdep_poll(struct snd_hwdep *hwdep, struct file *file, 62static __poll_t hwdep_poll(struct snd_hwdep *hwdep, struct file *file,
63 poll_table *wait) 63 poll_table *wait)
64{ 64{
65 struct snd_motu *motu = hwdep->private_data; 65 struct snd_motu *motu = hwdep->private_data;
66 unsigned int events; 66 __poll_t events;
67 67
68 poll_wait(file, &motu->hwdep_wait, wait); 68 poll_wait(file, &motu->hwdep_wait, wait);
69 69
diff --git a/sound/firewire/oxfw/oxfw-hwdep.c b/sound/firewire/oxfw/oxfw-hwdep.c
index ff2687ad0460..6c1828aff672 100644
--- a/sound/firewire/oxfw/oxfw-hwdep.c
+++ b/sound/firewire/oxfw/oxfw-hwdep.c
@@ -52,11 +52,11 @@ static long hwdep_read(struct snd_hwdep *hwdep, char __user *buf, long count,
52 return count; 52 return count;
53} 53}
54 54
55static unsigned int hwdep_poll(struct snd_hwdep *hwdep, struct file *file, 55static __poll_t hwdep_poll(struct snd_hwdep *hwdep, struct file *file,
56 poll_table *wait) 56 poll_table *wait)
57{ 57{
58 struct snd_oxfw *oxfw = hwdep->private_data; 58 struct snd_oxfw *oxfw = hwdep->private_data;
59 unsigned int events; 59 __poll_t events;
60 60
61 poll_wait(file, &oxfw->hwdep_wait, wait); 61 poll_wait(file, &oxfw->hwdep_wait, wait);
62 62
diff --git a/sound/firewire/tascam/tascam-hwdep.c b/sound/firewire/tascam/tascam-hwdep.c
index 8c4437d0051d..37b21647b471 100644
--- a/sound/firewire/tascam/tascam-hwdep.c
+++ b/sound/firewire/tascam/tascam-hwdep.c
@@ -50,11 +50,11 @@ static long hwdep_read(struct snd_hwdep *hwdep, char __user *buf, long count,
50 return count; 50 return count;
51} 51}
52 52
53static unsigned int hwdep_poll(struct snd_hwdep *hwdep, struct file *file, 53static __poll_t hwdep_poll(struct snd_hwdep *hwdep, struct file *file,
54 poll_table *wait) 54 poll_table *wait)
55{ 55{
56 struct snd_tscm *tscm = hwdep->private_data; 56 struct snd_tscm *tscm = hwdep->private_data;
57 unsigned int events; 57 __poll_t events;
58 58
59 poll_wait(file, &tscm->hwdep_wait, wait); 59 poll_wait(file, &tscm->hwdep_wait, wait);
60 60
diff --git a/sound/oss/dmasound/dmasound_core.c b/sound/oss/dmasound/dmasound_core.c
index fb3bbceb1fef..6b57f8aac1b7 100644
--- a/sound/oss/dmasound/dmasound_core.c
+++ b/sound/oss/dmasound/dmasound_core.c
@@ -670,9 +670,9 @@ static ssize_t sq_write(struct file *file, const char __user *src, size_t uLeft,
670 return uUsed < 0? uUsed: uWritten; 670 return uUsed < 0? uUsed: uWritten;
671} 671}
672 672
673static unsigned int sq_poll(struct file *file, struct poll_table_struct *wait) 673static __poll_t sq_poll(struct file *file, struct poll_table_struct *wait)
674{ 674{
675 unsigned int mask = 0; 675 __poll_t mask = 0;
676 int retVal; 676 int retVal;
677 677
678 if (write_sq.locked == 0) { 678 if (write_sq.locked == 0) {
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
index e6359d341878..05ccc7fdcc09 100644
--- a/sound/usb/mixer_quirks.c
+++ b/sound/usb/mixer_quirks.c
@@ -240,7 +240,7 @@ static long snd_usb_sbrc_hwdep_read(struct snd_hwdep *hw, char __user *buf,
240 return err < 0 ? err : count; 240 return err < 0 ? err : count;
241} 241}
242 242
243static unsigned int snd_usb_sbrc_hwdep_poll(struct snd_hwdep *hw, struct file *file, 243static __poll_t snd_usb_sbrc_hwdep_poll(struct snd_hwdep *hw, struct file *file,
244 poll_table *wait) 244 poll_table *wait)
245{ 245{
246 struct usb_mixer_interface *mixer = hw->private_data; 246 struct usb_mixer_interface *mixer = hw->private_data;
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c
index 159da1f3924e..509680d9b698 100644
--- a/sound/usb/usx2y/us122l.c
+++ b/sound/usb/usx2y/us122l.c
@@ -271,12 +271,12 @@ out:
271 return err; 271 return err;
272} 272}
273 273
274static unsigned int usb_stream_hwdep_poll(struct snd_hwdep *hw, 274static __poll_t usb_stream_hwdep_poll(struct snd_hwdep *hw,
275 struct file *file, poll_table *wait) 275 struct file *file, poll_table *wait)
276{ 276{
277 struct us122l *us122l = hw->private_data; 277 struct us122l *us122l = hw->private_data;
278 unsigned *polled; 278 unsigned *polled;
279 unsigned int mask; 279 __poll_t mask;
280 280
281 poll_wait(file, &us122l->sk.sleep, wait); 281 poll_wait(file, &us122l->sk.sleep, wait);
282 282
diff --git a/sound/usb/usx2y/usX2Yhwdep.c b/sound/usb/usx2y/usX2Yhwdep.c
index f4b3cda412fc..8b0a1eae573c 100644
--- a/sound/usb/usx2y/usX2Yhwdep.c
+++ b/sound/usb/usx2y/usX2Yhwdep.c
@@ -86,9 +86,9 @@ static int snd_us428ctls_mmap(struct snd_hwdep * hw, struct file *filp, struct v
86 return 0; 86 return 0;
87} 87}
88 88
89static unsigned int snd_us428ctls_poll(struct snd_hwdep *hw, struct file *file, poll_table *wait) 89static __poll_t snd_us428ctls_poll(struct snd_hwdep *hw, struct file *file, poll_table *wait)
90{ 90{
91 unsigned int mask = 0; 91 __poll_t mask = 0;
92 struct usX2Ydev *us428 = hw->private_data; 92 struct usX2Ydev *us428 = hw->private_data;
93 struct us428ctls_sharedmem *shm = us428->us428ctls_sharedmem; 93 struct us428ctls_sharedmem *shm = us428->us428ctls_sharedmem;
94 if (us428->chip_status & USX2Y_STAT_CHIP_HUP) 94 if (us428->chip_status & USX2Y_STAT_CHIP_HUP)
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
index f2ac53ab8243..a334399fafec 100644
--- a/virt/kvm/eventfd.c
+++ b/virt/kvm/eventfd.c
@@ -188,7 +188,7 @@ irqfd_wakeup(wait_queue_entry_t *wait, unsigned mode, int sync, void *key)
188{ 188{
189 struct kvm_kernel_irqfd *irqfd = 189 struct kvm_kernel_irqfd *irqfd =
190 container_of(wait, struct kvm_kernel_irqfd, wait); 190 container_of(wait, struct kvm_kernel_irqfd, wait);
191 unsigned long flags = (unsigned long)key; 191 __poll_t flags = key_to_poll(key);
192 struct kvm_kernel_irq_routing_entry irq; 192 struct kvm_kernel_irq_routing_entry irq;
193 struct kvm *kvm = irqfd->kvm; 193 struct kvm *kvm = irqfd->kvm;
194 unsigned seq; 194 unsigned seq;
@@ -287,7 +287,7 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args)
287 struct fd f; 287 struct fd f;
288 struct eventfd_ctx *eventfd = NULL, *resamplefd = NULL; 288 struct eventfd_ctx *eventfd = NULL, *resamplefd = NULL;
289 int ret; 289 int ret;
290 unsigned int events; 290 __poll_t events;
291 int idx; 291 int idx;
292 292
293 if (!kvm_arch_intc_initialized(kvm)) 293 if (!kvm_arch_intc_initialized(kvm))