From: Nicholas Piggin <npiggin@gmail.com>
To: kvm-riscv@lists.infradead.org
Subject: [kvm-unit-tests PATCH v3 2/5] shellcheck: Fix SC2155
Date: Wed, 1 May 2024 21:29:31 +1000 [thread overview]
Message-ID: <20240501112938.931452-3-npiggin@gmail.com> (raw)
In-Reply-To: <20240501112938.931452-1-npiggin@gmail.com>
SC2155 (warning): Declare and assign separately to avoid masking
return values.
No bug identified.
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
scripts/arch-run.bash | 10 +++++++---
scripts/runtime.bash | 4 +++-
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
index 2ac7b0b84..45ec8f57d 100644
--- a/scripts/arch-run.bash
+++ b/scripts/arch-run.bash
@@ -415,7 +415,8 @@ initrd_cleanup ()
{
rm -f $KVM_UNIT_TESTS_ENV
if [ "$KVM_UNIT_TESTS_ENV_OLD" ]; then
- export KVM_UNIT_TESTS_ENV="$KVM_UNIT_TESTS_ENV_OLD"
+ export KVM_UNIT_TESTS_ENV
+ KVM_UNIT_TESTS_ENV="$KVM_UNIT_TESTS_ENV_OLD"
else
unset KVM_UNIT_TESTS_ENV
fi
@@ -427,7 +428,8 @@ initrd_create ()
if [ "$ENVIRON_DEFAULT" = "yes" ]; then
trap_exit_push 'initrd_cleanup'
[ -f "$KVM_UNIT_TESTS_ENV" ] && export KVM_UNIT_TESTS_ENV_OLD="$KVM_UNIT_TESTS_ENV"
- export KVM_UNIT_TESTS_ENV=$(mktemp)
+ export KVM_UNIT_TESTS_ENV
+ KVM_UNIT_TESTS_ENV=$(mktemp)
env_params
env_file
env_errata || return $?
@@ -570,7 +572,9 @@ env_generate_errata ()
trap_exit_push ()
{
- local old_exit=$(trap -p EXIT | sed "s/^[^']*'//;s/'[^']*$//")
+ local old_exit
+
+ old_exit=$(trap -p EXIT | sed "s/^[^']*'//;s/'[^']*$//")
trap -- "$1; $old_exit" EXIT
}
diff --git a/scripts/runtime.bash b/scripts/runtime.bash
index e7af9bda9..597c90991 100644
--- a/scripts/runtime.bash
+++ b/scripts/runtime.bash
@@ -15,7 +15,9 @@ extract_summary()
# We assume that QEMU is going to work if it tried to load the kernel
premature_failure()
{
- local log="$(eval "$(get_cmdline _NO_FILE_4Uhere_)" 2>&1)"
+ local log
+
+ log="$(eval "$(get_cmdline _NO_FILE_4Uhere_)" 2>&1)"
echo "$log" | grep "_NO_FILE_4Uhere_" |
grep -q -e "could not \(load\|open\) kernel" -e "error loading" -e "failed to load" &&
--
2.43.0
WARNING: multiple messages have this Message-ID (diff)
From: Nicholas Piggin <npiggin@gmail.com>
To: Andrew Jones <andrew.jones@linux.dev>
Cc: "Nicholas Piggin" <npiggin@gmail.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Alexandru Elisei" <alexandru.elisei@arm.com>,
"Eric Auger" <eric.auger@redhat.com>,
"Janosch Frank" <frankja@linux.ibm.com>,
"Claudio Imbrenda" <imbrenda@linux.ibm.com>,
"Nico Böhr" <nrb@linux.ibm.com>,
"David Hildenbrand" <david@redhat.com>,
"Shaoqin Huang" <shahuang@redhat.com>,
"Nikos Nikoleris" <nikos.nikoleris@arm.com>,
"David Woodhouse" <dwmw@amazon.co.uk>,
"Ricardo Koller" <ricarkol@google.com>,
rminmin <renmm6@chinaunicom.cn>, "Gavin Shan" <gshan@redhat.com>,
"Nina Schoetterl-Glausch" <nsg@linux.ibm.com>,
"Sean Christopherson" <seanjc@google.com>,
kvm@vger.kernel.org, kvmarm@lists.linux.dev,
kvm-riscv@lists.infradead.org, linux-s390@vger.kernel.org
Subject: [kvm-unit-tests PATCH v3 2/5] shellcheck: Fix SC2155
Date: Wed, 1 May 2024 21:29:31 +1000 [thread overview]
Message-ID: <20240501112938.931452-3-npiggin@gmail.com> (raw)
In-Reply-To: <20240501112938.931452-1-npiggin@gmail.com>
SC2155 (warning): Declare and assign separately to avoid masking
return values.
No bug identified.
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
scripts/arch-run.bash | 10 +++++++---
scripts/runtime.bash | 4 +++-
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
index 2ac7b0b84..45ec8f57d 100644
--- a/scripts/arch-run.bash
+++ b/scripts/arch-run.bash
@@ -415,7 +415,8 @@ initrd_cleanup ()
{
rm -f $KVM_UNIT_TESTS_ENV
if [ "$KVM_UNIT_TESTS_ENV_OLD" ]; then
- export KVM_UNIT_TESTS_ENV="$KVM_UNIT_TESTS_ENV_OLD"
+ export KVM_UNIT_TESTS_ENV
+ KVM_UNIT_TESTS_ENV="$KVM_UNIT_TESTS_ENV_OLD"
else
unset KVM_UNIT_TESTS_ENV
fi
@@ -427,7 +428,8 @@ initrd_create ()
if [ "$ENVIRON_DEFAULT" = "yes" ]; then
trap_exit_push 'initrd_cleanup'
[ -f "$KVM_UNIT_TESTS_ENV" ] && export KVM_UNIT_TESTS_ENV_OLD="$KVM_UNIT_TESTS_ENV"
- export KVM_UNIT_TESTS_ENV=$(mktemp)
+ export KVM_UNIT_TESTS_ENV
+ KVM_UNIT_TESTS_ENV=$(mktemp)
env_params
env_file
env_errata || return $?
@@ -570,7 +572,9 @@ env_generate_errata ()
trap_exit_push ()
{
- local old_exit=$(trap -p EXIT | sed "s/^[^']*'//;s/'[^']*$//")
+ local old_exit
+
+ old_exit=$(trap -p EXIT | sed "s/^[^']*'//;s/'[^']*$//")
trap -- "$1; $old_exit" EXIT
}
diff --git a/scripts/runtime.bash b/scripts/runtime.bash
index e7af9bda9..597c90991 100644
--- a/scripts/runtime.bash
+++ b/scripts/runtime.bash
@@ -15,7 +15,9 @@ extract_summary()
# We assume that QEMU is going to work if it tried to load the kernel
premature_failure()
{
- local log="$(eval "$(get_cmdline _NO_FILE_4Uhere_)" 2>&1)"
+ local log
+
+ log="$(eval "$(get_cmdline _NO_FILE_4Uhere_)" 2>&1)"
echo "$log" | grep "_NO_FILE_4Uhere_" |
grep -q -e "could not \(load\|open\) kernel" -e "error loading" -e "failed to load" &&
--
2.43.0
next prev parent reply other threads:[~2024-05-01 11:29 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-01 11:29 [kvm-unit-tests PATCH v3 0/5] add shellcheck support Nicholas Piggin
2024-05-01 11:29 ` Nicholas Piggin
2024-05-01 11:29 ` [kvm-unit-tests PATCH v3 1/5] Add initial shellcheck checking Nicholas Piggin
2024-05-01 11:29 ` Nicholas Piggin
2024-05-01 11:29 ` Nicholas Piggin [this message]
2024-05-01 11:29 ` [kvm-unit-tests PATCH v3 2/5] shellcheck: Fix SC2155 Nicholas Piggin
2024-05-01 11:29 ` [kvm-unit-tests PATCH v3 3/5] shellcheck: Fix SC2124 Nicholas Piggin
2024-05-01 11:29 ` Nicholas Piggin
2024-05-01 11:29 ` [kvm-unit-tests PATCH v3 4/5] shellcheck: Fix SC2294 Nicholas Piggin
2024-05-01 11:29 ` Nicholas Piggin
2024-05-01 11:29 ` [kvm-unit-tests PATCH v3 5/5] shellcheck: Suppress various messages Nicholas Piggin
2024-05-01 11:29 ` Nicholas Piggin
2024-05-02 8:12 ` [kvm-unit-tests PATCH v3 0/5] add shellcheck support Andrew Jones
2024-05-02 8:12 ` Andrew Jones
2024-05-02 8:23 ` Thomas Huth
2024-05-02 8:23 ` Thomas Huth
2024-05-02 8:56 ` Andrew Jones
2024-05-02 8:56 ` Andrew Jones
2024-05-02 9:34 ` Thomas Huth
2024-05-02 9:34 ` Thomas Huth
2024-05-02 9:48 ` Andrew Jones
2024-05-02 9:48 ` Andrew Jones
2024-05-03 5:02 ` Nicholas Piggin
2024-05-03 5:02 ` Nicholas Piggin
2024-05-03 5:13 ` Thomas Huth
2024-05-03 5:13 ` Thomas Huth
2024-05-07 4:26 ` Nicholas Piggin
2024-05-07 4:26 ` Nicholas Piggin
2024-05-03 5:11 ` Nicholas Piggin
2024-05-03 5:11 ` Nicholas Piggin
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=20240501112938.931452-3-npiggin@gmail.com \
--to=npiggin@gmail.com \
--cc=kvm-riscv@lists.infradead.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.