diff mbox series

[v2,2/2] disk: part: Don't show redundant error message

Message ID 20180720151856.23458-3-semen.protsenko@linaro.org
State Superseded
Headers show
Series env: Make environment loading log more clear | expand

Commit Message

Sam Protsenko July 20, 2018, 3:18 p.m. UTC
Underlying API should already print some meaningful error message, so
this one is just brings more noise. E.g. we can see log like this:

    MMC: no card present
    ** Bad device mmc 0 **

Obviously, second error message is unwanted. Let's only print it in case
when DEBUG is defined to keep log short and clear.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
Changes in v2:
  - Instead of removing error message, print it with debug()

 disk/part.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass July 23, 2018, 11:48 p.m. UTC | #1
On 20 July 2018 at 09:18, Sam Protsenko <semen.protsenko@linaro.org> wrote:
> Underlying API should already print some meaningful error message, so
> this one is just brings more noise. E.g. we can see log like this:
>
>     MMC: no card present
>     ** Bad device mmc 0 **
>
> Obviously, second error message is unwanted. Let's only print it in case
> when DEBUG is defined to keep log short and clear.
>
> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
> ---
> Changes in v2:
>   - Instead of removing error message, print it with debug()
>
>  disk/part.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/disk/part.c b/disk/part.c
index 9266a09ec3..9e457a6e72 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -400,7 +400,7 @@  int blk_get_device_by_str(const char *ifname, const char *dev_hwpart_str,
 
 	*dev_desc = get_dev_hwpart(ifname, dev, hwpart);
 	if (!(*dev_desc) || ((*dev_desc)->type == DEV_TYPE_UNKNOWN)) {
-		printf("** Bad device %s %s **\n", ifname, dev_hwpart_str);
+		debug("** Bad device %s %s **\n", ifname, dev_hwpart_str);
 		dev = -ENOENT;
 		goto cleanup;
 	}