]> xenbits.xensource.com Git - libvirt.git/commitdiff
virHostCPUGetInfo: Fix build on non-Unix like systems
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 14 Jun 2016 14:46:06 +0000 (16:46 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 15 Jun 2016 07:44:46 +0000 (09:44 +0200)
This function is plenty of ifdefs providing implementations for
Linux, *BSD and OS-X. However, if we are being build for any
other architecture, all that's left behind by preprocessor is
just a error reporting call and return of -1. In that case,
passed arguments are unused:

../../src/util/virhostcpu.c: In function 'virHostCPUGetInfo':
../../src/util/virhostcpu.c:966:33: error: unused parameter 'cpus' [-Werror=unused-parameter]
                   unsigned int *cpus,
                                 ^~~~

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virhostcpu.c

index 00c09cd4e805f6c6916849fd147e56ff9fd17541..a481be0a1174fd098ddd97abb5929c520b8bf200 100644 (file)
@@ -963,12 +963,12 @@ virHostCPUParseMapLinux(int max_cpuid, const char *path)
 
 int
 virHostCPUGetInfo(virArch hostarch ATTRIBUTE_UNUSED,
-                  unsigned int *cpus,
-                  unsigned int *mhz,
-                  unsigned int *nodes,
-                  unsigned int *sockets,
-                  unsigned int *cores,
-                  unsigned int *threads)
+                  unsigned int *cpus ATTRIBUTE_UNUSED,
+                  unsigned int *mhz ATTRIBUTE_UNUSED,
+                  unsigned int *nodes ATTRIBUTE_UNUSED,
+                  unsigned int *sockets ATTRIBUTE_UNUSED,
+                  unsigned int *cores ATTRIBUTE_UNUSED,
+                  unsigned int *threads ATTRIBUTE_UNUSED)
 {
 #ifdef __linux__
     int ret = -1;