linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Clark Williams <williams@redhat.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Kim Phillips <kim.phillips@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Hendrik Brueckner <brueckner@linux.vnet.ibm.com>,
	Jiri Olsa <jolsa@redhat.com>, Michael Petlan <mpetlan@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Sandipan Das <sandipan@linux.vnet.ibm.com>,
	Thomas Richter <tmricht@linux.vnet.ibm.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 09/14] perf llvm-utils: Remove bashism from kernel include fetch script
Date: Wed, 11 Jul 2018 16:43:00 -0400	[thread overview]
Message-ID: <20180711204305.12924-10-acme@kernel.org> (raw)
In-Reply-To: <20180711204305.12924-1-acme@kernel.org>

From: Kim Phillips <kim.phillips@arm.com>

Like system(), popen() calls /bin/sh, which may/may not be bash.

Script when run on dash and encounters the line, yields:

 exit: Illegal number: -1

checkbashisms report on script content:

 possible bashism (exit|return with negative status code):
 exit -1

Remove the bashism and use the more portable non-zero failure
status code 1.

Signed-off-by: Kim Phillips <kim.phillips@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sandipan Das <sandipan@linux.vnet.ibm.com>
Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/20180629124652.8d0af7e2281fd3fd8262cacc@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/llvm-utils.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/llvm-utils.c b/tools/perf/util/llvm-utils.c
index 976e658e38dc..5e94857dfca2 100644
--- a/tools/perf/util/llvm-utils.c
+++ b/tools/perf/util/llvm-utils.c
@@ -266,16 +266,16 @@ static const char *kinc_fetch_script =
 "#!/usr/bin/env sh\n"
 "if ! test -d \"$KBUILD_DIR\"\n"
 "then\n"
-"	exit -1\n"
+"	exit 1\n"
 "fi\n"
 "if ! test -f \"$KBUILD_DIR/include/generated/autoconf.h\"\n"
 "then\n"
-"	exit -1\n"
+"	exit 1\n"
 "fi\n"
 "TMPDIR=`mktemp -d`\n"
 "if test -z \"$TMPDIR\"\n"
 "then\n"
-"    exit -1\n"
+"    exit 1\n"
 "fi\n"
 "cat << EOF > $TMPDIR/Makefile\n"
 "obj-y := dummy.o\n"
-- 
2.14.4


  parent reply	other threads:[~2018-07-11 20:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-11 20:42 [GIT PULL 00/14] perf/urgent fixes Arnaldo Carvalho de Melo
2018-07-11 20:42 ` [PATCH 01/14] perf tools: Generate a Python script compatible with Python 2 and 3 Arnaldo Carvalho de Melo
2018-07-11 20:42 ` [PATCH 02/14] perf scripts python: Add Python 3 support to Core.py Arnaldo Carvalho de Melo
2018-07-11 20:42 ` [PATCH 03/14] perf scripts python: Add Python 3 support to SchedGui.py Arnaldo Carvalho de Melo
2018-07-11 20:42 ` [PATCH 04/14] perf scripts python: Add Python 3 support to Util.py Arnaldo Carvalho de Melo
2018-07-11 20:42 ` [PATCH 05/14] perf scripts python: Add Python 3 support to sched-migration.py Arnaldo Carvalho de Melo
2018-07-11 20:42 ` [PATCH 06/14] perf scripts python: Add Python 3 support to EventClass.py Arnaldo Carvalho de Melo
2018-07-11 20:42 ` [PATCH 07/14] perf test shell: Replace '|&' with '2>&1 |' to work with more shells Arnaldo Carvalho de Melo
2018-07-11 20:42 ` [PATCH 08/14] perf test shell: Make perf's inet_pton test more portable Arnaldo Carvalho de Melo
2018-07-11 20:43 ` Arnaldo Carvalho de Melo [this message]
2018-07-11 20:43 ` [PATCH 10/14] perf test shell: Prevent temporary editor files from being considered test scripts Arnaldo Carvalho de Melo
2018-07-11 20:43 ` [PATCH 11/14] perf tools: Fix compilation errors on gcc8 Arnaldo Carvalho de Melo
2018-07-11 20:43 ` [PATCH 12/14] perf stat: Fix --interval_clear option Arnaldo Carvalho de Melo
2018-07-11 20:43 ` [PATCH 13/14] perf script python: Fix dict reference counting Arnaldo Carvalho de Melo
2018-07-11 20:43 ` [PATCH 14/14] perf tools: Use python-config --includes rather than --cflags Arnaldo Carvalho de Melo
2018-07-12 13:54 ` [GIT PULL 00/14] perf/urgent fixes Ingo Molnar

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=20180711204305.12924-10-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=brueckner@linux.vnet.ibm.com \
    --cc=jolsa@redhat.com \
    --cc=kim.phillips@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mpetlan@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=sandipan@linux.vnet.ibm.com \
    --cc=tmricht@linux.vnet.ibm.com \
    --cc=williams@redhat.com \
    /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).