mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
tools lib traceevent: Cleanup realloc use
The if branch is completely unnecessary since 'realloc' can handle NULL pointers for the first parameter. This patch is just an adoption of Ulrich Drepper's recent patch on perf tools. Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ulrich Drepper <drepper@gmail.com> Link: http://lkml.kernel.org/r/1335230984-7613-1-git-send-email-namhyung.kim@lge.com Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
parent
c9bbabe32a
commit
f6ced60fb6
2 changed files with 10 additions and 22 deletions
|
@ -633,12 +633,8 @@ static void add_event(struct pevent *pevent, struct event_format *event)
|
|||
{
|
||||
int i;
|
||||
|
||||
if (!pevent->events)
|
||||
pevent->events = malloc_or_die(sizeof(event));
|
||||
else
|
||||
pevent->events =
|
||||
realloc(pevent->events, sizeof(event) *
|
||||
(pevent->nr_events + 1));
|
||||
pevent->events = realloc(pevent->events, sizeof(event) *
|
||||
(pevent->nr_events + 1));
|
||||
if (!pevent->events)
|
||||
die("Can not allocate events");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue