* [PATCH] ipmi: fix ipmb_poll()'s return type
@ 2019-11-20 0:07 Luc Van Oostenryck
2019-11-22 19:40 ` Corey Minyard
0 siblings, 1 reply; 3+ messages in thread
From: Luc Van Oostenryck @ 2019-11-20 0:07 UTC (permalink / raw)
To: linux-kernel
Cc: Luc Van Oostenryck, Corey Minyard, openipmi-developer,
Greg Kroah-Hartman
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.
CC: Corey Minyard <minyard@acm.org>
CC: openipmi-developer@lists.sourceforge.net
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
drivers/char/ipmi/ipmb_dev_int.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/char/ipmi/ipmb_dev_int.c b/drivers/char/ipmi/ipmb_dev_int.c
index 285e0b8f9a97..2ea51147c3e8 100644
--- a/drivers/char/ipmi/ipmb_dev_int.c
+++ b/drivers/char/ipmi/ipmb_dev_int.c
@@ -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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ipmi: fix ipmb_poll()'s return type
2019-11-20 0:07 [PATCH] ipmi: fix ipmb_poll()'s return type Luc Van Oostenryck
@ 2019-11-22 19:40 ` Corey Minyard
2019-11-22 19:43 ` Asmaa Mnebhi
0 siblings, 1 reply; 3+ messages in thread
From: Corey Minyard @ 2019-11-22 19:40 UTC (permalink / raw)
To: Luc Van Oostenryck
Cc: linux-kernel, openipmi-developer, Greg Kroah-Hartman, Asmaa Mnebhi
On Wed, Nov 20, 2019 at 01:07:41AM +0100, Luc Van Oostenryck wrote:
> 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
>
> CC: Corey Minyard <minyard@acm.org>
> CC: openipmi-developer@lists.sourceforge.net
> CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
> ---
> drivers/char/ipmi/ipmb_dev_int.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/char/ipmi/ipmb_dev_int.c b/drivers/char/ipmi/ipmb_dev_int.c
> index 285e0b8f9a97..2ea51147c3e8 100644
> --- a/drivers/char/ipmi/ipmb_dev_int.c
> +++ b/drivers/char/ipmi/ipmb_dev_int.c
> @@ -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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] ipmi: fix ipmb_poll()'s return type
2019-11-22 19:40 ` Corey Minyard
@ 2019-11-22 19:43 ` Asmaa Mnebhi
0 siblings, 0 replies; 3+ messages in thread
From: Asmaa Mnebhi @ 2019-11-22 19:43 UTC (permalink / raw)
To: minyard, Luc Van Oostenryck
Cc: linux-kernel, openipmi-developer, Greg Kroah-Hartman
Reviewed-by: Asmaa Mnebhi <asmaa@mellanox.com>
-----Original Message-----
From: Corey Minyard <tcminyard@gmail.com> On Behalf Of Corey Minyard
Sent: Friday, November 22, 2019 2:41 PM
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: linux-kernel@vger.kernel.org; openipmi-developer@lists.sourceforge.net; Greg Kroah-Hartman <gregkh@linuxfoundation.org>; Asmaa Mnebhi <Asmaa@mellanox.com>
Subject: Re: [PATCH] ipmi: fix ipmb_poll()'s return type
On Wed, Nov 20, 2019 at 01:07:41AM +0100, Luc Van Oostenryck wrote:
> 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
>
> CC: Corey Minyard <minyard@acm.org>
> CC: openipmi-developer@lists.sourceforge.net
> CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
> ---
> drivers/char/ipmi/ipmb_dev_int.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/char/ipmi/ipmb_dev_int.c
> b/drivers/char/ipmi/ipmb_dev_int.c
> index 285e0b8f9a97..2ea51147c3e8 100644
> --- a/drivers/char/ipmi/ipmb_dev_int.c
> +++ b/drivers/char/ipmi/ipmb_dev_int.c
> @@ -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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-22 19:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-20 0:07 [PATCH] ipmi: fix ipmb_poll()'s return type Luc Van Oostenryck
2019-11-22 19:40 ` Corey Minyard
2019-11-22 19:43 ` Asmaa Mnebhi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).