From: Francesco Lavra <francescolavra.fl@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: [PATCH 1/2] ls core command: remove unreachable code
Date: Sun, 12 May 2013 12:54:52 +0200 [thread overview]
Message-ID: <518F74FC.40104@gmail.com> (raw)
In-Reply-To: <518F74AA.6090907@gmail.com>
The path local variable in grub_core_cmd_ls() is assigned values such
that it cannot be NULL, so a couple of if blocks can be removed as they
are never executed.
2013-05-12 Francesco Lavra <francescolavra.fl@gmail.com>
* grub-core/kern/corecmd.c (grub_core_cmd_ls): Remove unreachable code.
=== modified file 'grub-core/kern/corecmd.c'
--- grub-core/kern/corecmd.c 2013-03-03 00:34:27 +0000
+++ grub-core/kern/corecmd.c 2013-05-12 09:36:16 +0000
@@ -139,21 +139,7 @@
else
path++;
- if (! path && ! device_name)
- {
- grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid argument");
- goto fail;
- }
-
- if (! path)
- {
- if (grub_errno == GRUB_ERR_UNKNOWN_FS)
- grub_errno = GRUB_ERR_NONE;
-
- grub_printf ("(%s): Filesystem is %s.\n",
- device_name, fs ? fs->name : "unknown");
- }
- else if (fs)
+ if (fs)
{
(fs->dir) (dev, path, grub_mini_print_files, NULL);
grub_xputs ("\n");
next prev parent reply other threads:[~2013-05-12 10:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-12 10:53 PATCH [0/2] ls core command: cleanup and fix Francesco Lavra
2013-05-12 10:54 ` Francesco Lavra [this message]
2013-05-12 10:56 ` [PATCH 2/2] ls core command: handle listing of the root directory Francesco Lavra
2013-05-18 10:26 ` Francesco Lavra
2013-06-02 14:48 ` Francesco Lavra
2013-06-03 5:21 ` Andrey Borzenkov
2013-11-27 18:41 ` Andrey Borzenkov
2013-11-28 6:31 ` Vladimir 'phcoder' Serbinenko
2013-11-28 13:27 ` Andrey Borzenkov
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=518F74FC.40104@gmail.com \
--to=francescolavra.fl@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).