Patchwork [7/8] scripts/runqemu: remove redundant checking

login
register
mail settings
Submitter Otavio Salvador
Date Aug. 20, 2011, 4:58 a.m.
Message ID <512d2bd7cc7ad38f24b57fd8e0a73c8906cb4273.1313816148.git.otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/10325/
State New, archived
Headers show

Comments

Otavio Salvador - Aug. 20, 2011, 4:58 a.m.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 scripts/runqemu |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Phil Blundell - Aug. 20, 2011, 8:54 a.m.
On Sat, 2011-08-20 at 04:58 +0000, Otavio Salvador wrote:
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  scripts/runqemu |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/scripts/runqemu b/scripts/runqemu
> index 91c3c9e..d617f79 100755
> --- a/scripts/runqemu
> +++ b/scripts/runqemu
> @@ -163,7 +163,7 @@ while [ $i -le $# ]; do
>              # A directory name is an nfs rootfs
>              if [ -d "$arg" ]; then
>                  echo "Assuming $arg is an nfs rootfs"
> -                if [[ -z "$FSTYPE" || "$FSTYPE" == "nfs" ]]; then
> +                if [[ -z "$FSTYPE" ]]; then
>                      FSTYPE=nfs
>                  else
>                      echo "Error: conflicting FSTYPE types [$arg] and nfs"

Can you explain why this test is redundant?  From inspection of the
patch it seems this would lead to "Error: conflicting FSTYPE types [nfs]
and nfs" if FSTYPE="nfs" to begin with.  I guess there is some other
provision in the logic to make sure that this can't happen, but it would
be useful to have it explained in the checkin message.

p.
Otavio Salvador - Aug. 24, 2011, 5 p.m.
On Sat, Aug 20, 2011 at 05:54, Phil Blundell <philb@gnu.org> wrote:
> Can you explain why this test is redundant?  From inspection of the
> patch it seems this would lead to "Error: conflicting FSTYPE types [nfs]
> and nfs" if FSTYPE="nfs" to begin with.  I guess there is some other
> provision in the logic to make sure that this can't happen, but it would
> be useful to have it explained in the checkin message.

I rechecked it and I agree with you; I dropped it from my tree.

Patch

diff --git a/scripts/runqemu b/scripts/runqemu
index 91c3c9e..d617f79 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -163,7 +163,7 @@  while [ $i -le $# ]; do
             # A directory name is an nfs rootfs
             if [ -d "$arg" ]; then
                 echo "Assuming $arg is an nfs rootfs"
-                if [[ -z "$FSTYPE" || "$FSTYPE" == "nfs" ]]; then
+                if [[ -z "$FSTYPE" ]]; then
                     FSTYPE=nfs
                 else
                     echo "Error: conflicting FSTYPE types [$arg] and nfs"