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

Re: [Xen-devel] [PATCH] 1 of 2: default ssid to 0



Reiner Sailer wrote:
From: aq <aquynh@xxxxxxxxx>

+     for(j=0; j<= CWALL_MAX_SSIDREFS; j++)
+         if ((0 < j) &&( j <= CWALL_MAX_TYPES))
+             ssidrefs[j*CWALL_MAX_TYPES + j - 1] = htons(1);
+

why dont you run the loop from j=1?

because row j=0 is the new default ssid and has no types set.
We start with row j=1 and set the "diagonal" types to one.

I think aq's point was that the above loop is equivalent to:

  #include <stdlib.h> // for 'min'

  for (j = 1; j <= min(CWALL_MAX_SSIDREFS, CWALL_MAX_TYPES); j++) {
      ssidrefs[j*CWALL_MAX_TYPES + j - 1] = htons(1);
  }

which is arguably clearer.

--
David Hopwood <david.nospam.hopwood@xxxxxxxxxxxxxxxx>


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.