From b68243100d123b694006cd3c9dc50d4061c05afc Mon Sep 17 00:00:00 2001 From: Mikael Olsson Date: Tue, 14 Nov 2023 10:43:04 +0100 Subject: Fix NPU driver inference poll callback return type The poll file operation function pointer is expected to return the __poll_t type but the currently implemented poll inference function returns an unsigned int. This breaks the type safety and causes Sparse to generate a warning. To resolve this, the return type has been changed to __poll_t and the function now uses with EPOLL constants that share the same type. Change-Id: I41dadb758c7c4b42b431d96a94c6b2cc9f960013 Signed-off-by: Mikael Olsson --- kernel/ethosu_inference.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/ethosu_inference.c b/kernel/ethosu_inference.c index 57529f9..ac617c3 100644 --- a/kernel/ethosu_inference.c +++ b/kernel/ethosu_inference.c @@ -41,8 +41,8 @@ static int ethosu_inference_release(struct inode *inode, struct file *file); -static unsigned int ethosu_inference_poll(struct file *file, - poll_table *wait); +static __poll_t ethosu_inference_poll(struct file *file, + poll_table *wait); static long ethosu_inference_ioctl(struct file *file, unsigned int cmd, @@ -184,16 +184,16 @@ static int ethosu_inference_release(struct inode *inode, return 0; } -static unsigned int ethosu_inference_poll(struct file *file, - poll_table *wait) +static __poll_t ethosu_inference_poll(struct file *file, + poll_table *wait) { struct ethosu_inference *inf = file->private_data; - int ret = 0; + __poll_t ret = 0; poll_wait(file, &inf->waitq, wait); if (inf->done) - ret |= POLLIN; + ret |= EPOLLIN; return ret; } -- cgit v1.2.1