Re: [U-Boot] [PATCH v5 10/16] cmd: gpt: add print_gpt_info_err

2017-04-16 Thread Simon Glass
On 13 April 2017 at 03:52, Patrick Delaunay  wrote:

Commit message here

> Signed-off-by: Patrick Delaunay 
> Reviewed-by: Christophe KERELLO 
> ---
>
> Changes in v5: None
> Changes in v4: None
> Changes in v3: None
> Changes in v2: None
>
>  cmd/gpt.c | 23 ---
>  1 file changed, 12 insertions(+), 11 deletions(-)

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


[U-Boot] [PATCH v5 10/16] cmd: gpt: add print_gpt_info_err

2017-04-13 Thread Patrick Delaunay
Signed-off-by: Patrick Delaunay 
Reviewed-by: Christophe KERELLO 
---

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 cmd/gpt.c | 23 ---
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/cmd/gpt.c b/cmd/gpt.c
index f685dc8..2363b34 100644
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -333,6 +333,16 @@ err:
return errno;
 }
 
+static void print_gpt_info_err(int ret)
+{
+   if (ret == -ENOENT)
+   printf("No partition list provided\n");
+   if (ret == -EBADF)
+   printf("Missing disk guid\n");
+   if ((ret == -EFAULT) || (ret == -EINVAL))
+   printf("Partition list incomplete\n");
+}
+
 static int gpt_default(struct blk_desc *blk_dev_desc, const char *str_part)
 {
int ret;
@@ -344,12 +354,7 @@ static int gpt_default(struct blk_desc *blk_dev_desc, 
const char *str_part)
ret = set_gpt_info(blk_dev_desc->lba, blk_dev_desc->blksz, str_part,
_disk_guid, , _count);
if (ret) {
-   if (ret == -ENOENT)
-   printf("No partition list provided\n");
-   if (ret == -EBADF)
-   printf("Missing disk guid\n");
-   if ((ret == -EFAULT) || (ret == -EINVAL))
-   printf("Partition list incomplete\n");
+   print_gpt_info_err(ret);
return -1;
}
 
@@ -375,16 +380,12 @@ static int gpt_verify(struct blk_desc *blk_dev_desc, 
const char *str_part)
ret = set_gpt_info(blk_dev_desc->lba, blk_dev_desc->blksz, str_part,
_disk_guid, , _count);
if (ret) {
+   print_gpt_info_err(ret);
if (ret == -ENOENT) {
-   printf("No partition list provided - only basic 
check\n");
ret = gpt_verify_headers(blk_dev_desc, gpt_head,
 _pte);
goto out;
}
-   if (ret == -EBADF)
-   printf("Missing disk guid\n");
-   if ((ret == -EFAULT) || (ret == -EINVAL))
-   printf("Partition list incomplete\n");
return -1;
}
 
-- 
1.9.1

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