Received: from [140.186.70.92] (port=34078 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P9FnA-0005Sb-IA for qemu-devel@nongnu.org; Fri, 22 Oct 2010 07:28:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P9Fn8-00022u-MD for qemu-devel@nongnu.org; Fri, 22 Oct 2010 07:28:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32310) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P9Fn8-00022k-EZ for qemu-devel@nongnu.org; Fri, 22 Oct 2010 07:28:10 -0400 From: Markus Armbruster Subject: Re: [Qemu-devel] Re: [PATCH v6 08/12] pcie/aer: helper functions for pcie aer capability References: <20101020095616.GD10783@redhat.com> Date: Fri, 22 Oct 2010 13:28:00 +0200 In-Reply-To: <20101020095616.GD10783@redhat.com> (Michael S. Tsirkin's message of "Wed, 20 Oct 2010 11:56:16 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: skandasa@cisco.com, etmartin@cisco.com, wexu2@cisco.com, qemu-devel@nongnu.org, Isaku Yamahata , adnan@khaleel.us "Michael S. Tsirkin" writes: > On Wed, Oct 20, 2010 at 05:18:57PM +0900, Isaku Yamahata wrote: >> This patch implements helper functions for pcie aer capability >> which will be used later. >> >> Signed-off-by: Isaku Yamahata > > Some style comments and a couple of minor bugs. [...] >> + >> +static int aer_log_add_err(PCIEAERLog *aer_log, const PCIEAERErr *err) >> +{ >> + uint32_t i; >> + if (aer_log_full(aer_log)) { >> + return -1; >> + } >> + i = aer_log_add(aer_log); >> + memcpy(&aer_log->log[i], err, sizeof(*err)); > > sizeof is not a function, you don't need () Matter of taste. Yes, it's an operator, but it's as function-like as operators get. For what it's worth, grep says roughly 98% of our sizeof uses are followed by '('. I doubt the parenthesis are required for grouping that often. [...]