* [U-Boot] [PATCH] tools: env: bug: config structs must be defined in tools library
@ 2016-03-25 13:52 Andreas Fenkart
2016-03-27 9:40 ` Stefano Babic
2016-03-27 22:30 ` [U-Boot] " Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Andreas Fenkart @ 2016-03-25 13:52 UTC (permalink / raw)
To: u-boot
fw_senten/fw_printenv can be compiled as a tools library,
excluding the fw_env_main object.
Reported-by: Stefano Babic <sbabic@denx.de>
Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
---
tools/env/fw_env.c | 4 ++++
tools/env/fw_env_main.c | 4 ----
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index ee17a69..2533dc4 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -34,6 +34,10 @@
#include "fw_env.h"
+struct common_args common_args;
+struct printenv_args printenv_args;
+struct setenv_args setenv_args;
+
#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
#define WHITESPACE(c) ((c == '\t') || (c == ' '))
diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c
index 4bd4216..3065de9 100644
--- a/tools/env/fw_env_main.c
+++ b/tools/env/fw_env_main.c
@@ -49,10 +49,6 @@ static struct option long_options[] = {
{NULL, 0, NULL, 0}
};
-struct common_args common_args;
-struct printenv_args printenv_args;
-struct setenv_args setenv_args;
-
void usage_printenv(void)
{
--
2.8.0.rc3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] tools: env: bug: config structs must be defined in tools library
2016-03-25 13:52 [U-Boot] [PATCH] tools: env: bug: config structs must be defined in tools library Andreas Fenkart
@ 2016-03-27 9:40 ` Stefano Babic
2016-03-27 22:30 ` [U-Boot] " Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Stefano Babic @ 2016-03-27 9:40 UTC (permalink / raw)
To: u-boot
Hi Andreas,
On 25/03/2016 14:52, Andreas Fenkart wrote:
> fw_senten/fw_printenv can be compiled as a tools library,
> excluding the fw_env_main object.
>
> Reported-by: Stefano Babic <sbabic@denx.de>
> Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
> ---
> tools/env/fw_env.c | 4 ++++
> tools/env/fw_env_main.c | 4 ----
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
> index ee17a69..2533dc4 100644
> --- a/tools/env/fw_env.c
> +++ b/tools/env/fw_env.c
> @@ -34,6 +34,10 @@
>
> #include "fw_env.h"
>
> +struct common_args common_args;
> +struct printenv_args printenv_args;
> +struct setenv_args setenv_args;
> +
This solves linking, but this makes the functions not reentrant. What
about to pass the parameters to the exported functions without any
global structure ?
> #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
>
> #define WHITESPACE(c) ((c == '\t') || (c == ' '))
> diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c
> index 4bd4216..3065de9 100644
> --- a/tools/env/fw_env_main.c
> +++ b/tools/env/fw_env_main.c
> @@ -49,10 +49,6 @@ static struct option long_options[] = {
> {NULL, 0, NULL, 0}
> };
>
> -struct common_args common_args;
> -struct printenv_args printenv_args;
> -struct setenv_args setenv_args;
> -
> void usage_printenv(void)
> {
>
>
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] tools: env: bug: config structs must be defined in tools library
2016-03-25 13:52 [U-Boot] [PATCH] tools: env: bug: config structs must be defined in tools library Andreas Fenkart
2016-03-27 9:40 ` Stefano Babic
@ 2016-03-27 22:30 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2016-03-27 22:30 UTC (permalink / raw)
To: u-boot
On Fri, Mar 25, 2016 at 02:52:19PM +0100, Andreas Fenkart wrote:
> fw_senten/fw_printenv can be compiled as a tools library,
> excluding the fw_env_main object.
>
> Reported-by: Stefano Babic <sbabic@denx.de>
> Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160327/62abaf7e/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-03-27 22:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-25 13:52 [U-Boot] [PATCH] tools: env: bug: config structs must be defined in tools library Andreas Fenkart
2016-03-27 9:40 ` Stefano Babic
2016-03-27 22:30 ` [U-Boot] " Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox