-by: Richard Genoud
Thanks !
offset. Replace these loops by equivalent calls to memcpy, with the
right parameters.
I tested this patch by comparing the MD5 checksum of a few fragmented
files with the respective md5sum output in sandbox, considering both
compressed and uncompressed fragments.
Signed-off-by: Joao Marcos Cos
---8<
Subject: [PATCH] test/py: SquashFS: Check if loaded file is corrupted
After loading the file in memory, its content should be checked for
errors.
Signed-off-by: Richard Genoud
---
test/py/tests/test_fs/test_squashfs/sqfs_common.py| 5 -
test/py/tests/test_fs/test_squash
Hi Miquel
Le 22/12/2020 à 08:46, Miquel Raynal a écrit :
Hi Richard,
Richard Genoud wrote on Mon, 21 Dec 2020
17:17:56 +0100:
Hi Miquel
Le 21/12/2020 à 16:49, Miquel Raynal a écrit :
Hi Richard,
Richard Genoud wrote on Mon, 21 Dec 2020
16:40:51 +0100:
Hi Miquel,
Le 21/12/2020 à 16
Hi Miquel
Le 21/12/2020 à 16:49, Miquel Raynal a écrit :
Hi Richard,
Richard Genoud wrote on Mon, 21 Dec 2020
16:40:51 +0100:
Hi Miquel,
Le 21/12/2020 à 16:29, Miquel Raynal a écrit :
Hi Richard,
Richard Genoud wrote on Mon, 21 Dec 2020
16:26:00 +0100:
Le 21/12/2020 à 16:14, Miquel
Hi Miquel,
Le 21/12/2020 à 16:29, Miquel Raynal a écrit :
Hi Richard,
Richard Genoud wrote on Mon, 21 Dec 2020
16:26:00 +0100:
Le 21/12/2020 à 16:14, Miquel Raynal a écrit :
Hi Richard,
Richard Genoud wrote on Mon, 21 Dec 2020
16:06:37 +0100:
Hi Miquel,
Le 18/12/2020 à 19:50
Le 21/12/2020 à 16:14, Miquel Raynal a écrit :
Hi Richard,
Richard Genoud wrote on Mon, 21 Dec 2020
16:06:37 +0100:
Hi Miquel,
Le 18/12/2020 à 19:50, Miquel Raynal a écrit :
Hi Richard,
Richard Genoud wrote on Fri, 18 Dec 2020
15:24:40 +0100:
token_count may be != 0 and token_list
Hi Miquel,
Le 18/12/2020 à 19:50, Miquel Raynal a écrit :
Hi Richard,
Richard Genoud wrote on Fri, 18 Dec 2020
15:24:40 +0100:
token_count may be != 0 and token_list not yet allocated when the out
code is reached
Wouldn't it be better to initialize token_count than adding an
(ob
token_count may be != 0 and token_list not yet allocated when the out
code is reached
Reported-by: Coverity CID 313547
Fixes: ea1b1651c6a8 ("fs/squashfs: sqfs_opendir: simplify error handling")
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 5 +++--
1 file changed, 3 insert
Hi,
Le 20/11/2020 à 02:35, Tom Rini a écrit :
On Tue, Nov 03, 2020 at 12:11:25PM +0100, Richard Genoud wrote:
The code for reading a fragmented file is not functionnal.
It's better to signal this to the user.
Signed-off-by: Richard Genoud
This change causes the test.py squashfs tes
This will prevent a double free error if sqfs_close() is called twice.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 15208b4dab0..4e6b6058f97 100644
--- a/fs/squashfs
Le 20/11/2020 à 02:35, Tom Rini a écrit :
On Tue, Nov 03, 2020 at 12:11:20PM +0100, Richard Genoud wrote:
This will prevent a double free error if sqfs_close() is called twice.
Signed-off-by: Richard Genoud
This change causes the test.py squashfs tests to fail. I am unsure if
the problem
Le 03/11/2020 à 12:10, Richard Genoud a écrit :
This patch series fix several memory leaks, some use of dangling
pointers (leading to cpu freeze) and finally introduce the exists()
function for squashfs.
This function enable testing the existence of a file, which is mandatory
for using the
This permits to find a file and use the distro_bootcmd
Signed-off-by: Richard Genoud
---
fs/fs.c| 2 +-
fs/squashfs/sqfs.c | 38 ++
include/squashfs.h | 1 +
3 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/fs/fs.c b/fs/fs.c
index
The code for reading a fragmented file is not functionnal.
It's better to signal this to the user.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index f63a06fd40f..a96c1d4f564 100644
offset is the offset in the file read, not the offset in the destination
buffer.
If the offset is not null, this will lead to a memory corruption.
So, for now, we are returning an error if the offset is used.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 16
1 file
The length of the buffer wasn't taken into account when writing to the
given buffer.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 8
1 file changed, 8 insertions(+)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index fa3120aefd6..4710b2bd707 100644
--- a/fs/squ
finfo.blk_sizes may not be freed in case of error in the for loop
Setting it to null and freeing it at the end makes prevents that from
happening.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 48 +-
1 file changed, 22 insertions(+), 26
This will prevent a double free error if sqfs_close() is called twice.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 7d6f0e88e31..a46e19c75c5 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs
Resetting the context on error will prevent some checks like:
if (!ctx.cur_dev)
To pass when the probe method has failed
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index
sqfs_decompressor_init() returns a value, so it's better to use it than
to force the return value to EINVAL (it could be ENOMEM)
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 9682ea
For consistency with other functions.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 28
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index cfea313e34b..b97a961c5e3 100644
--- a/fs/squashfs/sqfs.c
If SquashFS magic number is invalid, there's a memory leak.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 14 +-
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index d8d4584fbfd..7d6f0e88e31 100644
--- a/fs/squ
if sqfs_tokenize(rel_tokens, rc, rel); fails, the function exits
without freeing the array base_tokens.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 32 ++--
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs
the return value of sqfs_tokenize(rel_tokens, rc, rel); wasn't checked.
(but "ret" value was !)
This is obviouly a typo.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squash
data_buffer was allocated in a loop and freed only once.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index a9e803cbac2..cfea313e34b 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs/squashfs/sqfs.c
as sqfs_opendir failed, there's no need to call sqfs_closedir
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 13e64bea934..1ac07625889 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs/squashfs/s
inode_table should not be left dangling as it may be freed in sqfs_opendir
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 1714306e747..72181f38332 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs
sqfs_closedir() should be called to free memory allocated by
sqfs_opendir()
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 1ac07625889..a9e803cbac2 100644
--- a/fs/squashfs
as sqfs_opendir failed, there's no need to call sqfs_closedir
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 3b008b5235c..f4cac3e4bf0 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs/squashfs/s
dirs->entry shouldn't be left dangling as it could be freed twice.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index f4cac3e4bf0..13e64bea934 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs/
memory allocation should always be checked
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 72181f38332..7da2e09cc36 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs/squashfs/sqfs.c
@@ -242,6 +242,9
dirs->entry shouldn't be left dangling as it could be freed twice.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 9d460e8bed6..78893b5c85d 100644
--- a/fs/squashfs/sqfs.c
path, target, res, rem and sym_tokens were not free on error nor success.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 64 --
1 file changed, 51 insertions(+), 13 deletions(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index
dirs->entry shouldn't be left dangling as it could be freed twice.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 7da2e09cc36..3b008b5235c 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs/
*file and *dir were not freed on error
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 40
1 file changed, 28 insertions(+), 12 deletions(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 0ac922af9e7..58b8bfc66dc 100644
--- a/fs
Using only one label permits to prevents bugs when moving code around.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 27 ---
1 file changed, 12 insertions(+), 15 deletions(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 1fdb9ac534b..b94a9715205
When trying to load an non-existing file, the cpu hangs!
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 37 +
1 file changed, 29 insertions(+), 8 deletions(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 15208b4dab0..1fdb9ac534b 100644
pos_list wasn't freed on every error
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 31 +--
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 58b8bfc66dc..9d460e8bed6 100644
--- a/fs/squashfs/s
sqfs_dirs wasn't freed anywhere.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index b94a9715205..0ac922af9e7 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs/squashfs/sqfs.c
@@ -1573,4 +1573,5 @@
add missing squashfs function to prevent dangling or null pointers.
For exemple, when calling test [ -e somefile ], squashfs.exists may be
called.
Signed-off-by: Richard Genoud
---
fs/fs.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/fs/fs.c b/fs/fs.c
index 29ad4d1a695
to prevent writing beyond buffer
- prevent reading with an offset since it doesn't work
- prevent reading fragmented files since it doesn't work
Richard Genoud (28):
fs/squashfs: fix board hang-up when calling .exists()
fs/squashfs: sqfs_opendir: fix some memory leaks and dangling p
Le 14/10/2020 à 10:06, Richard Genoud a écrit :
sqfs_closedir() should be called to free memory allocated by
sqfs_opendir()
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 79d68dddb28
Le 15/10/2020 à 18:38, Miquel Raynal a écrit :
Hi Richard,
That's why I prefer only one label and setting NULL.
If I didn't convince you, I'll change it back to multiple labels :)
You are right it involves less changes when editing the code. But
on the other hand it is so often written like
Hi Miquel !
Thanks for your feedback.
Le 15/10/2020 à 15:54, Miquel Raynal a écrit :
Hi Richard,
Richard Genoud wrote on Wed, 14 Oct 2020
10:06:11 +0200:
pos_list wasn't freed on every error
Signed-off-by: Richard Genoud
Same comment here (and probably after as well) as in patch
This permits to find a file and use the distro_bootcmd
Signed-off-by: Richard Genoud
---
fs/fs.c| 2 +-
fs/squashfs/sqfs.c | 38 ++
include/squashfs.h | 1 +
3 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/fs/fs.c b/fs/fs.c
index
data_buffer was allocated in a loop and freed only once.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 6cd3ba9ce10..82bf1faf25f 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs/squashfs/sqfs.c
dirs->entry shouldn't be left dangling as it could be freed twice.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 116b5160ee3..0510ae311d1 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs/
sqfs_closedir() should be called to free memory allocated by
sqfs_opendir()
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 79d68dddb28..6cd3ba9ce10 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs
as sqfs_opendir failed, there's no need to call sqfs_closedir
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index c5a24450e6f..116b5160ee3 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs/squashfs/s
dirs->entry shouldn't be left dangling as it could be freed twice.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 24a7680aa5c..c5a24450e6f 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs/
as sqfs_opendir failed, there's no need to call sqfs_closedir
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 0510ae311d1..79d68dddb28 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs/squashfs/s
path, target, res, rem and sym_tokens were not free on error nor success.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 64 --
1 file changed, 51 insertions(+), 13 deletions(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index
memory allocation should always be checked
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index c4b7c84e9aa..24a7680aa5c 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs/squashfs/sqfs.c
@@ -242,6 +242,9
pos_list wasn't freed on every error
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 31 +--
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 55d183663a8..c4d74fd4d6d 100644
--- a/fs/squashfs/s
dirs->entry shouldn't be left dangling as it could be freed twice.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index c4d74fd4d6d..1df27f7b903 100644
--- a/fs/squashfs/sqfs.c
inode_table should not be left dangling as it may be freed in sqfs_opendir
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index eb8851a7148..c4b7c84e9aa 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs
*file and *dir were not freed on error
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 39 +++
1 file changed, 27 insertions(+), 12 deletions(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 0ac922af9e7..55d183663a8 100644
--- a/fs
patches to be easier to review
Richard Genoud (17):
fs/squashfs: fix board hang-up when calling .exists()
fs/squashfs: sqfs_opendir: fix some memory leaks and dangling pointers
fs/squashfs: sqfs_opendir: simplify error handling
fs/squashfs: sqfs_closedir: fix memory leak
fs/squashfs
When trying to load an non-existing file, the cpu hangs!
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 37 +
1 file changed, 29 insertions(+), 8 deletions(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 15208b4dab0..1fdb9ac534b 100644
sqfs_dirs wasn't freed anywhere.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index b94a9715205..0ac922af9e7 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs/squashfs/sqfs.c
@@ -1573,4 +1573,5 @@
Using only one label permits to prevents bugs when moving code around.
Signed-off-by: Richard Genoud
---
fs/squashfs/sqfs.c | 27 ---
1 file changed, 12 insertions(+), 15 deletions(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 1fdb9ac534b..b94a9715205
add missing squashfs function to prevent dangling or null pointers.
For exemple, when calling test [ -e somefile ], squashfs.exists may be
called.
Signed-off-by: Richard Genoud
---
fs/fs.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/fs/fs.c b/fs/fs.c
index 29ad4d1a695
Hi Patrick,
Le 13/10/2020 à 14:18, Patrick DELAUNAY a écrit :
Hi Richard,
From: Richard Genoud
Sent: lundi 12 octobre 2020 16:11
spl_mmc_boot_partition is only defined when
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION is defined.
Signed-off-by: Richard Genoud
---
arch/arm/mach-stm32mp
spl_mmc_boot_partition is only defined when
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION is defined.
Signed-off-by: Richard Genoud
---
arch/arm/mach-stm32mp/spl.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/mach-stm32mp/spl.c b/arch/arm/mach-stm32mp/spl.c
index e84bdad7bfc
2013/9/25 Richard Weinberger :
> Am 25.09.2013 14:13, schrieb Richard Genoud:
>>> Before we waste time, please ensure that you have all recent UBI fixes
>>> applied.
>>> UBI: Fix PEB leak in wear_leveling_worker() (Merged into 3.12-rc1, on it's
>>> way
On 25/09/2013 13:10, Richard Weinberger wrote:
> Hi!
>
> Am 25.09.2013 12:59, schrieb Richard Genoud:
>>
>> [CC u-boot ML since it may not be a kernel only related bug(s)]
>>
>> Hi Richard, Artem,
>>
>> I'm still playing with fastmap and I ran int
[CC u-boot ML since it may not be a kernel only related bug(s)]
Hi Richard, Artem,
I'm still playing with fastmap and I ran into something.
It's involving u-boot's "ubi write" command and fastmap.
What I'm doing is:
- Flashing a mtd partition with a userspace.ubi image via u-boot
- Booting linux
2012/12/13 Marek Vasut :
> Dear Tom Rini,
>
> [...]
>
>> Note that we don't use --gc-sections on all archs so I'm not sure we
>> discard the unused VFAT functions on say ARM.
>
> Valid point, Albert?
>
> Best regards,
> Marek Vasut
I check and the code is discarded (on ARM at91sam9x5ek).
This is t
_VFAT is not
defined.
Signed-off-by: Richard Genoud
---
fs/fat/fat.c | 55 +++
fs/fat/fat_write.c | 11 ++---
2 files changed, 32 insertions(+), 34 deletions(-)
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 393c378..7c23b67 100644
---
2012/12/13 Marek Vasut :
> Dear Richard Genoud,
>
>> 2012/12/13 Marek Vasut :
>> > Dear Richard Genoud,
>> >
>> >> ifdefs in the code are making it harder to read.
>> >> The use of simple if(VFAT_ENABLED) makes no more code and is cleaner.
&
2012/12/13 Tom Rini :
> Note that we don't use --gc-sections on all archs so I'm not sure we
> discard the unused VFAT functions on say ARM.
>
I tested it on at91sam9x5ek, and the vfat functions are not present in
the System.map.
The problem is in my commit message: the linker doesn"t have anythin
2012/12/13 Marek Vasut :
> Dear Richard Genoud,
>
>> ifdefs in the code are making it harder to read.
>> The use of simple if(VFAT_ENABLED) makes no more code and is cleaner.
>> (the code is discarded by the compiler and linker instead of the
>> preprocessor.)
2012/12/13 Marek Vasut :
> Dear Richard Genoud,
>
> I feel bad for the code when you say it's FAT so explicitly ... it certainly
> wishes it was SLIM, but it can't ;-)
>
:) I didn't write that on purpose... But it's definitely a good war cry !
___
toupper/tolower function are already declared, so use them.
Signed-off-by: Richard Genoud
---
fs/fat/fat.c |3 ++-
fs/fat/fat_write.c |3 ++-
include/fat.h |3 ---
3 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index c79e3e3
: Richard Genoud
---
fs/fat/fat.c | 55 +++
fs/fat/fat_write.c | 11 ++---
2 files changed, 32 insertions(+), 34 deletions(-)
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 393c378..c79e3e3 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
Hi,
Instead of adding some more ugly #ifdefs, I came with another approach.
It makes the code easier to read, and correct the compilation error
when VFAT wasn't enabled.
Best regards,
Richard Genoud (2):
FAT: remove ifdefs to make the code more readable
FAT: use toupper/tolower inste
2012/12/4 Marek Vasut :
> Dear Richard Genoud,
>
> Please provide a reasonable commit message. Why is this needed?
hi,
You're right, my commit message is nearly inexistent.. sorry.
This is needed in the case where we don't want the VFAT support (for
whatever reason).
in t
Signed-off-by: Richard Genoud
---
fs/fat/fat.c |8
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 393c378..defdd74 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -589,7 +589,9 @@ static dir_entry *get_dentfromdir(fsdata *mydata, int
As far as every arch has a get_timer function,
run_command_and_time_it code can now disappear.
Signed-off-by: Richard Genoud
---
common/cmd_time.c | 33 ++---
common/command.c |6 +-
common/hush.c |2 +-
common/main.c |2 +-
include
2012/12/3 Stefan Roese :
>> @@ -543,7 +543,9 @@ enum command_ret_t cmd_process(int flag, int argc, char
>> * const argv[],
>>
>> /* If OK so far, then do the command */
>> if (!rc) {
>> + if (ticks) *ticks = get_timer(0);
>
> Newline please:
>
> if (ticks)
>
As far as every arch has a get_timer function,
run_command_and_time_it code can now disappear.
Signed-off-by: Richard Genoud
---
common/cmd_time.c | 33 ++---
common/command.c |4 +++-
common/hush.c |2 +-
common/main.c |2 +-
include/command.h
From: Richard Genoud
Signed-off-by: Richard Genoud
---
doc/README.usb |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/doc/README.usb b/doc/README.usb
index ef1d6ba..b4c3ef5 100644
--- a/doc/README.usb
+++ b/doc/README.usb
@@ -63,7 +63,7 @@ Common USB Commands
From: Richard Genoud
Signed-off-by: Richard Genoud
---
include/configs/at91sam9x5ek.h | 23 +++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h
index 5e5f9c1..915714f 100644
--- a/include
From: Richard Genoud
Signed-off-by: Richard Genoud
---
arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c | 13 +
arch/arm/include/asm/arch-at91/at91sam9x5.h |2 ++
board/atmel/at91sam9x5ek/at91sam9x5ek.c |3 +++
drivers/usb/host/ohci-at91.c
From: Richard Genoud
Signed-off-by: Richard Genoud
---
include/configs/at91sam9x5ek.h |6 +-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h
index 71f765b..5e5f9c1 100644
--- a/include/configs/at91sam9x5ek.h
From: Richard Genoud
This small patchset is based on current master (
178d0cc1a4c73c3341afbeb2a93b172de8c96bd1 )
It enables usb on at91sam9x5ek boards.
Tested on at91sam9x5ek with a sam9g35 CPU (+ usb key and mouse)
By default the 3 USB 1.1 ports (A, B and C) are enabled.
If CONFIG_USB_EHCI is
2012/11/29 Bo Shen :
Hi !
> As port C doesn't support EHCI, so, I think we should deal with this
> carefully.
> ---<8---
> #if OHCI
> #else EHCI
> #endif
> --->8---
> I think this will be better.
yes, you're right, I'll change that
___
U-Boot mailing lis
Signed-off-by: Richard Genoud
---
include/configs/at91sam9x5ek.h | 24
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h
index 5e5f9c1..fd2586d 100644
--- a/include/configs/at91sam9x5ek.h
Signed-off-by: Richard Genoud
---
include/configs/at91sam9x5ek.h |6 +-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h
index 71f765b..5e5f9c1 100644
--- a/include/configs/at91sam9x5ek.h
+++ b/include/configs
Signed-off-by: Richard Genoud
---
arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c | 10 ++
arch/arm/include/asm/arch-at91/at91sam9x5.h |2 ++
board/atmel/at91sam9x5ek/at91sam9x5ek.c |3 +++
drivers/usb/host/ohci-at91.c |6 --
4 files
Signed-off-by: Richard Genoud
---
doc/README.usb |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/doc/README.usb b/doc/README.usb
index ef1d6ba..b4c3ef5 100644
--- a/doc/README.usb
+++ b/doc/README.usb
@@ -63,7 +63,7 @@ Common USB Commands:
Storage USB Commands:
- usb
ports (A and B) will be enabled.
changes from v1:
* VBUS for usb port A is enabled
* EHCI configuration is now present
* number of OHCI ports corrected (3 instead of 2)
Richard Genoud (4):
usb documentation: fix typo
ARM: at91sam9x5: enable USB OHCI support for 9x5ek board.
at91sam9x5ek
2012/11/28 Bo Shen :
> Thanks for your work.
> I think if enable EHCI instead of OHCI will be better?
Yes, I tried it, and it's working great.
I'll resend the serie with EHCI enable.
Richard.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.den
Signed-off-by: Richard Genoud
---
arch/arm/cpu/arm926ejs/at91/at91sam9x5_devices.c |9 +
arch/arm/include/asm/arch-at91/at91sam9x5.h |2 ++
board/atmel/at91sam9x5ek/at91sam9x5ek.c |3 +++
drivers/usb/host/ohci-at91.c |6 --
4 files
Signed-off-by: Richard Genoud
---
include/configs/at91sam9x5ek.h | 12
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h
index 5e5f9c1..444d83e 100644
--- a/include/configs/at91sam9x5ek.h
+++ b/include
Signed-off-by: Richard Genoud
---
include/configs/at91sam9x5ek.h |6 +-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h
index 71f765b..5e5f9c1 100644
--- a/include/configs/at91sam9x5ek.h
+++ b/include/configs
Signed-off-by: Richard Genoud
---
doc/README.usb |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/doc/README.usb b/doc/README.usb
index ef1d6ba..b4c3ef5 100644
--- a/doc/README.usb
+++ b/doc/README.usb
@@ -63,7 +63,7 @@ Common USB Commands:
Storage USB Commands:
- usb
This small patchset is based on current master (
178d0cc1a4c73c3341afbeb2a93b172de8c96bd1 )
It enables usb ohci on at91sam9x5ek boards.
Tested it with a sam9g35 CPU and a usb key.
Richard Genoud (4):
usb documentation: fix typo
ARM: at91sam9x5: enable USB OHCI support for 9x5ek board
99 matches
Mail list logo