From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Hopwood Subject: Re: [PATCH] 1 of 2: default ssid to 0 Date: Sun, 26 Jun 2005 14:55:56 +0100 Message-ID: <42BEB3EC.8090906@blueyonder.co.uk> References: Reply-To: david.nospam.hopwood@blueyonder.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Reiner Sailer wrote: >>From: aq >>+ 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 // 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