Skip to content

Commit

Permalink
can: hi311x: hi3110_can_probe(): silence clang warning
Browse files Browse the repository at this point in the history
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: 57e83fb ("can: hi311x: Add Holt HI-311x CAN driver")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Marc Kleine-Budde <[email protected]>
  • Loading branch information
marckleinebudde committed May 27, 2021
1 parent 9208f7b commit 8341566
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/can/spi/hi311x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8341566

Please sign in to comment.