Skip to contentSkip to conversation

drm/crc-debugfs: fix crtc_crc_poll()'s return type

PATCH In review Luc Van Oostenryck 2 participants 2 messages Nov 20, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/crc-debugfs: fix crtc_crc_poll()'s return type

crtc_crc_poll() is defined as returning 'unsigned int' but the .poll method is declared as returning '__poll_t', a bitwise type.

Fix this by using the proper return type and using the EPOLL constants instead of the POLL ones, as required for __poll_t.

CC Maarten Lankhorst <[email protected]>
CC Maxime Ripard <[email protected]>
CC Sean Paul <[email protected]>
CC David Airlie <[email protected]>
CC Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_debugfs_crc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_debugfs_crc.c +3 -3
index be1b7ba92ffe..0bb0aa0ebbca 100644
@@ -334,17 +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;
 
 	poll_wait(file, &crc->wq, wait);
 
 	spin_lock_irq(&crc->lock);
 	if (crc->source && crtc_crc_data_count(crc))
-		ret = POLLIN | POLLRDNORM;
+		ret = EPOLLIN | EPOLLRDNORM;
 	else
 		ret = 0;
 	spin_unlock_irq(&crc->lock);
Signature · 1 line
2.24.0
#1 lore raw
Quoted 5 lines · Luc Van Oostenryck

crtc_crc_poll() is defined as returning 'unsigned int' but the .poll method is declared as returning '__poll_t', a bitwise type.

Fix this by using the proper return type and using the EPOLL constants instead of the POLL ones, as required for __poll_t.

Already fixed. 1ab2a99edb37 ("drm: Fix return type of crc .poll()")

Quoted 44 lines
CC Maarten Lankhorst <[email protected]>
CC Maxime Ripard <[email protected]>
CC Sean Paul <[email protected]>
CC David Airlie <[email protected]>
CC Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/drm_debugfs_crc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_debugfs_crc.c +3 -3
index be1b7ba92ffe..0bb0aa0ebbca 100644
@@ -334,17 +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;
 
 	poll_wait(file, &crc->wq, wait);
 
 	spin_lock_irq(&crc->lock);
 	if (crc->source && crtc_crc_data_count(crc))
-		ret = POLLIN | POLLRDNORM;
+		ret = EPOLLIN | EPOLLRDNORM;
 	else
 		ret = 0;
 	spin_unlock_irq(&crc->lock);
Signature · 6 lines
2.24.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 2 lines
Ville Syrjälä
Intel