From: Alex Williamson Subject: Re: [PATCH 10/19] pci-assign: Replace kvm_assign_set_msix_entry with kvm_device_msix_set_vector Date: Thu, 16 Aug 2012 10:43:05 -0600 Message-ID: <1345135385.4683.477.camel@ul30vt.home> References: <1345134065.4683.471.camel@ul30vt.home> <502D210A.8000800@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Jan Kiszka , Marcelo Tosatti , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:43606 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932285Ab2HPSWA (ORCPT ); Thu, 16 Aug 2012 14:22:00 -0400 In-Reply-To: <502D210A.8000800@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, 2012-08-16 at 19:34 +0300, Avi Kivity wrote: > On 08/16/2012 07:21 PM, Alex Williamson wrote: > >> > >> +int kvm_device_msix_set_vector(KVMState *s, uint32_t dev_id, uint32_t vector, > >> + int virq) > >> +{ > >> + struct kvm_assigned_msix_entry msix_entry = { > >> + .assigned_dev_id = dev_id, > >> + .gsi = virq, > >> + .entry = vector, > >> + }; > >> + > >> + memset(msix_entry.padding, 0, sizeof(msix_entry.padding)); > > > > nit, I think this can be done w/o a memset. .padding = { 0 }? Thanks, > > It can be done with a null statement. The msix_entry initialization > above zero-initializes all fields that are not mentioned in the initializer. Yeah, I thought that was probably the case as well. Thanks for confirming. The .padding = 0 in the previous patch could also be dropped then. Alex