Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1044977AbdDWKdu (ORCPT ); Sun, 23 Apr 2017 06:33:50 -0400 Received: from mx.kolabnow.com ([95.128.36.1]:24242 "EHLO mx-out01.mykolab.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1044913AbdDWKdU (ORCPT ); Sun, 23 Apr 2017 06:33:20 -0400 X-Spam-Flag: NO X-Spam-Score: -2.9 From: Federico Vaga To: Steven Rostedt Cc: LKML , Federico Vaga Subject: [PATCH 1/5] plugin:python: fix compiler warning Date: Sun, 23 Apr 2017 12:22:54 +0200 Message-Id: <20170423102258.21609-2-federico.vaga@vaga.pv.it> In-Reply-To: <20170423102258.21609-1-federico.vaga@vaga.pv.it> References: <20170423102258.21609-1-federico.vaga@vaga.pv.it> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1302 Lines: 50 The function `load_plugin` is passed, as argument, to `trace_util_load_plugins()` but the prototype was not exactly the same. Signed-off-by: Federico Vaga --- plugin_python.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugin_python.c b/plugin_python.c index da07d27..d3da8b0 100644 --- a/plugin_python.c +++ b/plugin_python.c @@ -20,7 +20,7 @@ static const char pyload[] = "finally:\n" " file.close()\n"; -static void load_plugin(struct pevent *pevent, const char *path, +static int load_plugin(struct pevent *pevent, const char *path, const char *name, void *data) { PyObject *globals = data; @@ -32,7 +32,7 @@ static void load_plugin(struct pevent *pevent, const char *path, PyObject *res; if (!full || !n) - return; + return -ENOMEM; strcpy(full, path); strcat(full, "/"); @@ -43,7 +43,7 @@ static void load_plugin(struct pevent *pevent, const char *path, asprintf(&load, pyload, full, n); if (!load) - return; + return -ENOMEM; res = PyRun_String(load, Py_file_input, globals, globals); if (!res) { @@ -53,6 +53,8 @@ static void load_plugin(struct pevent *pevent, const char *path, Py_DECREF(res); free(load); + + return 0; } int PEVENT_PLUGIN_LOADER(struct pevent *pevent) -- 2.9.3