[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CH2PR02MB6359CE45D06E908634CDA855CB4F0@CH2PR02MB6359.namprd02.prod.outlook.com>
Date: Wed, 20 Nov 2019 15:59:24 +0000
From: Dragan Cvetic <draganc@...inx.com>
To: Luc Van Oostenryck <luc.vanoostenryck@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: Derek Kiernan <dkiernan@...inx.com>
Subject: RE: [PATCH] misc: xilinx_sdfec: fix xsdfec_poll()'s return type
Hi Luc,
For the sake of my understanding I'd like to ask you when the .pole method is defined
Why I'm asking this? I have a fairly new book (published in 2017) which suggests what is implemented in SDFEC driver.
I'll test your suggestions and will come back to you soon.
Regards
Dragan
> -----Original Message-----
> From: Luc Van Oostenryck [mailto:luc.vanoostenryck@...il.com]
> Sent: Wednesday 20 November 2019 00:11
> To: linux-kernel@...r.kernel.org
> Cc: Luc Van Oostenryck <luc.vanoostenryck@...il.com>; Derek Kiernan <dkiernan@...inx.com>; Dragan Cvetic
> <draganc@...inx.com>
> Subject: [PATCH] misc: xilinx_sdfec: fix xsdfec_poll()'s return type
>
> xsdfec_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: Derek Kiernan <derek.kiernan@...inx.com>
> CC: Dragan Cvetic <dragan.cvetic@...inx.com>
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@...il.com>
> ---
> drivers/misc/xilinx_sdfec.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/misc/xilinx_sdfec.c b/drivers/misc/xilinx_sdfec.c
> index 11835969e982..48ba7e02bed7 100644
> --- a/drivers/misc/xilinx_sdfec.c
> +++ b/drivers/misc/xilinx_sdfec.c
> @@ -1025,25 +1025,25 @@ static long xsdfec_dev_compat_ioctl(struct file *file, unsigned int cmd,
> }
> #endif
>
> -static unsigned int xsdfec_poll(struct file *file, poll_table *wait)
> +static __poll_t xsdfec_poll(struct file *file, poll_table *wait)
> {
> - unsigned int mask = 0;
> + __poll_t mask = 0;
> struct xsdfec_dev *xsdfec;
>
> xsdfec = container_of(file->private_data, struct xsdfec_dev, miscdev);
>
> if (!xsdfec)
> - return POLLNVAL | POLLHUP;
> + return EPOLLNVAL | EPOLLHUP;
>
> poll_wait(file, &xsdfec->waitq, wait);
>
> /* XSDFEC ISR detected an error */
> spin_lock_irqsave(&xsdfec->error_data_lock, xsdfec->flags);
> if (xsdfec->state_updated)
> - mask |= POLLIN | POLLPRI;
> + mask |= EPOLLIN | EPOLLPRI;
>
> if (xsdfec->stats_updated)
> - mask |= POLLIN | POLLRDNORM;
> + mask |= EPOLLIN | EPOLLRDNORM;
> spin_unlock_irqrestore(&xsdfec->error_data_lock, xsdfec->flags);
>
> return mask;
> --
> 2.24.0
Powered by blists - more mailing lists