From owner-svn-src-all@FreeBSD.ORG Sun Jun 13 10:20:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 425FD1065672; Sun, 13 Jun 2010 10:20:39 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id E4FC98FC19; Sun, 13 Jun 2010 10:20:38 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id 29EFF14DBAB1; Sun, 13 Jun 2010 12:20:36 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7ejdJwOXgujm; Sun, 13 Jun 2010 12:20:33 +0200 (CEST) Received: from [192.168.1.105] (catv-80-99-92-167.catv.broadband.hu [80.99.92.167]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id B444714DBAA2; Sun, 13 Jun 2010 12:20:33 +0200 (CEST) Message-ID: <4C14B0EA.8090500@FreeBSD.org> Date: Sun, 13 Jun 2010 12:20:26 +0200 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; es-ES; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: Lawrence Stewart References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> In-Reply-To: <20100613101025.GD1320@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209119 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2010 10:20:39 -0000 >> >> +/* >> + * Utility macros. >> + */ >> +#define DPCPU_SUM(n, var, sum) \ >> +do { \ >> + (sum) = 0; \ >> + u_int i; \ >> + CPU_FOREACH(i) \ >> + (sum) += (DPCPU_ID_PTR(i, n))->var; \ >> +} while (0) >> > I'd suggest first swapping variable declaration and '(sum) = 0;'. > Also using 'i' as a counter in macro can easly lead to name collision. > If you need to do it, I'd suggest '_i' or something. > Maybe it would be better to make it an inline function rather than macro? > And why using old BSD-stlye u_int? style(9) also suggest using ISO C types. -- Gabor Kovesdan FreeBSD Volunteer EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org WEB: http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org