diff for duplicates of <200910071715.57249.jezz@sysmic.org> diff --git a/a/1.txt b/N1/1.txt index 50bd383..0c2db88 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,32 +1,30 @@ Dear, -I have a problem with commit 8bc487d150b939e69830c39322df4ee486efe381=20 +I have a problem with commit 8bc487d150b939e69830c39322df4ee486efe381 in file drivers/of/of_mdio.c in function of_phy_find_device. -As you see, this function define match() as a nested function. My=20 -compiler (powerpc-e500-linux-gnu-gcc-3.4.1) raise an error during link=20 +As you see, this function define match() as a nested function. My +compiler (powerpc-e500-linux-gnu-gcc-3.4.1) raise an error during link due to this nested definition: - drivers/built-in.o(.text+0x5e2a4): In function `of_phy_find_device': /hom= -e/jezz/linux-next/drivers/of/of_mdio.c:107:=20 + drivers/built-in.o(.text+0x5e2a4): In function `of_phy_find_device': /home/jezz/linux-next/drivers/of/of_mdio.c:107: undefined reference to `__trampoline_setup' -I am sure I could solve problem by rebuilding my toolchain.=20 -Nevertheless, I think nested function definition is not perfectly=20 -supported by all compilers. Also, I suggest to place function match()=20 +I am sure I could solve problem by rebuilding my toolchain. +Nevertheless, I think nested function definition is not perfectly +supported by all compilers. Also, I suggest to place function match() outside of scope of of_phy_find_device as in following patch. diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c index bacaa53..c7b2e26 100644 -=2D-- a/drivers/of/of_mdio.c +--- a/drivers/of/of_mdio.c +++ b/drivers/of/of_mdio.c -@@ -97,6 +97,10 @@ int of_mdiobus_register(struct mii_bus *mdio, struct dev= -ice_node *np) +@@ -97,6 +97,10 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) } EXPORT_SYMBOL(of_mdiobus_register); +static int match(struct device *dev, void *phy_np) +{ -+ return dev_archdata_get_node(&dev->archdata) =3D=3D phy_np; ++ return dev_archdata_get_node(&dev->archdata) == phy_np; +} /** * of_phy_find_device - Give a PHY node, find the phy_device @@ -35,12 +33,11 @@ ice_node *np) struct phy_device *of_phy_find_device(struct device_node *phy_np) { struct device *d; -=2D int match(struct device *dev, void *phy_np) -=2D { -=2D return dev_archdata_get_node(&dev->archdata) =3D=3D phy_n= -p; -=2D } -=2D +- int match(struct device *dev, void *phy_np) +- { +- return dev_archdata_get_node(&dev->archdata) == phy_np; +- } +- if (!phy_np) return NULL; @@ -49,5 +46,5 @@ What do you think about it? Best regards, -=2D-=20 -J=E9r=F4me Pouiller (jezz AT sysmic DOT org) +-- +Jérôme Pouiller (jezz AT sysmic DOT org) diff --git a/a/content_digest b/N1/content_digest index 6d70b4f..b984d13 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -10,33 +10,31 @@ "b\0" "Dear,\n" "\n" - "I have a problem with commit 8bc487d150b939e69830c39322df4ee486efe381=20\n" + "I have a problem with commit 8bc487d150b939e69830c39322df4ee486efe381 \n" "in file drivers/of/of_mdio.c in function of_phy_find_device.\n" "\n" - "As you see, this function define match() as a nested function. My=20\n" - "compiler (powerpc-e500-linux-gnu-gcc-3.4.1) raise an error during link=20\n" + "As you see, this function define match() as a nested function. My \n" + "compiler (powerpc-e500-linux-gnu-gcc-3.4.1) raise an error during link \n" "due to this nested definition:\n" - " drivers/built-in.o(.text+0x5e2a4): In function `of_phy_find_device': /hom=\n" - "e/jezz/linux-next/drivers/of/of_mdio.c:107:=20\n" + " drivers/built-in.o(.text+0x5e2a4): In function `of_phy_find_device': /home/jezz/linux-next/drivers/of/of_mdio.c:107: \n" "undefined reference to `__trampoline_setup'\n" "\n" - "I am sure I could solve problem by rebuilding my toolchain.=20\n" - "Nevertheless, I think nested function definition is not perfectly=20\n" - "supported by all compilers. Also, I suggest to place function match()=20\n" + "I am sure I could solve problem by rebuilding my toolchain. \n" + "Nevertheless, I think nested function definition is not perfectly \n" + "supported by all compilers. Also, I suggest to place function match() \n" "outside of scope of of_phy_find_device as in following patch.\n" "\n" "diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c\n" "index bacaa53..c7b2e26 100644\n" - "=2D-- a/drivers/of/of_mdio.c\n" + "--- a/drivers/of/of_mdio.c\n" "+++ b/drivers/of/of_mdio.c\n" - "@@ -97,6 +97,10 @@ int of_mdiobus_register(struct mii_bus *mdio, struct dev=\n" - "ice_node *np)\n" + "@@ -97,6 +97,10 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)\n" " }\n" " EXPORT_SYMBOL(of_mdiobus_register);\n" "\n" "+static int match(struct device *dev, void *phy_np)\n" "+{\n" - "+ return dev_archdata_get_node(&dev->archdata) =3D=3D phy_np;\n" + "+ return dev_archdata_get_node(&dev->archdata) == phy_np;\n" "+}\n" " /**\n" " * of_phy_find_device - Give a PHY node, find the phy_device\n" @@ -45,12 +43,11 @@ " struct phy_device *of_phy_find_device(struct device_node *phy_np)\n" " {\n" " struct device *d;\n" - "=2D int match(struct device *dev, void *phy_np)\n" - "=2D {\n" - "=2D return dev_archdata_get_node(&dev->archdata) =3D=3D phy_n=\n" - "p;\n" - "=2D }\n" - "=2D\n" + "- int match(struct device *dev, void *phy_np)\n" + "- {\n" + "- return dev_archdata_get_node(&dev->archdata) == phy_np;\n" + "- }\n" + "-\n" " if (!phy_np)\n" " return NULL;\n" "\n" @@ -59,7 +56,7 @@ "\n" "Best regards,\n" "\n" - "=2D-=20\n" - J=E9r=F4me Pouiller (jezz AT sysmic DOT org) + "-- \n" + "J\303\251r\303\264me Pouiller (jezz AT sysmic DOT org)" -6c03a02760161ef854954455f310d71fec743ecd50af3beeaf7c2f0773abb415 +f81a40c99c38b61c30c89bce384acc9bd55526d67bb6691d218494dc8eb50145
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.