[PATCH] net: miiphybb: Fix short name length

Multiple drivers copy MDIO name into struct bb_miiphy_bus name, but these two name fields have different length, the bb_miiphy_bus one is 16 bytes, the source one is 32 bytes. Make sure these two lengths are always synchronized, use MDIO_NAME_LEN for both.
Signed-off-by: Marek Vasut marek.vasut+renesas@mailbox.org --- Cc: Adam Ford aford173@gmail.com Cc: Hai Pham hai.pham.ud@renesas.com Cc: Ilias Apalodimas ilias.apalodimas@linaro.org Cc: Jerome Forissier jerome.forissier@linaro.org Cc: Joe Hershberger joe.hershberger@ni.com Cc: Mario Six mario.six@gdsys.cc Cc: Nobuhiro Iwamatsu nobuhiro.iwamatsu.yj@renesas.com Cc: Paul Barker paul.barker.ct@bp.renesas.com Cc: Peter Robinson pbrobinson@gmail.com Cc: Ramon Fried rfried.dev@gmail.com Cc: Sumit Garg sumit.garg@linaro.org Cc: Tom Rini trini@konsulko.com Cc: u-boot@lists.denx.de --- include/miiphy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/miiphy.h b/include/miiphy.h index 2bb4f62ea76..1e6c7041fdc 100644 --- a/include/miiphy.h +++ b/include/miiphy.h @@ -64,7 +64,7 @@ void mdio_list_devices(void); #define BB_MII_DEVNAME "bb_miiphy"
struct bb_miiphy_bus { - char name[16]; + char name[MDIO_NAME_LEN]; int (*init)(struct bb_miiphy_bus *bus); int (*mdio_active)(struct bb_miiphy_bus *bus); int (*mdio_tristate)(struct bb_miiphy_bus *bus);

On 18/01/2025 06:15, Marek Vasut wrote:
Multiple drivers copy MDIO name into struct bb_miiphy_bus name, but these two name fields have different length, the bb_miiphy_bus one is 16 bytes, the source one is 32 bytes. Make sure these two lengths are always synchronized, use MDIO_NAME_LEN for both.
Signed-off-by: Marek Vasut marek.vasut+renesas@mailbox.org
I would prefer something like the following so that it's clear which source struct we're referring to:
Multiple drivers copy the MDIO instance name from struct mii_phy to struct bb_miiphy_bus, but the name field in these two structs have different lengths...
With that changed,
Reviewed-by: Paul Barker paul.barker.ct@bp.renesas.com

On 1/21/25 12:56 PM, Paul Barker wrote:
On 18/01/2025 06:15, Marek Vasut wrote:
Multiple drivers copy MDIO name into struct bb_miiphy_bus name, but these two name fields have different length, the bb_miiphy_bus one is 16 bytes, the source one is 32 bytes. Make sure these two lengths are always synchronized, use MDIO_NAME_LEN for both.
Signed-off-by: Marek Vasut marek.vasut+renesas@mailbox.org
I would prefer something like the following so that it's clear which source struct we're referring to:
Multiple drivers copy the MDIO instance name from struct mii_phy to struct bb_miiphy_bus, but the name field in these two structs have different lengths...
With that changed,
Reviewed-by: Paul Barker paul.barker.ct@bp.renesas.com
Fixed in V2 , thanks.
participants (3)
-
Marek Vasut
-
Marek Vasut
-
Paul Barker