virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [patch 3/3] xen/privcmd: remove const modifier from declaration
@ 2012-09-08  9:58 Dan Carpenter
  2012-09-09 19:50 ` Andres Lagar-Cavilla
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dan Carpenter @ 2012-09-08  9:58 UTC (permalink / raw)
  To: Andres Lagar-Cavilla
  Cc: kernel-janitors, Jeremy Fitzhardinge, xen-devel, virtualization,
	Konrad Rzeszutek Wilk

When we use this pointer, we cast away the const modifier and modify the
data.  I think it was an accident to declare it as const.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/include/xen/privcmd.h b/include/xen/privcmd.h
index a853168..58ed953 100644
--- a/include/xen/privcmd.h
+++ b/include/xen/privcmd.h
@@ -69,7 +69,7 @@ struct privcmd_mmapbatch_v2 {
 	unsigned int num; /* number of pages to populate */
 	domid_t dom;      /* target domain */
 	__u64 addr;       /* virtual address */
-	const xen_pfn_t __user *arr; /* array of mfns */
+	xen_pfn_t __user *arr; /* array of mfns */
 	int __user *err;  /* array of error codes */
 };
 
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index 0ce006a..fceb83e 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -389,7 +389,7 @@ static long privcmd_ioctl_mmap_batch(void __user *udata, int version)
 
 	if (state.global_error && (version == 1)) {
 		/* Write back errors in second pass. */
-		state.user_mfn = (xen_pfn_t *)m.arr;
+		state.user_mfn = m.arr;
 		state.err      = err_array;
 		ret = traverse_pages(m.num, sizeof(xen_pfn_t),
 				     &pagelist, mmap_return_errors_v1, &state);

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-10 10:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-08  9:58 [patch 3/3] xen/privcmd: remove const modifier from declaration Dan Carpenter
2012-09-09 19:50 ` Andres Lagar-Cavilla
2012-09-10  9:03 ` [Xen-devel] " Jan Beulich
     [not found] ` <504DC8FE020000780009A190@nat28.tlf.novell.com>
2012-09-10 10:21   ` [patch 3/3 v2] xen/privcmd: add a __user annotation to a cast Dan Carpenter
2012-09-10 10:43   ` [Xen-devel] [patch 3/3] xen/privcmd: remove const modifier from declaration David Vrabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).