From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lGoMa-0005Qj-OP for mharc-grub-devel@gnu.org; Mon, 01 Mar 2021 14:37:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGoMU-0005PW-Kp for grub-devel@gnu.org; Mon, 01 Mar 2021 14:37:48 -0500 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]:44030) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lGoMR-0003Z8-KZ for grub-devel@gnu.org; Mon, 01 Mar 2021 14:37:46 -0500 Received: by mail-qk1-x731.google.com with SMTP id b130so6181520qkc.10 for ; Mon, 01 Mar 2021 11:37:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zEeTL1McklEZAW8Mu+kdfkdstF7Lu56r6fZ83TydU8w=; b=ffD9SZ/yLy7OGaO7XW7YaaB4msDC1HG8nUaPVJvi3GcXQ1PG+N99Xu8iVnFc5skAQf Ju/uD/UVmbB301KyPgow6Zh5AegiC1EHpRgObKt9cTGaGvUkojT6lriFyD/Gj4sy2tju 6mzePorrpAP/1pEX36qK5s7nyVeAHTf8AGnPOZGGznTRLDzkNKtSsqGbmzncNWBAbU6z x6pQ5VANpdA6Htxj6wmFCERq+JKGS3NrEdfBA8AqWa0fqTfEV6mW7FIG5SAPgKnLX4OM tAF+QRcUvirHbzjs7CX4ZuvuTPOP9KbvyJcC1VaxvnJlR1WkUG0bSjJXiSMl4BA3DWTv lq4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zEeTL1McklEZAW8Mu+kdfkdstF7Lu56r6fZ83TydU8w=; b=sTfo/eenk4wPSS1GITIztCgQYLa2d0D9xyEDK0R9NbW9RfHj0PDXcrVEv8LeMioFdP typLvcSKO+K/Qae7GGPLlfjCPwiwHh/oiiwYcF+PqOiDFlGd88rbvZRCRKPdcNRCug6k 9HFOSTCtjLGuEE7jCckzw7lyalpLTS3phCYLtSMBGthMtxVSJOYfmhYlV7E1qs+onrKl a5URMTWUnqZm3AGS2cDBTLvWK39LM9txcnQ0ImYBgpMJ7G6gbXGaq/Jt0CeZGdHtrE9H kBdFf9n9ccluwMAVwCXiW6dMZRYFYwtiKJcl10bksU9M/93oeSTyRJwlyjsRZPJxIohs eKVg== X-Gm-Message-State: AOAM530U6b3hHr7f9iCah4LeJdJIKiAFSd9hHqH5moPYldP26wjcb6nt Hc1GG4ZTKIEGyGBNzSYP8XkEO4A6DmQtiQ== X-Google-Smtp-Source: ABdhPJyjBpQCuCNdu/MVq2TCYG+Yx1gtmoZHXuxbB+Z6kJaGgcs5lE2JzdtVARLZJ4pyOVD88lRiJA== X-Received: by 2002:a05:620a:557:: with SMTP id o23mr16447934qko.28.1614627462181; Mon, 01 Mar 2021 11:37:42 -0800 (PST) Received: from localhost.localdomain ([2605:a601:aac5:3700:57c7:ea1a:8e56:b1ea]) by smtp.gmail.com with ESMTPSA id x79sm13435513qka.75.2021.03.01.11.37.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Mar 2021 11:37:41 -0800 (PST) From: Glenn Washburn To: grub-devel@gnu.org, Daniel Kiper Cc: Glenn Washburn Subject: [PATCH] disk/pata: Suppress error message "no device connected" Date: Mon, 1 Mar 2021 13:36:28 -0600 Message-Id: <20210301193628.295929-1-development@efficientek.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::731; envelope-from=development@efficientek.com; helo=mail-qk1-x731.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 19:37:48 -0000 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 --- 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