Re: [PATCH v4 2/3] numatune: add check for numatune nodeset range

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 04, 2014 at 01:57:52AM +0000, Chen, Fan wrote:
On Mon, 2014-11-03 at 14:18 +0100, Martin Kletzander wrote:
On Thu, Oct 30, 2014 at 01:44:18PM +0800, Chen Fan wrote:
>diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c
>index bff3b0f..7218747 100644
>--- a/tests/qemuxml2argvmock.c
>+++ b/tests/qemuxml2argvmock.c
>@@ -21,6 +21,7 @@
> #include <config.h>
>
> #include "internal.h"
>+#include "virnuma.h"
> #include <time.h>
>
> time_t time(time_t *t)
>@@ -30,3 +31,11 @@ time_t time(time_t *t)
>         *t = ret;
>     return ret;
> }
>+
>+int
>+virNumaGetMaxNode(void)
>+{
>+   const int maxnodesNum = 7;
>+
>+   return maxnodesNum;
>+}

Why not just "return 7;" ???

I just think magic number may be not proper.


Probably a matter of taste, I'd use a comment in that case, but proper
compiler should optimize it even without that const, so no problem
here ;)

Martin

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]