From: Pekka Enberg Subject: Re: [PATCH v2 1/8] kvm tools: Add optional parameter used in ioport callbacks Date: Thu, 26 May 2011 12:43:35 +0300 Message-ID: References: <1306392135-16993-1-git-send-email-levinsasha928@gmail.com> <1306400009.16757.118.camel@jaguar> <1306400568.3065.8.camel@lappy> <1306401269.3065.12.camel@lappy> <1306402736.3065.14.camel@lappy> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Cc: john@jfloren.net, kvm@vger.kernel.org, mingo@elte.hu, asias.hejun@gmail.com, gorcunov@gmail.com, prasadjoshi124@gmail.com To: Sasha Levin Return-path: Received: from mail-vw0-f46.google.com ([209.85.212.46]:48897 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757280Ab1EZJng (ORCPT ); Thu, 26 May 2011 05:43:36 -0400 Received: by vws1 with SMTP id 1so379948vws.19 for ; Thu, 26 May 2011 02:43:36 -0700 (PDT) In-Reply-To: <1306402736.3065.14.camel@lappy> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, May 26, 2011 at 12:38 PM, Sasha Levin wrote: >> One option here is to rename 'struct ioport_entry' to 'struct ioport' >> and pass a pointer to that as the first argument to all of the ops. >> That's what most APIs in the kernel do anyway. > > Why do it like that? this way users of the callback functions will need > to know the internal structure of struct ioport_entry. Look at 'struct inode' or similar data structure in the kernel. That's how we do it. You can then also do s/params/priv/.