2013-08-18 11:01:47

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH v2] of_net.h: Make of_get_phy_mode() return int i.s.o. const int

include/linux/of_net.h:16: warning: type qualifiers ignored on function return type

Signed-off-by: Geert Uytterhoeven <[email protected]>
---
v2: update the actual function in drivers/of/of_net.c.

drivers/of/of_net.c | 2 +-
include/linux/of_net.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/of/of_net.c b/drivers/of/of_net.c
index ea174c8..8f9be2e 100644
--- a/drivers/of/of_net.c
+++ b/drivers/of/of_net.c
@@ -39,7 +39,7 @@ static const char *phy_modes[] = {
* The function gets phy interface string from property 'phy-mode',
* and return its index in phy_modes table, or errno in error case.
*/
-const int of_get_phy_mode(struct device_node *np)
+int of_get_phy_mode(struct device_node *np)
{
const char *pm;
int err, i;
diff --git a/include/linux/of_net.h b/include/linux/of_net.h
index 61bf53b..34597c8 100644
--- a/include/linux/of_net.h
+++ b/include/linux/of_net.h
@@ -9,10 +9,10 @@

#ifdef CONFIG_OF_NET
#include <linux/of.h>
-extern const int of_get_phy_mode(struct device_node *np);
+extern int of_get_phy_mode(struct device_node *np);
extern const void *of_get_mac_address(struct device_node *np);
#else
-static inline const int of_get_phy_mode(struct device_node *np)
+static inline int of_get_phy_mode(struct device_node *np)
{
return -ENODEV;
}
--
1.7.9.5


2013-08-28 19:51:02

by Grant Likely

[permalink] [raw]
Subject: Re: [PATCH v2] of_net.h: Make of_get_phy_mode() return int i.s.o. const int

On Sun, 18 Aug 2013 13:01:30 +0200, Geert Uytterhoeven <[email protected]> wrote:
> include/linux/of_net.h:16: warning: type qualifiers ignored on function return type
>
> Signed-off-by: Geert Uytterhoeven <[email protected]>
> ---

Applied, thanks.

g.

> v2: update the actual function in drivers/of/of_net.c.
>
> drivers/of/of_net.c | 2 +-
> include/linux/of_net.h | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/of/of_net.c b/drivers/of/of_net.c
> index ea174c8..8f9be2e 100644
> --- a/drivers/of/of_net.c
> +++ b/drivers/of/of_net.c
> @@ -39,7 +39,7 @@ static const char *phy_modes[] = {
> * The function gets phy interface string from property 'phy-mode',
> * and return its index in phy_modes table, or errno in error case.
> */
> -const int of_get_phy_mode(struct device_node *np)
> +int of_get_phy_mode(struct device_node *np)
> {
> const char *pm;
> int err, i;
> diff --git a/include/linux/of_net.h b/include/linux/of_net.h
> index 61bf53b..34597c8 100644
> --- a/include/linux/of_net.h
> +++ b/include/linux/of_net.h
> @@ -9,10 +9,10 @@
>
> #ifdef CONFIG_OF_NET
> #include <linux/of.h>
> -extern const int of_get_phy_mode(struct device_node *np);
> +extern int of_get_phy_mode(struct device_node *np);
> extern const void *of_get_mac_address(struct device_node *np);
> #else
> -static inline const int of_get_phy_mode(struct device_node *np)
> +static inline int of_get_phy_mode(struct device_node *np)
> {
> return -ENODEV;
> }
> --
> 1.7.9.5
>