diff mbox series

[1/2] drm/bridge: adv7511: fix Wvoid-pointer-to-enum-cast warning

Message ID 20230810095923.123388-1-krzysztof.kozlowski@linaro.org (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/bridge: adv7511: fix Wvoid-pointer-to-enum-cast warning | expand

Commit Message

Krzysztof Kozlowski Aug. 10, 2023, 9:59 a.m. UTC
'type' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  adv7511_drv.c:1214:19: error: cast to smaller integer type 'enum adv7511_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Laurent Pinchart Aug. 10, 2023, 10:12 a.m. UTC | #1
Hi Krzysztof,

Thank you for the patch.

On Thu, Aug 10, 2023 at 11:59:22AM +0200, Krzysztof Kozlowski wrote:
> 'type' is an enum, thus cast of pointer on 64-bit compile test with W=1
> causes:
> 
>   adv7511_drv.c:1214:19: error: cast to smaller integer type 'enum adv7511_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> index 2611afd2c1c1..0e284f379602 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> @@ -1211,7 +1211,7 @@ static int adv7511_probe(struct i2c_client *i2c)
>  	adv7511->status = connector_status_disconnected;
>  
>  	if (dev->of_node)
> -		adv7511->type = (enum adv7511_type)of_device_get_match_data(dev);
> +		adv7511->type = (uintptr_t)of_device_get_match_data(dev);
>  	else
>  		adv7511->type = id->driver_data;
>
Robert Foss Aug. 11, 2023, 1:15 p.m. UTC | #2
On Thu, Aug 10, 2023 at 12:12 PM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi Krzysztof,
>
> Thank you for the patch.
>
> On Thu, Aug 10, 2023 at 11:59:22AM +0200, Krzysztof Kozlowski wrote:
> > 'type' is an enum, thus cast of pointer on 64-bit compile test with W=1
> > causes:
> >
> >   adv7511_drv.c:1214:19: error: cast to smaller integer type 'enum adv7511_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
> >
> > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
>
> > ---
> >  drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > index 2611afd2c1c1..0e284f379602 100644
> > --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> > @@ -1211,7 +1211,7 @@ static int adv7511_probe(struct i2c_client *i2c)
> >       adv7511->status = connector_status_disconnected;
> >
> >       if (dev->of_node)
> > -             adv7511->type = (enum adv7511_type)of_device_get_match_data(dev);
> > +             adv7511->type = (uintptr_t)of_device_get_match_data(dev);
> >       else
> >               adv7511->type = id->driver_data;
> >
>
> --
> Regards,
>
> Laurent Pinchart
>

Ack for drm/bridge part.

Acked-by: Robert Foss <rfoss@kernel.org>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
index 2611afd2c1c1..0e284f379602 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
@@ -1211,7 +1211,7 @@  static int adv7511_probe(struct i2c_client *i2c)
 	adv7511->status = connector_status_disconnected;
 
 	if (dev->of_node)
-		adv7511->type = (enum adv7511_type)of_device_get_match_data(dev);
+		adv7511->type = (uintptr_t)of_device_get_match_data(dev);
 	else
 		adv7511->type = id->driver_data;