Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1445927

[PATCH 02/15] perf jit: Remove some no-op error handling

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 02/15] perf jit: Remove some no-op error handling
Date 2016-07-19 01:40 +0200
Message-ID <rWqiK-4rm-37@gated-at.bofh.it> (permalink)
References <rWqiJ-4rm-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Dan Carpenter <dan.carpenter@oracle.com>

The 'info.e_machine' struct member is an uint16_t so 'm' is never less
than zero.  It looks like this was maybe left over code from earlier
versions so I've just removed it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: kernel-janitors@vger.kernel.org
Link: http://lkml.kernel.org/r/20160715210836.GB19522@mwanda
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/jvmti/jvmti_agent.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/tools/perf/jvmti/jvmti_agent.c b/tools/perf/jvmti/jvmti_agent.c
index 91bf333a366a..55daefff0d54 100644
--- a/tools/perf/jvmti/jvmti_agent.c
+++ b/tools/perf/jvmti/jvmti_agent.c
@@ -59,7 +59,6 @@ static int get_e_machine(struct jitheader *hdr)
 	ssize_t sret;
 	char id[16];
 	int fd, ret = -1;
-	int m = -1;
 	struct {
 		uint16_t e_type;
 		uint16_t e_machine;
@@ -81,11 +80,7 @@ static int get_e_machine(struct jitheader *hdr)
 	if (sret != sizeof(info))
 		goto error;
 
-	m = info.e_machine;
-	if (m < 0)
-		m = 0; /* ELF EM_NONE */
-
-	hdr->elf_mach = m;
+	hdr->elf_mach = info.e_machine;
 	ret = 0;
 error:
 	close(fd);
-- 
2.7.4

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-19 01:40 +0200
  [PATCH 01/15] perf jit: Add missing curly braces Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-19 01:40 +0200
  [PATCH 11/15] perf cpu_map: Add more helpers Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-19 01:40 +0200
  [PATCH 07/15] tools: Copy the bitops files accessed from the kernel and check for drift Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-19 01:40 +0200
  [PATCH 13/15] perf script python: Fix string vs byte array resolving Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-19 01:40 +0200
  [PATCH 10/15] perf stat: Balance opening and reading events Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-19 01:40 +0200
  [PATCH 12/15] perf probe: Warn unmatched function filter correctly Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-19 01:40 +0200
  [PATCH 08/15] perf tools: Remove include/linux/list.h from perf's MANIFEST Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-19 01:40 +0200
  [PATCH 05/15] perf tools: Remove tools/perf/util/include/linux/const.h Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-19 01:40 +0200
  [PATCH 06/15] Remove: kernel unistd*h files from perf's MANIFEST, not used Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-19 01:40 +0200
  [PATCH 04/15] perf tools: Remove tools/perf/util/include/asm/byteorder.h Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-19 01:40 +0200
  [PATCH 02/15] perf jit: Remove some no-op error handling Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-19 01:40 +0200
  [PATCH 14/15] perf tools: Make is_printable_array global Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-19 01:40 +0200
  Re: [GIT PULL 00/15] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2016-07-19 08:50 +0200

csiph-web