Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8e16017d authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo
Browse files

perf tools: Use memdup in map__clone

We have memdup() exactly for that, remove open coded dup.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-tnsoexrgv6u9l125srq2c7su@git.kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 237a7e04
Loading
Loading
Loading
Loading
+2 −6
Original line number Original line Diff line number Diff line
@@ -11,6 +11,7 @@
#include "strlist.h"
#include "strlist.h"
#include "vdso.h"
#include "vdso.h"
#include "build-id.h"
#include "build-id.h"
#include <linux/string.h>


const char *map_type__name[MAP__NR_TYPES] = {
const char *map_type__name[MAP__NR_TYPES] = {
	[MAP__FUNCTION] = "Functions",
	[MAP__FUNCTION] = "Functions",
@@ -213,12 +214,7 @@ struct symbol *map__find_symbol_by_name(struct map *map, const char *name,


struct map *map__clone(struct map *map)
struct map *map__clone(struct map *map)
{
{
	struct map *clone = malloc(sizeof(*clone));
	return memdup(map, sizeof(*map));

	if (clone != NULL)
		memcpy(clone, map, sizeof(*clone));

	return clone;
}
}


int map__overlap(struct map *l, struct map *r)
int map__overlap(struct map *l, struct map *r)