Skip to contentSkip to conversation

staging: fieldbus: core: fix ->poll() annotation

PATCH In review Sven Van Asbroeck 2 participants 4 messages May 21, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 staging: fieldbus: core: fix ->poll() annotation

From: Oscar Gomez Fuente <[email protected]>

->poll() functions should return __poll_t, but the fieldbus core's poll() does not. This generates a sparse warning.

Fix the ->poll() return value, and use recommended __poll_t constants (EPOLLxxx).

---
 drivers/staging/fieldbus/dev_core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/fieldbus/dev_core.c +3 -3
index 60b85140675a..f6f5b92ba914 100644
@@ -211,16 +211,16 @@ static ssize_t fieldbus_write(struct file *filp, const char __user *buf,
 	return fbdev->write_area(fbdev, buf, size, offset);
 }
 
-static unsigned int fieldbus_poll(struct file *filp, poll_table *wait)
+static __poll_t fieldbus_poll(struct file *filp, poll_table *wait)
 {
 	struct fb_open_file *of = filp->private_data;
 	struct fieldbus_dev *fbdev = of->fbdev;
-	unsigned int mask = POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM;
+	__poll_t mask = EPOLLIN | EPOLLRDNORM | EPOLLOUT | EPOLLWRNORM;
 
 	poll_wait(filp, &fbdev->dc_wq, wait);
 	/* data changed ? */
 	if (fbdev->dc_event != of->dc_event)
-		mask |= POLLPRI | POLLERR;
+		mask |= EPOLLPRI | EPOLLERR;
 	return mask;
 }
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 10 lines · Sven Van Asbroeck

From: Oscar Gomez Fuente <[email protected]>

->poll() functions should return __poll_t, but the fieldbus core's poll() does not. This generates a sparse warning.

Fix the ->poll() return value, and use recommended __poll_t constants (EPOLLxxx).

Please ignore this patch.

Quoted 1 line

/dev/null :)

#2 lore raw
In reply to Sven Van Asbroeck
Quoted 10 lines · Sven Van Asbroeck

From: Oscar Gomez Fuente <[email protected]>

->poll() functions should return __poll_t, but the fieldbus core's poll() does not. This generates a sparse warning.

Fix the ->poll() return value, and use recommended __poll_t constants (EPOLLxxx).

---

If you're resending someone's patch, you have to add your own Signed off by line as well. Everyone who touches a patch has to sign that they didn't add any of SCO's all powerful UnixWare source code into the patch.

regards,
dan carpenter

#3 lore raw
Quoted 7 lines · Dan Carpenter

If you're resending someone's patch, you have to add your own Signed off by line as well. Everyone who touches a patch has to sign that they didn't add any of SCO's all powerful UnixWare source code into the patch.

Thank you Dan, that's very useful to know !

Sven