Re: [U-Boot] [PATCH v2 15/18] bootvx: Refactor the bootline copy codes a little bit

2018-04-16 Thread Bin Meng
On Fri, Apr 13, 2018 at 12:42 AM, Simon Glass  wrote:
> On 11 April 2018 at 23:02, Bin Meng  wrote:
>> There is a small duplication in do_bootvx() that does the bootline
>> copy. Refactor this a little bit to make it simpler.
>>
>> Signed-off-by: Bin Meng 
>> ---
>>
>> Changes in v2: None
>>
>>  cmd/elf.c | 15 +--
>>  1 file changed, 5 insertions(+), 10 deletions(-)
>
> Reviewed-by: Simon Glass 

applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 15/18] bootvx: Refactor the bootline copy codes a little bit

2018-04-12 Thread Simon Glass
On 11 April 2018 at 23:02, Bin Meng  wrote:
> There is a small duplication in do_bootvx() that does the bootline
> copy. Refactor this a little bit to make it simpler.
>
> Signed-off-by: Bin Meng 
> ---
>
> Changes in v2: None
>
>  cmd/elf.c | 15 +--
>  1 file changed, 5 insertions(+), 10 deletions(-)

Reviewed-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 15/18] bootvx: Refactor the bootline copy codes a little bit

2018-04-11 Thread Bin Meng
There is a small duplication in do_bootvx() that does the bootline
copy. Refactor this a little bit to make it simpler.

Signed-off-by: Bin Meng 
---

Changes in v2: None

 cmd/elf.c | 15 +--
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/cmd/elf.c b/cmd/elf.c
index cd98392..22ff254 100644
--- a/cmd/elf.c
+++ b/cmd/elf.c
@@ -312,12 +312,7 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
 * construct the info.
 */
bootline = env_get("bootargs");
-   if (bootline) {
-   memcpy((void *)bootaddr, bootline,
-  max(strlen(bootline), (size_t)255));
-   flush_cache(bootaddr, max(strlen(bootline),
- (size_t)255));
-   } else {
+   if (!bootline) {
tmp = env_get("bootdev");
if (tmp) {
strcpy(build_buf, tmp);
@@ -368,12 +363,12 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
ptr += strlen(tmp);
}
 
-   memcpy((void *)bootaddr, build_buf,
-  max(strlen(build_buf), (size_t)255));
-   flush_cache(bootaddr, max(strlen(build_buf),
- (size_t)255));
+   bootline = build_buf;
}
 
+   memcpy((void *)bootaddr, bootline,
+  max(strlen(bootline), (size_t)255));
+   flush_cache(bootaddr, max(strlen(bootline), (size_t)255));
printf("## Using bootline (@ 0x%lx): %s\n", bootaddr,
   (char *)bootaddr);
}
-- 
2.7.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot