[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fwts-devel
Subject:    [PATCH 06/10] cpu: virt: put extern virt helper func declarations in virt.h
From:       Colin King <colin.king () canonical ! com>
Date:       2014-06-12 18:03:45
Message-ID: 1402596229-461-6-git-send-email-colin.king () canonical ! com
[Download RAW message or body]

From: Colin Ian King <colin.king@canonical.com>

Building with -Werror=missing-declarations picked up the following:

cpu/virt/virt_svm.c:67:6: error: no previous declaration
 for ‘virt_check_svm' [-Werror=missing-declarations]
 void virt_check_svm(fwts_framework *fw)
      ^

So put the virt_check_* helper function declarations in virt.h
and include these in virt_*.c

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/cpu/virt/virt.c     |  4 +---
 src/cpu/virt/virt.h     | 27 +++++++++++++++++++++++++++
 src/cpu/virt/virt_svm.c |  1 +
 src/cpu/virt/virt_vmx.c |  1 +
 4 files changed, 30 insertions(+), 3 deletions(-)
 create mode 100644 src/cpu/virt/virt.h

diff --git a/src/cpu/virt/virt.c b/src/cpu/virt/virt.c
index 276b9c1..d4f1d4d 100644
--- a/src/cpu/virt/virt.c
+++ b/src/cpu/virt/virt.c
@@ -23,6 +23,7 @@
 #define _GNU_SOURCE
 
 #include "fwts.h"
+#include "virt.h"
 
 #ifdef FWTS_ARCH_INTEL
 
@@ -62,9 +63,6 @@ static int virt_deinit(fwts_framework *fw)
 
 static int virt_test1(fwts_framework *fw)
 {
-	extern void virt_check_svm(fwts_framework *);
-	extern void virt_check_vmx(fwts_framework *);
-
 	if (strstr(fwts_virt_cpuinfo->vendor_id, "AMD") != NULL) {
 		virt_check_svm(fw);
 	} else if (strstr(fwts_virt_cpuinfo->vendor_id, "Intel") != NULL) {
diff --git a/src/cpu/virt/virt.h b/src/cpu/virt/virt.h
new file mode 100644
index 0000000..b94fd8e
--- /dev/null
+++ b/src/cpu/virt/virt.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2014 Canonical
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+#ifndef __FWTS_VIRT_H__
+#define __FWTS_VIRT_H__
+
+#include "fwts.h"
+
+extern void virt_check_svm(fwts_framework *);
+extern void virt_check_vmx(fwts_framework *);
+
+#endif
diff --git a/src/cpu/virt/virt_svm.c b/src/cpu/virt/virt_svm.c
index 85cbc4c..83edc3a 100644
--- a/src/cpu/virt/virt_svm.c
+++ b/src/cpu/virt/virt_svm.c
@@ -29,6 +29,7 @@
 #define _GNU_SOURCE
 
 #include "fwts.h"
+#include "virt.h"
 
 #ifdef FWTS_ARCH_INTEL
 
diff --git a/src/cpu/virt/virt_vmx.c b/src/cpu/virt/virt_vmx.c
index f911da9..fc1add2 100644
--- a/src/cpu/virt/virt_vmx.c
+++ b/src/cpu/virt/virt_vmx.c
@@ -29,6 +29,7 @@
 #define _GNU_SOURCE
 
 #include "fwts.h"
+#include "virt.h"
 
 #ifdef FWTS_ARCH_INTEL
 
-- 
2.0.0


-- 
fwts-devel mailing list
fwts-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/fwts-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic