mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] param: dev_add_param_mac() depends on CONFIG_NET
@ 2015-10-02 12:35 Markus Pargmann
  2015-10-05  6:24 ` Sascha Hauer
  2015-10-07  6:34 ` Sascha Hauer
  0 siblings, 2 replies; 4+ messages in thread
From: Markus Pargmann @ 2015-10-02 12:35 UTC (permalink / raw)
  To: barebox

This patch adds the proper inline function for CONFIG_PARAMETER && !
CONFIG_NET.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
 include/param.h | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/include/param.h b/include/param.h
index 3a851fc552a4..f8a2534ef3a8 100644
--- a/include/param.h
+++ b/include/param.h
@@ -63,10 +63,12 @@ struct param_d *dev_add_param_ip(struct device_d *dev, const char *name,
 		int (*get)(struct param_d *p, void *priv),
 		IPaddr_t *ip, void *priv);
 
+#ifdef CONFIG_NET
 struct param_d *dev_add_param_mac(struct device_d *dev, const char *name,
 		int (*set)(struct param_d *p, void *priv),
 		int (*get)(struct param_d *p, void *priv),
 		u8 *mac, void *priv);
+#endif
 
 int dev_add_param_fixed(struct device_d *dev, const char *name, const char *value);
 
@@ -154,14 +156,6 @@ static inline struct param_d *dev_add_param_ip(struct device_d *dev, const char
 	return ERR_PTR(-ENOSYS);
 }
 
-static inline struct param_d *dev_add_param_mac(struct device_d *dev, const char *name,
-		int (*set)(struct param_d *p, void *priv),
-		int (*get)(struct param_d *p, void *priv),
-		u8 *mac, void *priv)
-{
-	return ERR_PTR(-ENOSYS);
-}
-
 static inline int dev_add_param_fixed(struct device_d *dev, const char *name, const char *value)
 {
 	return 0;
@@ -178,4 +172,15 @@ static inline int dev_param_set_generic(struct device_d *dev, struct param_d *p,
 }
 #endif
 
+#if ! defined(CONFIG_PARAMETER) || ! defined(CONFIG_NET)
+static inline struct param_d *dev_add_param_mac(struct device_d *dev, const char *name,
+		int (*set)(struct param_d *p, void *priv),
+		int (*get)(struct param_d *p, void *priv),
+		u8 *mac, void *priv)
+{
+	return ERR_PTR(-ENOSYS);
+}
+
+#endif
+
 #endif /* PARAM_H */
-- 
2.6.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] param: dev_add_param_mac() depends on CONFIG_NET
  2015-10-02 12:35 [PATCH] param: dev_add_param_mac() depends on CONFIG_NET Markus Pargmann
@ 2015-10-05  6:24 ` Sascha Hauer
  2015-10-07  6:34 ` Sascha Hauer
  1 sibling, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2015-10-05  6:24 UTC (permalink / raw)
  To: Markus Pargmann; +Cc: barebox

On Fri, Oct 02, 2015 at 02:35:01PM +0200, Markus Pargmann wrote:
> This patch adds the proper inline function for CONFIG_PARAMETER && !
> CONFIG_NET.
> 
> Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> ---

Applied, thanks

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] param: dev_add_param_mac() depends on CONFIG_NET
  2015-10-02 12:35 [PATCH] param: dev_add_param_mac() depends on CONFIG_NET Markus Pargmann
  2015-10-05  6:24 ` Sascha Hauer
@ 2015-10-07  6:34 ` Sascha Hauer
  2015-10-07 13:22   ` Markus Pargmann
  1 sibling, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2015-10-07  6:34 UTC (permalink / raw)
  To: Markus Pargmann; +Cc: barebox

Hi Markus,

On Fri, Oct 02, 2015 at 02:35:01PM +0200, Markus Pargmann wrote:
> This patch adds the proper inline function for CONFIG_PARAMETER && !
> CONFIG_NET.
> 
> Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> ---
>  include/param.h | 21 +++++++++++++--------
>  1 file changed, 13 insertions(+), 8 deletions(-)
> 
> diff --git a/include/param.h b/include/param.h
> index 3a851fc552a4..f8a2534ef3a8 100644
> --- a/include/param.h
> +++ b/include/param.h
> @@ -63,10 +63,12 @@ struct param_d *dev_add_param_ip(struct device_d *dev, const char *name,
>  		int (*get)(struct param_d *p, void *priv),
>  		IPaddr_t *ip, void *priv);
>  
> +#ifdef CONFIG_NET
>  struct param_d *dev_add_param_mac(struct device_d *dev, const char *name,
>  		int (*set)(struct param_d *p, void *priv),
>  		int (*get)(struct param_d *p, void *priv),
>  		u8 *mac, void *priv);
> +#endif
>  
>  int dev_add_param_fixed(struct device_d *dev, const char *name, const char *value);
>  
> @@ -154,14 +156,6 @@ static inline struct param_d *dev_add_param_ip(struct device_d *dev, const char
>  	return ERR_PTR(-ENOSYS);
>  }
>  
> -static inline struct param_d *dev_add_param_mac(struct device_d *dev, const char *name,
> -		int (*set)(struct param_d *p, void *priv),
> -		int (*get)(struct param_d *p, void *priv),
> -		u8 *mac, void *priv)
> -{
> -	return ERR_PTR(-ENOSYS);
> -}
> -
>  static inline int dev_add_param_fixed(struct device_d *dev, const char *name, const char *value)
>  {
>  	return 0;
> @@ -178,4 +172,15 @@ static inline int dev_param_set_generic(struct device_d *dev, struct param_d *p,
>  }
>  #endif
>  
> +#if ! defined(CONFIG_PARAMETER) || ! defined(CONFIG_NET)
> +static inline struct param_d *dev_add_param_mac(struct device_d *dev, const char *name,
> +		int (*set)(struct param_d *p, void *priv),
> +		int (*get)(struct param_d *p, void *priv),
> +		u8 *mac, void *priv)
> +{
> +	return ERR_PTR(-ENOSYS);
> +}

Reverted this patch because with it we get a redifinition of
dev_add_param_mac when CONFIG_PARAMETER is enabled but CONFIG_NET is
disabled:

lib/parameter.c:729:17: error: redefinition of 'dev_add_param_mac'
 struct param_d *dev_add_param_mac(struct device_d *dev, const char *name,
                 ^
In file included from include/console.h:23:0,
                 from include/stdio.h:5,
                 from include/common.h:23,
                 from lib/parameter.c:24:
include/param.h:176:31: note: previous definition of 'dev_add_param_mac' was here
 static inline struct param_d *dev_add_param_mac(struct device_d *dev, const char *name,
                               ^
scripts/Makefile.build:249: recipe for target 'lib/parameter.o' failed

Looking at it the behaviour was fine without this patch. What was the
motivation creating it?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] param: dev_add_param_mac() depends on CONFIG_NET
  2015-10-07  6:34 ` Sascha Hauer
@ 2015-10-07 13:22   ` Markus Pargmann
  0 siblings, 0 replies; 4+ messages in thread
From: Markus Pargmann @ 2015-10-07 13:22 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox


[-- Attachment #1.1: Type: text/plain, Size: 3842 bytes --]

On Wed, Oct 07, 2015 at 08:34:51AM +0200, Sascha Hauer wrote:
> Hi Markus,
> 
> On Fri, Oct 02, 2015 at 02:35:01PM +0200, Markus Pargmann wrote:
> > This patch adds the proper inline function for CONFIG_PARAMETER && !
> > CONFIG_NET.
> > 
> > Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> > ---
> >  include/param.h | 21 +++++++++++++--------
> >  1 file changed, 13 insertions(+), 8 deletions(-)
> > 
> > diff --git a/include/param.h b/include/param.h
> > index 3a851fc552a4..f8a2534ef3a8 100644
> > --- a/include/param.h
> > +++ b/include/param.h
> > @@ -63,10 +63,12 @@ struct param_d *dev_add_param_ip(struct device_d *dev, const char *name,
> >  		int (*get)(struct param_d *p, void *priv),
> >  		IPaddr_t *ip, void *priv);
> >  
> > +#ifdef CONFIG_NET
> >  struct param_d *dev_add_param_mac(struct device_d *dev, const char *name,
> >  		int (*set)(struct param_d *p, void *priv),
> >  		int (*get)(struct param_d *p, void *priv),
> >  		u8 *mac, void *priv);
> > +#endif
> >  
> >  int dev_add_param_fixed(struct device_d *dev, const char *name, const char *value);
> >  
> > @@ -154,14 +156,6 @@ static inline struct param_d *dev_add_param_ip(struct device_d *dev, const char
> >  	return ERR_PTR(-ENOSYS);
> >  }
> >  
> > -static inline struct param_d *dev_add_param_mac(struct device_d *dev, const char *name,
> > -		int (*set)(struct param_d *p, void *priv),
> > -		int (*get)(struct param_d *p, void *priv),
> > -		u8 *mac, void *priv)
> > -{
> > -	return ERR_PTR(-ENOSYS);
> > -}
> > -
> >  static inline int dev_add_param_fixed(struct device_d *dev, const char *name, const char *value)
> >  {
> >  	return 0;
> > @@ -178,4 +172,15 @@ static inline int dev_param_set_generic(struct device_d *dev, struct param_d *p,
> >  }
> >  #endif
> >  
> > +#if ! defined(CONFIG_PARAMETER) || ! defined(CONFIG_NET)
> > +static inline struct param_d *dev_add_param_mac(struct device_d *dev, const char *name,
> > +		int (*set)(struct param_d *p, void *priv),
> > +		int (*get)(struct param_d *p, void *priv),
> > +		u8 *mac, void *priv)
> > +{
> > +	return ERR_PTR(-ENOSYS);
> > +}
> 
> Reverted this patch because with it we get a redifinition of
> dev_add_param_mac when CONFIG_PARAMETER is enabled but CONFIG_NET is
> disabled:

This seems to be already solved differently mainline, sorry. That's why
the build failed with that setup.

Best Regards,

Markus

> 
> lib/parameter.c:729:17: error: redefinition of 'dev_add_param_mac'
>  struct param_d *dev_add_param_mac(struct device_d *dev, const char *name,
>                  ^
> In file included from include/console.h:23:0,
>                  from include/stdio.h:5,
>                  from include/common.h:23,
>                  from lib/parameter.c:24:
> include/param.h:176:31: note: previous definition of 'dev_add_param_mac' was here
>  static inline struct param_d *dev_add_param_mac(struct device_d *dev, const char *name,
>                                ^
> scripts/Makefile.build:249: recipe for target 'lib/parameter.o' failed
> 
> Looking at it the behaviour was fine without this patch. What was the
> motivation creating it?
> 
> Sascha
> 
> -- 
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-07 13:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-02 12:35 [PATCH] param: dev_add_param_mac() depends on CONFIG_NET Markus Pargmann
2015-10-05  6:24 ` Sascha Hauer
2015-10-07  6:34 ` Sascha Hauer
2015-10-07 13:22   ` Markus Pargmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox