Re: [PATCH] net: mdio-octeon: Fix build error and Kconfig warning

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

 



On Thu, Aug 1, 2019 at 1:52 AM Randy Dunlap <rdunlap@xxxxxxxxxxxxx> wrote:
> However, there are lots of type/cast warnings in both mdio-octeon and mdio-cavium:
>
> ../drivers/net/phy/mdio-octeon.c: In function ‘octeon_mdiobus_probe’:
> ../drivers/net/phy/mdio-octeon.c:48:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>    (u64)devm_ioremap(&pdev->dev, mdio_phys, regsize);
>    ^

cavium_mdiobus.register_base should be "void __iomem *" instead of "u64",
and the cast should be dropped.

> In file included from ../drivers/net/phy/mdio-octeon.c:14:0:
> ../drivers/net/phy/mdio-cavium.h:113:48: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>  #define oct_mdio_writeq(val, addr) writeq(val, (void *)addr)
>                                                 ^

... which allows to drop this cast as well.

Casts are evil, and usually a sign that you're doing something wrong.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Linux Kernel]     [Linux USB Development]     [Yosemite News]     [Linux SCSI]

  Powered by Linux