All of lore.kernel.org
 help / color / mirror / Atom feed
From: Glenn Washburn <development@efficientek.com>
To: grub-devel@gnu.org, Daniel Kiper <daniel.kiper@oracle.com>
Cc: Glenn Washburn <development@efficientek.com>
Subject: [PATCH] disk/pata: Suppress error message "no device connected"
Date: Mon,  1 Mar 2021 13:36:28 -0600	[thread overview]
Message-ID: <20210301193628.295929-1-development@efficientek.com> (raw)

This error message comes from the grub_print_error in
grub_pata_device_initialize, which does not pass on the error, and is
raised in check_device. The function check_device needs to return this as
an error because check_device is also used in grub_pata_open, which does
pass on this error to indicate that the device can not be used.

This is actually not an error when displayed by grub_pata_device_initialize
because it just indicates that there are no pata devices seen. This may be
confusing to end users who do not have pata devices yet are loading the
pata module (perhaps implicitly via nativedisk). This also causes unnessary
output which may need to be accounted for in functional testing.

Instead print to the debug log when check_device raises this "error" and pop
the error from the error stack. If there is another error on the stack then
print the error stack as those should be real errors.

Signed-off-by: Glenn Washburn <development@efficientek.com>
---
 grub-core/disk/pata.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/grub-core/disk/pata.c b/grub-core/disk/pata.c
index 23eef2be1..b15aeaa13 100644
--- a/grub-core/disk/pata.c
+++ b/grub-core/disk/pata.c
@@ -331,6 +331,12 @@ grub_pata_device_initialize (int port, int device, int addr)
   *devp = dev;
 
   err = check_device (dev);
+  if (err == GRUB_ERR_UNKNOWN_DEVICE)
+    {
+      grub_dprintf ("pata", "%s\n", grub_errmsg);
+      grub_error_pop();
+    }
+
   if (err)
     grub_print_error ();
 
-- 
2.27.0



             reply	other threads:[~2021-03-01 19:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-01 19:36 Glenn Washburn [this message]
2021-03-03  6:23 ` [PATCH] disk/pata: Suppress error message "no device connected" Paul Menzel
2021-03-03 17:05   ` Daniel Kiper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210301193628.295929-1-development@efficientek.com \
    --to=development@efficientek.com \
    --cc=daniel.kiper@oracle.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.