tools/env: minor fixes plus resend
cover tools/env: minor fixes plus resend
The redundant environment patch was already submitted once, but not applied due to a merge conflict.
The second patch is an addon to 183923d3e as suggested by Stefan Agner
Andreas Fenkart (2):
tools/env: return with error if redundant environments have unequal
size
tools/env: soften warning about erase block alignment
tools/env/fw_env.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
Signature · 1 line
2.8.1
PATCH 1/2 tools/env: return with error if redundant environments have unequal size
For double buffering to work, the target buffer must always be big enough to hold all data. This can only be ensured if buffers are of equal size, otherwise one must be smaller and we risk data loss when copying from the bigger to the smaller buffer.
--- tools/env/fw_env.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
tools/env/fw_env.c +2 -3
@@ -1423,10 +1423,9 @@ static int parse_config(struct env_opts *opts)return rc;if (ENVSIZE (0 ) !=ENVSIZE (1 )) { -ENVSIZE (0 ) =ENVSIZE (1 ) =min (ENVSIZE (0 ),ENVSIZE (1 ));fprintf (stderr, -"Redundant environments have inequal size, set to 0x%08lx\n" , -ENVSIZE (1 )); +"Redundant environments have unequal size" ); +return -1 ; } }
Signature · 1 line
2.8.1
PATCH 1/2 tools/env: return with error if redundant environments have unequal size
Quoted 7 lines · Andreas Fenkart
For double buffering to work, the target buffer must always be big enough to hold all data. This can only be ensured if buffers are of equal size, otherwise one must be smaller and we risk data loss when copying from the bigger to the smaller buffer.
Reviewed-by Simon Glass <[email protected]>Signed-off-by Andreas Fenkart <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160819/1d0194e8/attachment.sig>
PATCH 1/2 tools/env: return with error if redundant environments have unequal size
In reply to Andreas FenkartQuoted 8 lines · Andreas Fenkart
For double buffering to work, the target buffer must always be big enough to hold all data. This can only be ensured if buffers are of equal size, otherwise one must be smaller and we risk data loss when copying from the bigger to the smaller buffer.
Reviewed-by Simon Glass <[email protected]>Signed-off-by Andreas Fenkart <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160821/3a773b1a/attachment.sig>
PATCH 2/2 tools/env: soften warning about erase block alignment
In reply to Andreas Fenkartaddon 183923d3e
MMC/SATA have no erase blocks, only blocks. Hence the warning about erase block alignment might be confusing in such environment.
--- tools/env/fw_env.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/env/fw_env.c +1 -1
@@ -1295,7 +1295,7 @@ static int check_device_config(int dev)int fd, rc =0 ;if (DEVOFFSET (dev) %DEVESIZE (dev) !=0 ) { -fprintf (stderr,"Environment does not start on erase block boundary\n" ); +fprintf (stderr,"Environment does not start on (erase) block boundary\n" ); errno =EINVAL ;return -1 ; }
Signature · 1 line
2.8.1
PATCH 2/2 tools/env: soften warning about erase block alignment
Quoted 5 lines · Andreas Fenkart
addon
183923d3e
MMC/SATA have no erase blocks, only blocks. Hence the warning about erase block alignment might be confusing in such environment.Signed-off-by Andreas Fenkart <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160819/90a70d0c/attachment.sig>
PATCH 2/2 tools/env: soften warning about erase block alignment
In reply to Andreas FenkartQuoted 6 lines · Andreas Fenkart
addon
183923d3e
MMC/SATA have no erase blocks, only blocks. Hence the warning about erase block alignment might be confusing in such environment.Signed-off-by Andreas Fenkart <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160821/b2e33612/attachment.sig>