Re: [can-nextc 1/2] can: mcp251x: mcp251x_can_probe(): silence clang warning

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

 



On 05.05.2021 13:13:41, Andy Shevchenko wrote:
> On Tue, May 04, 2021 at 10:05:19PM +0200, Marc Kleine-Budde wrote:
> > This patch silences the following clang warning:
> > 
> > | drivers/net/can/spi/mcp251x.c:1333:17: warning: cast to smaller integer type
> > | 'enum mcp251x_model' from 'const void *' [-Wvoid-pointer-to-enum-cast]
> > |                 priv->model = (enum mcp251x_model)match;
> > |                               ^~~~~~~~~~~~~~~~~~~~~~~~~
> > 
> > Fixes: 8de29a5c34a5 ("can: mcp251x: Make use of device property API")
> > Reported-by: kernel test robot <lkp@xxxxxxxxx>
> > Cc: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> > Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
> > ---
> >  drivers/net/can/spi/mcp251x.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c
> > index 492f1bcb0516..275b2ddab143 100644
> > --- a/drivers/net/can/spi/mcp251x.c
> > +++ b/drivers/net/can/spi/mcp251x.c
> > @@ -1343,7 +1343,7 @@ static int mcp251x_can_probe(struct spi_device *spi)
> >  	priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES |
> >  		CAN_CTRLMODE_LOOPBACK | CAN_CTRLMODE_LISTENONLY;
> >  	if (match)
> > -		priv->model = (enum mcp251x_model)match;
> > +		priv->model = (enum mcp251x_model)(kernel_ulong_t)match;
> 
> Usually we use uintptr_t, but either way

I've updated the patch to uintptr_t.

> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

Thanks,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux