Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752821AbbETIPe (ORCPT ); Wed, 20 May 2015 04:15:34 -0400 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]:51968 "EHLO tama500.ecl.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752453AbbETIP3 (ORCPT ); Wed, 20 May 2015 04:15:29 -0400 Message-ID: <555C4301.3070806@lab.ntt.co.jp> Date: Wed, 20 May 2015 17:17:05 +0900 From: Takuya Yoshikawa User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Paolo Bonzini , linux-kernel@vger.kernel.org, kvm@vger.kernel.org CC: Xiao Guangrong , rkrcmar@redhat.com Subject: Re: [PATCH 3/9] KVM: const-ify uses of struct kvm_userspace_memory_region References: <1432056313-36100-1-git-send-email-pbonzini@redhat.com> <1432056313-36100-4-git-send-email-pbonzini@redhat.com> In-Reply-To: <1432056313-36100-4-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 960 Lines: 33 On 2015/05/20 2:25, Paolo Bonzini wrote: > Architecture-specific helpers are not supposed to muck with > struct kvm_userspace_memory_region contents. Add const to > enforce this. Nice, this is what I wanted to do, but could not do, when I cleaned up these functions a few years ago. > > In order to eliminate the only write in __kvm_set_memory_region, > the cleaning of deleted slots is pulled up from update_memslots > to __kvm_set_memory_region. - if (!npages) - mem->flags &= ~KVM_MEM_LOG_DIRTY_PAGES; Especially, removing this hard-to-understand lines is really nice. > > Signed-off-by: Paolo Bonzini Reviewed-by: Takuya Yoshikawa Takuya -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/