lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1420232625-3628-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
Date:	Fri,  2 Jan 2015 22:03:45 +0100
From:	Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>
Cc:	Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>,
	Ingo Molnar <mingo@...hat.com>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Jiri Olsa <jolsa@...nel.org>,
	Namhyung Kim <namhyung@...nel.org>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Waiman Long <Waiman.Long@...com>,
	Stephane Eranian <eranian@...gle.com>,
	linux-kernel@...r.kernel.org
Subject: [PATCH] tools: perf: util: dso:  Remove some unused functions

Removes some functions that are not used anywhere:
dso__data_size() dso__data_status_seen()

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
---
 tools/perf/util/dso.c |   34 ----------------------------------
 tools/perf/util/dso.h |    3 ---
 2 files changed, 37 deletions(-)

diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 0247acf..8f0b6a3 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -359,18 +359,6 @@ out:
 	return dso->data.fd;
 }
 
-bool dso__data_status_seen(struct dso *dso, enum dso_data_status_seen by)
-{
-	u32 flag = 1 << by;
-
-	if (dso->data.status_seen & flag)
-		return true;
-
-	dso->data.status_seen |= flag;
-
-	return false;
-}
-
 static void
 dso_cache__free(struct rb_root *root)
 {
@@ -546,28 +534,6 @@ static int data_file_size(struct dso *dso)
 	return 0;
 }
 
-/**
- * dso__data_size - Return dso data size
- * @dso: dso object
- * @machine: machine object
- *
- * Return: dso data size
- */
-off_t dso__data_size(struct dso *dso, struct machine *machine)
-{
-	int fd;
-
-	fd = dso__data_fd(dso, machine);
-	if (fd < 0)
-		return fd;
-
-	if (data_file_size(dso))
-		return -1;
-
-	/* For now just estimate dso data size is close to file size */
-	return dso->data.file_size;
-}
-
 static ssize_t data_read_offset(struct dso *dso, u64 offset,
 				u8 *data, ssize_t size)
 {
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index acb651a..bd99f25 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -184,7 +184,6 @@ int dso__read_binary_type_filename(const struct dso *dso, enum dso_binary_type t
  * The dso__data_* external interface provides following functions:
  *   dso__data_fd
  *   dso__data_close
- *   dso__data_size
  *   dso__data_read_offset
  *   dso__data_read_addr
  *
@@ -222,13 +221,11 @@ int dso__read_binary_type_filename(const struct dso *dso, enum dso_binary_type t
 int dso__data_fd(struct dso *dso, struct machine *machine);
 void dso__data_close(struct dso *dso);
 
-off_t dso__data_size(struct dso *dso, struct machine *machine);
 ssize_t dso__data_read_offset(struct dso *dso, struct machine *machine,
 			      u64 offset, u8 *data, ssize_t size);
 ssize_t dso__data_read_addr(struct dso *dso, struct map *map,
 			    struct machine *machine, u64 addr,
 			    u8 *data, ssize_t size);
-bool dso__data_status_seen(struct dso *dso, enum dso_data_status_seen by);
 
 struct map *dso__new_map(const char *name);
 struct dso *dso__kernel_findnew(struct machine *machine, const char *name,
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ