can: hi311x: hi3110_can_probe(): silence clang warning
authorMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 4 May 2021 19:55:10 +0000 (21:55 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 27 May 2021 07:42:22 +0000 (09:42 +0200)
This patch silences the following clang warning:

| drivers/net/can/spi/hi311x.c:874:17: warning: cast to smaller integer type
| 'enum hi3110_model' from 'const void *' [-Wvoid-pointer-to-enum-cast]
|                 priv->model = (enum hi3110_model)of_id->data;
|                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: 57e83fb9b746 ("can: hi311x: Add Holt HI-311x CAN driver")
Link: https://lore.kernel.org/r/20210504200520.1179635-3-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/spi/hi311x.c

index 6f5d6d04a8b969835e7151fc883d30e98c2a2a52..dd17b8c53e1c2f1f22d4ad73f61ad13b3b2fc582 100644 (file)
@@ -871,7 +871,7 @@ static int hi3110_can_probe(struct spi_device *spi)
                CAN_CTRLMODE_BERR_REPORTING;
 
        if (of_id)
-               priv->model = (enum hi3110_model)of_id->data;
+               priv->model = (enum hi3110_model)(uintptr_t)of_id->data;
        else
                priv->model = spi_get_device_id(spi)->driver_data;
        priv->net = net;