* [U-Boot] [PATCH] UBIFS: Change ubifsload to set the filesize variable
@ 2011-09-05 11:03 Bastian Ruppert
2011-09-05 11:27 ` Wolfgang Denk
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Bastian Ruppert @ 2011-09-05 11:03 UTC (permalink / raw)
To: u-boot
This is the same behaviour like tftp or fatload command.
Signed-off-by: Bastian Ruppert <Bastian.Ruppert@Sewerin.de>
CC: kmpark at infradead.org
---
fs/ubifs/ubifs.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index 5a5c739..2b9d2d2 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -688,6 +688,7 @@ int ubifs_load(char *filename, u32 addr, u32 size)
int i;
int count;
int last_block_size = 0;
+ char buf [10];
c->ubi = ubi_open_volume(c->vi.ubi_num, c->vi.vol_id, UBI_READONLY);
/* ubifs_findfile will resolve symlinks, so we know that we get
@@ -719,6 +720,9 @@ int ubifs_load(char *filename, u32 addr, u32 size)
printf("Loading file '%s' to addr 0x%08x with size %d (0x%08x)...\n",
filename, addr, size, size);
+ sprintf(buf, "%lX", size);
+ setenv("filesize", buf);
+
page.addr = (void *)addr;
page.index = 0;
page.inode = inode;
--
1.6.3.3
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] UBIFS: Change ubifsload to set the filesize variable
2011-09-05 11:03 [U-Boot] [PATCH] UBIFS: Change ubifsload to set the filesize variable Bastian Ruppert
@ 2011-09-05 11:27 ` Wolfgang Denk
2011-09-05 13:03 ` [U-Boot] [PATCH v2] " Bastian Ruppert
2011-09-05 13:12 ` [U-Boot] [PATCH] UBIFS: Change ubifsload to set the filesize variable Marek Vasut
2 siblings, 0 replies; 10+ messages in thread
From: Wolfgang Denk @ 2011-09-05 11:27 UTC (permalink / raw)
To: u-boot
Dear Bastian Ruppert,
In message <1315220629-9192-1-git-send-email-Bastian.Ruppert@Sewerin.de> you wrote:
> This is the same behaviour like tftp or fatload command.
> @@ -719,6 +720,9 @@ int ubifs_load(char *filename, u32 addr, u32 size)
> printf("Loading file '%s' to addr 0x%08x with size %d (0x%08x)...\n",
> filename, addr, size, size);
>
> + sprintf(buf, "%lX", size);
> + setenv("filesize", buf);
> +
Please insert this piece of code _after_ the file has successfully
been loaded to RAM (not before starting to load it).
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I wrote my name at the top of the page. I wrote down the number of
the question ``1''. After much reflection I put a bracket round it
thus ``(1)''. But thereafter I could not think of anything connected
with it that was either relevant or true.
- Sir Winston Churchill _My Early Life_ ch. 2
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH v2] UBIFS: Change ubifsload to set the filesize variable
2011-09-05 11:03 [U-Boot] [PATCH] UBIFS: Change ubifsload to set the filesize variable Bastian Ruppert
2011-09-05 11:27 ` Wolfgang Denk
@ 2011-09-05 13:03 ` Bastian Ruppert
2011-09-09 12:12 ` Detlev Zundel
` (2 more replies)
2011-09-05 13:12 ` [U-Boot] [PATCH] UBIFS: Change ubifsload to set the filesize variable Marek Vasut
2 siblings, 3 replies; 10+ messages in thread
From: Bastian Ruppert @ 2011-09-05 13:03 UTC (permalink / raw)
To: u-boot
This is the same behaviour like tftp or fatload command.
Signed-off-by: Bastian Ruppert <Bastian.Ruppert@Sewerin.de>
CC: kmpark at infradead.org
---
fs/ubifs/ubifs.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index 5a5c739..75a2edc 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -688,6 +688,7 @@ int ubifs_load(char *filename, u32 addr, u32 size)
int i;
int count;
int last_block_size = 0;
+ char buf [10];
c->ubi = ubi_open_volume(c->vi.ubi_num, c->vi.vol_id, UBI_READONLY);
/* ubifs_findfile will resolve symlinks, so we know that we get
@@ -739,8 +740,11 @@ int ubifs_load(char *filename, u32 addr, u32 size)
if (err)
printf("Error reading file '%s'\n", filename);
- else
+ else {
+ sprintf(buf, "%lX", size);
+ setenv("filesize", buf);
printf("Done\n");
+ }
ubifs_iput(inode);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] UBIFS: Change ubifsload to set the filesize variable
2011-09-05 11:03 [U-Boot] [PATCH] UBIFS: Change ubifsload to set the filesize variable Bastian Ruppert
2011-09-05 11:27 ` Wolfgang Denk
2011-09-05 13:03 ` [U-Boot] [PATCH v2] " Bastian Ruppert
@ 2011-09-05 13:12 ` Marek Vasut
2011-09-05 14:27 ` Wolfgang Denk
2 siblings, 1 reply; 10+ messages in thread
From: Marek Vasut @ 2011-09-05 13:12 UTC (permalink / raw)
To: u-boot
On Monday, September 05, 2011 01:03:49 PM Bastian Ruppert wrote:
> This is the same behaviour like tftp or fatload command.
>
> Signed-off-by: Bastian Ruppert <Bastian.Ruppert@Sewerin.de>
> CC: kmpark at infradead.org
> ---
> fs/ubifs/ubifs.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
> index 5a5c739..2b9d2d2 100644
> --- a/fs/ubifs/ubifs.c
> +++ b/fs/ubifs/ubifs.c
> @@ -688,6 +688,7 @@ int ubifs_load(char *filename, u32 addr, u32 size)
> int i;
> int count;
> int last_block_size = 0;
> + char buf [10];
>
> c->ubi = ubi_open_volume(c->vi.ubi_num, c->vi.vol_id, UBI_READONLY);
> /* ubifs_findfile will resolve symlinks, so we know that we get
> @@ -719,6 +720,9 @@ int ubifs_load(char *filename, u32 addr, u32 size)
> printf("Loading file '%s' to addr 0x%08x with size %d (0x%08x)...\n",
> filename, addr, size, size);
>
> + sprintf(buf, "%lX", size);
> + setenv("filesize", buf);
> +
Hi,
maybe you want to check set_local_var() too ?
> page.addr = (void *)addr;
> page.index = 0;
> page.inode = inode;
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] UBIFS: Change ubifsload to set the filesize variable
2011-09-05 13:12 ` [U-Boot] [PATCH] UBIFS: Change ubifsload to set the filesize variable Marek Vasut
@ 2011-09-05 14:27 ` Wolfgang Denk
2011-09-05 15:04 ` Marek Vasut
0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Denk @ 2011-09-05 14:27 UTC (permalink / raw)
To: u-boot
Dear Marek Vasut,
In message <201109051512.48148.marek.vasut@gmail.com> you wrote:
>
> > + setenv("filesize", buf);
>
> maybe you want to check set_local_var() too ?
Yes, we should clean up all these auto-generated environment variables
one day. But what you propose here is not a good approach:
(1) not all boards use the hush shell, and set_local_var() is only
available there.
(2) if you make such a change, then you must make it everywhere, and
you must make sure not to break existent use of these things.
Both is definitely out of the scope of this patch.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Quote from a recent meeting: "We are going to continue having these
meetings everyday until I find out why no work is getting done."
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] UBIFS: Change ubifsload to set the filesize variable
2011-09-05 14:27 ` Wolfgang Denk
@ 2011-09-05 15:04 ` Marek Vasut
0 siblings, 0 replies; 10+ messages in thread
From: Marek Vasut @ 2011-09-05 15:04 UTC (permalink / raw)
To: u-boot
On Monday, September 05, 2011 04:27:28 PM Wolfgang Denk wrote:
> Dear Marek Vasut,
>
> In message <201109051512.48148.marek.vasut@gmail.com> you wrote:
> > > + setenv("filesize", buf);
> >
> > maybe you want to check set_local_var() too ?
>
> Yes, we should clean up all these auto-generated environment variables
> one day. But what you propose here is not a good approach:
>
> (1) not all boards use the hush shell, and set_local_var() is only
> available there.
> (2) if you make such a change, then you must make it everywhere, and
> you must make sure not to break existent use of these things.
>
> Both is definitely out of the scope of this patch.
You're definitelly right on this thing.
>
> Best regards,
>
> Wolfgang Denk
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH v2] UBIFS: Change ubifsload to set the filesize variable
2011-09-05 13:03 ` [U-Boot] [PATCH v2] " Bastian Ruppert
@ 2011-09-09 12:12 ` Detlev Zundel
2011-09-09 22:04 ` Wolfgang Denk
2011-09-09 22:43 ` [U-Boot] [PATCH] UBIFS: fix warning: format '%lX' expects type 'long unsigned int' Wolfgang Denk
2 siblings, 0 replies; 10+ messages in thread
From: Detlev Zundel @ 2011-09-09 12:12 UTC (permalink / raw)
To: u-boot
Hi Bastian,
> This is the same behaviour like tftp or fatload command.
>
> Signed-off-by: Bastian Ruppert <Bastian.Ruppert@Sewerin.de>
> CC: kmpark at infradead.org
Acked-by: Detlev Zundel <dzu@denx.de>
Cheers
Detlev
--
Paul Simon sang "Fifty Ways to Lose Your Lover", because quite
frankly, "A Million Ways to Tell a Developer He Is a D*ckhead"
doesn't scan nearly as well. But I'm sure he thought about it.
-- linux/Documentation/ManagementStyle
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH v2] UBIFS: Change ubifsload to set the filesize variable
2011-09-05 13:03 ` [U-Boot] [PATCH v2] " Bastian Ruppert
2011-09-09 12:12 ` Detlev Zundel
@ 2011-09-09 22:04 ` Wolfgang Denk
2011-09-09 22:43 ` [U-Boot] [PATCH] UBIFS: fix warning: format '%lX' expects type 'long unsigned int' Wolfgang Denk
2 siblings, 0 replies; 10+ messages in thread
From: Wolfgang Denk @ 2011-09-09 22:04 UTC (permalink / raw)
To: u-boot
Dear Bastian Ruppert,
In message <1315227837-17714-1-git-send-email-Bastian.Ruppert@Sewerin.de> you wrote:
> This is the same behaviour like tftp or fatload command.
>
> Signed-off-by: Bastian Ruppert <Bastian.Ruppert@Sewerin.de>
> CC: kmpark at infradead.org
> ---
> fs/ubifs/ubifs.c | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
When choosing between two evils, I always like to take the one I've
never tried before. -- Mae West, "Klondike Annie"
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] UBIFS: fix warning: format '%lX' expects type 'long unsigned int'
2011-09-05 13:03 ` [U-Boot] [PATCH v2] " Bastian Ruppert
2011-09-09 12:12 ` Detlev Zundel
2011-09-09 22:04 ` Wolfgang Denk
@ 2011-09-09 22:43 ` Wolfgang Denk
2011-09-10 20:40 ` Wolfgang Denk
2 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Denk @ 2011-09-09 22:43 UTC (permalink / raw)
To: u-boot
Commit 46d7274 "UBIFS: Change ubifsload to set the filesize variable"
introduced the follwing compiler warning:
ubifs.c: In function 'ubifs_load':
ubifs.c:742: warning: format '%lX' expects type 'long unsigned int', but argument 3 has type 'u32'
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Bastian Ruppert <Bastian.Ruppert@Sewerin.de>
---
fs/ubifs/ubifs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index 2e6313a..604eb8f 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -739,7 +739,7 @@ int ubifs_load(char *filename, u32 addr, u32 size)
if (err)
printf("Error reading file '%s'\n", filename);
else {
- sprintf(buf, "%lX", size);
+ sprintf(buf, "%X", size);
setenv("filesize", buf);
printf("Done\n");
}
--
1.7.6
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] UBIFS: fix warning: format '%lX' expects type 'long unsigned int'
2011-09-09 22:43 ` [U-Boot] [PATCH] UBIFS: fix warning: format '%lX' expects type 'long unsigned int' Wolfgang Denk
@ 2011-09-10 20:40 ` Wolfgang Denk
0 siblings, 0 replies; 10+ messages in thread
From: Wolfgang Denk @ 2011-09-10 20:40 UTC (permalink / raw)
To: u-boot
Dear Wolfgang Denk,
In message <1315608216-7425-1-git-send-email-wd@denx.de> you wrote:
> Commit 46d7274 "UBIFS: Change ubifsload to set the filesize variable"
> introduced the follwing compiler warning:
>
> ubifs.c: In function 'ubifs_load':
> ubifs.c:742: warning: format '%lX' expects type 'long unsigned int', but argument 3 has type 'u32'
>
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Bastian Ruppert <Bastian.Ruppert@Sewerin.de>
> ---
> fs/ubifs/ubifs.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Premature optimization is the root of all evil. -- D.E. Knuth
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2011-09-10 20:40 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-05 11:03 [U-Boot] [PATCH] UBIFS: Change ubifsload to set the filesize variable Bastian Ruppert
2011-09-05 11:27 ` Wolfgang Denk
2011-09-05 13:03 ` [U-Boot] [PATCH v2] " Bastian Ruppert
2011-09-09 12:12 ` Detlev Zundel
2011-09-09 22:04 ` Wolfgang Denk
2011-09-09 22:43 ` [U-Boot] [PATCH] UBIFS: fix warning: format '%lX' expects type 'long unsigned int' Wolfgang Denk
2011-09-10 20:40 ` Wolfgang Denk
2011-09-05 13:12 ` [U-Boot] [PATCH] UBIFS: Change ubifsload to set the filesize variable Marek Vasut
2011-09-05 14:27 ` Wolfgang Denk
2011-09-05 15:04 ` Marek Vasut
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox