lkml.org 
[lkml]   [2019]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] tracing: initialize variable in create_dyn_event()
Date
From: Frank Rowand <frank.rowand@sony.com>

Fix compile warning in create_dyn_event(): 'ret' may be used uninitialized
in this function [-Wuninitialized].

Fixes: 5448d44c3855 ("tracing: Add unified dynamic event framework")

Signed-off-by: Frank Rowand <frank.rowand@sony.com>
---

Compile and boot tested only. Please verify the initialization value
of zero is correct.

There is also a sparse warning you might want to check into (when
ARCH=arm, so 32 bit):

include/uapi/linux/perf_event.h:147:56: warning: cast truncates bits from constant value (8000000000000000 becomes 0)


kernel/trace/trace_dynevent.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace_dynevent.c b/kernel/trace/trace_dynevent.c
index dd1f43588d70..4f633476c307 100644
--- a/kernel/trace/trace_dynevent.c
+++ b/kernel/trace/trace_dynevent.c
@@ -74,7 +74,7 @@ int dyn_event_release(int argc, char **argv, struct dyn_event_operations *type)
static int create_dyn_event(int argc, char **argv)
{
struct dyn_event_operations *ops;
- int ret;
+ int ret = 0;

if (argv[0][0] == '-' || argv[0][0] == '!')
return dyn_event_release(argc, argv, NULL);
--
Frank Rowand <frank.rowand@sony.com>
\
 
 \ /
  Last update: 2019-01-25 03:19    [W:0.054 / U:0.276 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site