Re: [PATCH] staging: r8188eu: Fix cast between incompatible function type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 02, 2021 at 01:32:41AM +0200, Fabio M. De Francesco wrote:
> Fix sparse warnings of casts between incompatible function
> types from ‘void (*)(void *)’ to ‘void (*)(long unsigned int)’
> [-Wcast-function-type].
> 
> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@xxxxxxxxx>
> ---
>  drivers/staging/r8188eu/hal/rtl8188eu_recv.c | 2 +-
>  drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/hal/rtl8188eu_recv.c b/drivers/staging/r8188eu/hal/rtl8188eu_recv.c
> index 2e3f624d0f22..ef722b4a9ddb 100644
> --- a/drivers/staging/r8188eu/hal/rtl8188eu_recv.c
> +++ b/drivers/staging/r8188eu/hal/rtl8188eu_recv.c
> @@ -38,7 +38,7 @@ int	rtl8188eu_init_recv_priv(struct adapter *padapter)
>  	struct recv_buf *precvbuf;
>  
>  	tasklet_init(&precvpriv->recv_tasklet,
> -		     (void(*)(unsigned long))rtl8188eu_recv_tasklet,
> +		     (void *)rtl8188eu_recv_tasklet,

The correct fix is to change rtl8188eu_recv_tasklet to take an unsigned
long instead of a pointer.  Then you can remove the casting entirely.

The rule here is that you should try avoid casting things to a void
pointer.

regards,
dan carpenter





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux