ipmi: fix ipmb_poll()'s return type
PATCH 1/1 ipmi: fix ipmb_poll()'s return type
ipmb_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.
--- drivers/char/ipmi/ipmb_dev_int.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/char/ipmi/ipmb_dev_int.c +3 -3
@@ -154,16 +154,16 @@ static ssize_t ipmb_write(struct file *file, const char __user *buf,return ret ? : count; } -static unsigned int ipmb_poll (struct file *file,poll_table *wait) +static __poll_t ipmb_poll (struct file *file,poll_table *wait) {struct ipmb_dev *ipmb_dev =to_ipmb_dev (file); -unsigned int mask =POLLOUT ; +__poll_t mask =EPOLLOUT ;mutex_lock (&ipmb_dev->file_mutex);poll_wait (file, &ipmb_dev->wait_queue, wait);if (atomic_read (&ipmb_dev->request_queue_len)) - mask |=POLLIN ; + mask |=EPOLLIN ;mutex_unlock (&ipmb_dev->file_mutex);return mask;
Signature · 1 line
2.24.0
Quoted 5 lines · Luc Van Oostenryck
ipmb_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.
Copying the author for comment, but this looks ok with me.
-corey
Quoted 36 lines
CC Corey Minyard <[email protected]>CC Greg Kroah-Hartman <[email protected]>Signed-off-by Luc Van Oostenryck <[email protected]>--- drivers/char/ipmi/ipmb_dev_int.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/char/ipmi/ipmb_dev_int.c +3
-3@@ -154,16 +154,16 @@ static ssize_t ipmb_write(struct file *file, const char __user *buf,return ret ? : count; } -static unsigned int ipmb_poll (struct file *file,poll_table *wait) +static __poll_t ipmb_poll (struct file *file,poll_table *wait) {struct ipmb_dev *ipmb_dev =to_ipmb_dev (file); -unsigned int mask =POLLOUT ; +__poll_t mask =EPOLLOUT ;mutex_lock (&ipmb_dev->file_mutex);poll_wait (file, &ipmb_dev->wait_queue, wait);if (atomic_read (&ipmb_dev->request_queue_len)) - mask |=POLLIN ; + mask |=EPOLLIN ;mutex_unlock (&ipmb_dev->file_mutex);return mask;Signature · 1 line
2.24.0
Asmaa Mnebhi
Reviewed-by-----Original Message-----
From: Corey Minyard <[email protected]> On Behalf Of Corey Minyard
Sent: Friday, November 22, 2019 2:41 PM
To: Luc Van Oostenryck <[email protected]>
Cc: [email protected]; [email protected]; Greg Kroah-Hartman <[email protected]>; Asmaa Mnebhi <[email protected]>
Subject: Re: [PATCH] ipmi: fix ipmb_poll()'s return type
Quoted 5 lines · Luc Van Oostenryck
ipmb_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.
Copying the author for comment, but this looks ok with me.
-corey
Quoted 37 lines
CC Corey Minyard <[email protected]>CC Greg Kroah-Hartman <[email protected]>Signed-off-by Luc Van Oostenryck <[email protected]>--- drivers/char/ipmi/ipmb_dev_int.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/char/ipmi/ipmb_dev_int.c +3
-4@@ -154,16 +154,16 @@ static ssize_t ipmb_write(struct file *file, const char __user *buf,return ret ? : count; } -static unsigned int ipmb_poll (struct file *file,poll_table *wait) +static __poll_t ipmb_poll (struct file *file,poll_table *wait) {struct ipmb_dev *ipmb_dev =to_ipmb_dev (file); -unsigned int mask =POLLOUT ; +__poll_t mask =EPOLLOUT ;mutex_lock (&ipmb_dev->file_mutex);poll_wait (file, &ipmb_dev->wait_queue, wait);if (atomic_read (&ipmb_dev->request_queue_len)) - mask |=POLLIN ; + mask |=EPOLLIN ;mutex_unlock (&ipmb_dev->file_mutex);return mask; --2.24.0