From: Ville Syrjälä Date: Wed, 10 Jul 2019 12:51:43 +0000 (+0300) Subject: drm: Fix return type of crc .poll() X-Git-Tag: v5.5-rc1~128^2~31^2~52 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1ab2a99edb374732f429282e3e8f89df1b0ceed2;p=thirdparty%2Flinux.git drm: Fix return type of crc .poll() Sparse compains: ../drivers/gpu/drm/drm_debugfs_crc.c:350:17: warning: incorrect type in initializer (different base types) ../drivers/gpu/drm/drm_debugfs_crc.c:350:17: expected restricted __poll_t ( *poll )( ... ) ../drivers/gpu/drm/drm_debugfs_crc.c:350:17: got unsigned int ( * )( ... ) Change the .poll() return type to __poll_t to silence it. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20190710125143.9965-5-ville.syrjala@linux.intel.com Reviewed-by: Sean Paul --- diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c index be1b7ba92ffe1..ca3c55c6b8155 100644 --- a/drivers/gpu/drm/drm_debugfs_crc.c +++ b/drivers/gpu/drm/drm_debugfs_crc.c @@ -334,19 +334,17 @@ static ssize_t crtc_crc_read(struct file *filep, char __user *user_buf, return LINE_LEN(crc->values_cnt); } -static unsigned int crtc_crc_poll(struct file *file, poll_table *wait) +static __poll_t crtc_crc_poll(struct file *file, poll_table *wait) { struct drm_crtc *crtc = file->f_inode->i_private; struct drm_crtc_crc *crc = &crtc->crc; - unsigned ret; + __poll_t ret = 0; poll_wait(file, &crc->wq, wait); spin_lock_irq(&crc->lock); if (crc->source && crtc_crc_data_count(crc)) - ret = POLLIN | POLLRDNORM; - else - ret = 0; + ret |= EPOLLIN | EPOLLRDNORM; spin_unlock_irq(&crc->lock); return ret;