latencytop: Fix build with clang

Clang is stricter with syntax checking and flags the functions return
values if they dont match with function signatures, Fixed thusly

(From OE-Core rev: 91b8c2900570720d56a123a90e927f49a6a6095f)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Khem Raj 2015-09-07 07:45:00 +00:00 committed by Richard Purdie
parent c8f4822c4d
commit 3d8fd2f0ec
2 changed files with 68 additions and 2 deletions

View File

@ -0,0 +1,64 @@
From db112739dc4f608a968b8104b382955dc3d96ca3 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 7 Sep 2015 07:40:10 +0000
Subject: [PATCH] Rectify the function signatures to fix prototype mismatches
clang is less forgiving when it comes to coding standards, correct the
function signatures to reflect the function logic
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending
fsync.c | 7 ++++---
latencytop.h | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/fsync.c b/fsync.c
index 82dff0e..5cefba9 100644
--- a/fsync.c
+++ b/fsync.c
@@ -51,7 +51,7 @@ struct fsync_files {
static GList *fsync_data;
-static chain_file(struct fsync_process *proc, char *filename)
+static void chain_file(struct fsync_process *proc, char *filename)
{
struct fsync_files *file;
GList *item;
@@ -75,7 +75,7 @@ static chain_file(struct fsync_process *proc, char *filename)
proc->files = g_list_append(proc->files, file);
}
-static report_file(char *process, char *file)
+static void report_file(char *process, char *file)
{
struct fsync_process *proc;
GList *item;
@@ -157,9 +157,10 @@ int enable_fsync_tracer(void)
write_to_file("/sys/kernel/debug/tracing/current_tracer", "fsync");
write_to_file("/sys/kernel/debug/tracing/iter_ctrl", "ftrace_printk");
write_to_file("/sys/kernel/debug/tracing/tracing_on", "1");
+ return ret;
}
-int disable_fsync_tracer(void)
+void disable_fsync_tracer(void)
{
write_to_file("/sys/kernel/debug/tracing/tracing_on", "0");
}
diff --git a/latencytop.h b/latencytop.h
index 5394d73..9d107a8 100644
--- a/latencytop.h
+++ b/latencytop.h
@@ -54,5 +54,5 @@ extern char *translate(char *line);
extern void init_translations(char *filename);
extern int fsync_display(int duration);
extern int enable_fsync_tracer(void);
-extern int disable_fsync_tracer(void);
+extern void disable_fsync_tracer(void);
extern void update_list(void);
--
2.5.1

View File

@ -10,7 +10,9 @@ PR = "r3"
SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/${BPN}/${BP}.tar.gz/73bb3371c6ee0b0e68e25289027e865c/${BP}.tar.gz \
file://latencytop-makefile.patch \
file://latencytop-fsync.patch"
file://latencytop-fsync.patch \
file://0001-Rectify-the-function-signatures-to-fix-prototype-mis.patch \
"
SRC_URI[md5sum] = "73bb3371c6ee0b0e68e25289027e865c"
SRC_URI[sha256sum] = "9e7f72fbea7bd918e71212a1eabaad8488d2c602205d2e3c95d62cd57e9203ef"
@ -21,7 +23,7 @@ PACKAGECONFIG[x11] = ",,gtk+"
EXTRA_OEMAKE_X = "${@bb.utils.contains('PACKAGECONFIG', 'x11', 'HAS_GTK_GUI=1', '', d)}"
CFLAGS += "${LDFLAGS}"
#CFLAGS += "${LDFLAGS}"
do_install() {
oe_runmake install DESTDIR=${D} ${EXTRA_OEMAKE_X}