Re: [PATCH] aspeed: fix snoop_file_poll()'s return type

From: Luc Van Oostenryck
Date: Thu Nov 21 2019 - 05:08:53 EST


On Thu, Nov 21, 2019 at 02:52:39AM +0000, Joel Stanley wrote:
> On Wed, 20 Nov 2019 at 05:42, Andrew Jeffery <andrew@xxxxxxxx> wrote:
> >
> > Looks fine to me as POLLIN and EPOLLIN evaluate to the same value despite
> > the type difference.
>
> I assume Luc was using sparse to check:
>
> CHECK ../drivers/soc/aspeed/aspeed-lpc-snoop.c
> ../drivers/soc/aspeed/aspeed-lpc-snoop.c:112:19: warning: incorrect
> type in initializer (different base types)
> ../drivers/soc/aspeed/aspeed-lpc-snoop.c:112:19: expected
> restricted __poll_t ( *poll )( ... )
> ../drivers/soc/aspeed/aspeed-lpc-snoop.c:112:19: got unsigned int (
> * )( ... )
>
> If you fix the return type:
>
> CHECK ../drivers/soc/aspeed/aspeed-lpc-snoop.c
> ../drivers/soc/aspeed/aspeed-lpc-snoop.c:106:45: warning: incorrect
> type in return expression (different base types)
> ../drivers/soc/aspeed/aspeed-lpc-snoop.c:106:45: expected restricted __poll_t
> ../drivers/soc/aspeed/aspeed-lpc-snoop.c:106:45: got int

Yes, but with the change s/POLLIN/EPOLLIN/ this last warning
is not issued.

Cheers,
-- Luc