Skip to contentSkip to conversation

perf check-headers.sh: Fix check-headers.sh opts assignment

PATCH In review Jiri Olsa 3 participants 3 messages Mar 21, 2018 – Mar 29, 2018 perf events

lore
Share & tools
lore

Jiri Olsa

author reviewer
#0 lore raw

PATCH 1/1 perf check-headers.sh: Fix check-headers.sh opts assignment

Currently opts variable is not zero-ed and we keep on adding to it, ending up with:

  $ check-headers.sh 2>&1
  + opts=' "-B"'
  + opts=' "-B" "-B"'
  + opts=' "-B" "-B" "-B"'
  + opts=' "-B" "-B" "-B" "-B"'
  + opts=' "-B" "-B" "-B" "-B" "-B"'
  + opts=' "-B" "-B" "-B" "-B" "-B" "-B"'

Fixing this by initializing the opts variable.

---
 tools/perf/check-headers.sh | 1 +
 1 file changed, 1 insertion(+)
tools/perf/check-headers.sh +1 -0
index bf206ffe5c45..9aff89bc7535 100755
@@ -59,6 +59,7 @@ check () {
   file=$1
 
   shift
+  opts=
   while [ -n "$*" ]; do
     opts="$opts \"$1\""
     shift
Signature · 1 line
2.13.6
#1 lore raw

Em Wed, Mar 21, 2018 at 03:05:15PM +0100, Jiri Olsa escreveu:

Quoted 10 lines

Currently opts variable is not zero-ed and we keep on adding to it, ending up with:

  $ check-headers.sh 2>&1
  + opts=' "-B"'
  + opts=' "-B" "-B"'
  + opts=' "-B" "-B" "-B"'
  + opts=' "-B" "-B" "-B" "-B"'
  + opts=' "-B" "-B" "-B" "-B" "-B"'
  + opts=' "-B" "-B" "-B" "-B" "-B" "-B"'

Thanks, tested and applied.

- Arnaldo

#2 lore raw

[tip:perf/core] perf build: Fix check-headers.sh opts assignment

In reply to Jiri Olsa
perf build: Fix check-headers.sh opts assignment
Commit-ID:  b4c786e5aa69c5a75ac3932f81fdf8e8c120c03b
Gitweb:     https://git.kernel.org/tip/b4c786e5aa69c5a75ac3932f81fdf8e8c120c03b
Author:     Jiri Olsa <[email protected]>
AuthorDate: Wed, 21 Mar 2018 15:05:15 +0100
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 27 Mar 2018 13:13:38 -0300

perf build: Fix check-headers.sh opts assignment

Currently the "opts" variable is not zero-ed and we keep on adding to it, ending up with:

  $ check-headers.sh 2>&1
  + opts=' "-B"'
  + opts=' "-B" "-B"'
  + opts=' "-B" "-B" "-B"'
  + opts=' "-B" "-B" "-B" "-B"'
  + opts=' "-B" "-B" "-B" "-B" "-B"'
  + opts=' "-B" "-B" "-B" "-B" "-B" "-B"'

Fix this by initializing it in the check() function, right before starting the loop.

---
 tools/perf/check-headers.sh | 1 +
 1 file changed, 1 insertion(+)
tools/perf/check-headers.sh +1 -0
index bf206ffe5c45..9aff89bc7535 100755
@@ -59,6 +59,7 @@ check () {
   file=$1
 
   shift
+  opts=
   while [ -n "$*" ]; do
     opts="$opts \"$1\""
     shift