From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH] KVM: introduce __kvm_io_bus_sort_cmp Date: Wed, 31 Jul 2013 06:31:52 -0400 (EDT) Message-ID: <1740231204.7441078.1375266712603.JavaMail.root@redhat.com> References: <1375196737-2264-1-git-send-email-pbonzini@redhat.com> <20130731090457.GB7484@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: linux-kernel@vger.kernel.org, cornelia huck , kvm@vger.kernel.org To: Gleb Natapov Return-path: In-Reply-To: <20130731090457.GB7484@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org ----- Gleb Natapov wrote: > On Tue, Jul 30, 2013 at 05:05:37PM +0200, Paolo Bonzini wrote: > > kvm_io_bus_sort_cmp is used also directly, not just as a callback for > > sort and bsearch. In these cases, it is handy to have a type-safe > > variant. This patch introduces such a variant, __kvm_io_bus_sort_cmp, > > and uses it throughout kvm_main.c. > > > > Signed-off-by: Paolo Bonzini > > --- > > virt/kvm/kvm_main.c | 21 ++++++++++++--------- > > 1 file changed, 12 insertions(+), 9 deletions(-) > > > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > > index b2a2bb9..e0d127d 100644 > > --- a/virt/kvm/kvm_main.c > > +++ b/virt/kvm/kvm_main.c > > @@ -2812,11 +2812,9 @@ static void kvm_io_bus_destroy(struct kvm_io_bus *bus) > > kfree(bus); > > } > > > > -static int kvm_io_bus_sort_cmp(const void *p1, const void *p2) > > +static inline int __kvm_io_bus_sort_cmp(const struct kvm_io_range *r1, > > + const struct kvm_io_range *r2) > IMO calling this one kvm_io_bus_sort_cmp and another one > kvm_io_bus_cmp will be better naming. Ok. Paolo