Re: [PATCH] firmware: hardcode the debug message for -ENOENT
From: yuankuiz
Date: Sun Feb 17 2019 - 03:25:16 EST
On 2019-02-05 07:30 AM, Luis Chamberlain wrote:
On Mon, Jan 14, 2019 at 05:58:30PM +0800, yuankuiz@xxxxxxxxxxxxxx
wrote:
Hi,
Refined at below.
From bbd0d9c8f28eb78ca34353347c3d4092e88f000c Mon Sep 17 00:00:00 2001
This is all garbled, not sure why your patch looks all messed up.
Are you using git sendemail or something manual?
Luis
Done. Update it with resend it as below.
From: John Zhao <yuankuiz@xxxxxxxxxxxxxx>
When the return code of "-ENOENT" was printed inside
of the debug message, which could be hardcoded meaningful.
Signed-off-by: John Zhao <yuankuiz@xxxxxxxxxxxxxx>
---
drivers/base/firmware_loader/main.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/base/firmware_loader/main.c
b/drivers/base/firmware_loader/main.c
index 8e9213b..7eaaf5e 100644
--- a/drivers/base/firmware_loader/main.c
+++ b/drivers/base/firmware_loader/main.c
@@ -328,12 +328,12 @@ fw_get_filesystem_firmware(struct device *device,
struct fw_priv *fw_priv)
rc = kernel_read_file_from_path(path, &fw_priv->data, &size,
msize, id);
if (rc) {
- if (rc == -ENOENT)
- dev_dbg(device, "loading %s failed with error %d\n",
- path, rc);
- else
+ if (rc != -ENOENT)
dev_warn(device, "loading %s failed with error %d\n",
path, rc);
+ else
+ dev_dbg(device, "loading %s failed for no such file or
directory.\n",
+ path);
continue;
}
dev_dbg(device, "direct-loading %s\n", fw_priv->fw_name);
--
2.7.4