From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sasha Levin Subject: Re: [PATCH 3/3] kvm tools: Convert virtio devices to use IRQ registry Date: Fri, 06 May 2011 19:50:08 +0300 Message-ID: <1304700608.10534.11.camel@lappy> References: <1304681052-30992-1-git-send-email-levinsasha928@gmail.com> <1304681052-30992-3-git-send-email-levinsasha928@gmail.com> <20110506115635.GA17112@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: penberg@kernel.org, asias.hejun@gmail.com, gorcunov@gmail.com, prasadjoshi124@gmail.com, kvm@vger.kernel.org To: Ingo Molnar Return-path: Received: from mail-wy0-f174.google.com ([74.125.82.174]:46956 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756649Ab1EFQuT (ORCPT ); Fri, 6 May 2011 12:50:19 -0400 Received: by wya21 with SMTP id 21so2549230wya.19 for ; Fri, 06 May 2011 09:50:17 -0700 (PDT) In-Reply-To: <20110506115635.GA17112@elte.hu> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, 2011-05-06 at 13:56 +0200, Ingo Molnar wrote: > * Sasha Levin wrote: > > > + bdev->pci_device.irq_pin = pin; > > + bdev->pci_device.irq_line = line; > > One small remaining naming inconsistency caught my eyes. The generic convention > should be something like: > > - structure names should be along the 'struct xyz_device' scheme > > - structure field names should be 'xyz_dev' > > - variable names within xyz driver's .c file should be 'xdev', > but 'xyz_dev' is OK too, especially if used in some other file) > > In that sense, the above should be: > > bdev->pci_dev.irq_pin = pin; > bdev->pci_dev.irq_line = line; > > This could be fixed in a followup patch - and there's more of the same > inconsistency in other driver files as well. > > If such details are sorted out early on in a project's lifetime it will be > applied in a very natural way as the code grows. The struct name there actually refers to a PCI header of a device, and not an actual device. I'll rename it to pci_hdr instead of making it pci_dev, since it looks more confusing than desirable. -- Sasha.