RE: [PATCH] misc: xilinx_sdfec: fix xsdfec_poll()'s return type
From: Dragan Cvetic
Date: Wed Nov 20 2019 - 14:08:53 EST
Hi Luc,
Thanks for the really useful answer.
I promise I'll test this soon.
Thanks
Dragan
> -----Original Message-----
> From: Luc Van Oostenryck [mailto:luc.vanoostenryck@xxxxxxxxx]
> Sent: Wednesday 20 November 2019 18:02
> To: Dragan Cvetic <draganc@xxxxxxxxxx>
> Cc: linux-kernel@xxxxxxxxxxxxxxx; Derek Kiernan <dkiernan@xxxxxxxxxx>
> Subject: Re: [PATCH] misc: xilinx_sdfec: fix xsdfec_poll()'s return type
>
> On Wed, Nov 20, 2019 at 03:59:24PM +0000, Dragan Cvetic wrote:
> > 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.
>
> Well, yes, it changed in July 2017.
>
> The current definition can be found in include/linux/fs.h:
> struct file_operations {
> ...
> __poll_t (*poll) (struct file *, struct poll_table_struct *);
> ...
>
> The main commit making the change is:
> a3f8683bf7d5 ("->poll() methods should return __poll_t")
>
>
> The result can be verified by compiling the driver with the command
> make C=2 path/to/the/driver.o
> which will use the static analyser 'sparse' to make additional checks
> where the difference between 'unsigned int' and __poll_t will matter.
> See Documentation/dev-tools/sparse.rst for more info about it.
>
> Best regards,
> -- Luc Van Oostenryck