From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adin Scannell Subject: [PATCH 2/3] Small fix-ups for the xen/privcmd ioctls Date: Tue, 20 Dec 2011 01:36:52 -0500 Message-ID: <1324363013-11031-3-git-send-email-adin@scannell.ca> References: <1324363013-11031-1-git-send-email-adin@scannell.ca> Return-path: In-Reply-To: <1324363013-11031-1-git-send-email-adin@scannell.ca> Sender: linux-kernel-owner@vger.kernel.org To: xen-devel@lists.xensource.com Cc: konrad@darnok.org, andres@gridcentric.ca, adin@gridcentric.com, olaf@aepfle.de, JBeulich@suse.com, linux-kernel@vger.kernel.org, Adin Scannell List-Id: xen-devel@lists.xenproject.org In implementing the mmap_batch_v2 ioctl, some of the feedback included small fixups that were also relevant to the existing mmap_batch ioctl. Prior to the mmap_batch_v2 patch, this adds those small fixups to the existing code. The const addition for gather_array is necessary for the implementation of mmap_batch_v2 and does not affect correctness. Signed-off-by: Adin Scannell --- drivers/xen/privcmd.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c index ccee0f1..161681f 100644 --- a/drivers/xen/privcmd.c +++ b/drivers/xen/privcmd.c @@ -76,7 +76,7 @@ static void free_page_list(struct list_head *pages) */ static int gather_array(struct list_head *pagelist, unsigned nelem, size_t size, - void __user *data) + const void __user *data) { unsigned pageidx; void *pagedata; @@ -246,7 +246,7 @@ struct mmap_batch_state { domid_t domain; unsigned long va; struct vm_area_struct *vma; - int err; + unsigned long err; xen_pfn_t __user *user; }; @@ -256,6 +256,8 @@ static int mmap_batch_fn(void *data, void *state) xen_pfn_t *mfnp = data; struct mmap_batch_state *st = state; + BUG_ON(st == NULL || st->vma == NULL); + if (xen_remap_domain_mfn_range(st->vma, st->va & PAGE_MASK, *mfnp, 1, st->vma->vm_page_prot, st->domain) < 0) { *mfnp |= 0xf0000000U; -- 1.6.2.5