All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
	xen-devel@lists.xensource.com,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Andres Lagar-Cavilla <andreslc@gridcentric.ca>,
	kernel-janitors@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [Xen-devel] [patch 3/3] xen/privcmd: remove const modifier from declaration
Date: Mon, 10 Sep 2012 10:43:19 +0000	[thread overview]
Message-ID: <504DC447.9010301@citrix.com> (raw)
In-Reply-To: <504DC8FE020000780009A190@nat28.tlf.novell.com>

On 10/09/12 10:03, Jan Beulich wrote:
>>>> On 08.09.12 at 11:58, Dan Carpenter <dan.carpenter@oracle.com> wrote:
>> 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.
> 
> NAK - the const is very valid here, as the v2 interface (as opposed
> to the v1 one) does _not_ modify this array (or if it does, it's a
> bug). This is a guarantee made to user mode, so it should also be
> expressed that way in the interface.
> 
> But of course the cast used before this patch isn't right either, as
> it indeed inappropriately discards the qualifier. Afaiu this was done
> to simplify the internal workings of the code, but I don't think it's
> desirable to sacrifice type safety for implementation simplicity.

m.arr here isn't const as m is really the V1 structure where m.arr is
non-const.

David

WARNING: multiple messages have this Message-ID (diff)
From: David Vrabel <david.vrabel@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
	xen-devel@lists.xensource.com,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Andres Lagar-Cavilla <andreslc@gridcentric.ca>,
	kernel-janitors@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [patch 3/3] xen/privcmd: remove const modifier from declaration
Date: Mon, 10 Sep 2012 11:43:19 +0100	[thread overview]
Message-ID: <504DC447.9010301@citrix.com> (raw)
In-Reply-To: <504DC8FE020000780009A190@nat28.tlf.novell.com>

On 10/09/12 10:03, Jan Beulich wrote:
>>>> On 08.09.12 at 11:58, Dan Carpenter <dan.carpenter@oracle.com> wrote:
>> 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.
> 
> NAK - the const is very valid here, as the v2 interface (as opposed
> to the v1 one) does _not_ modify this array (or if it does, it's a
> bug). This is a guarantee made to user mode, so it should also be
> expressed that way in the interface.
> 
> But of course the cast used before this patch isn't right either, as
> it indeed inappropriately discards the qualifier. Afaiu this was done
> to simplify the internal workings of the code, but I don't think it's
> desirable to sacrifice type safety for implementation simplicity.

m.arr here isn't const as m is really the V1 structure where m.arr is
non-const.

David

  parent reply	other threads:[~2012-09-10 10:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-08  9:58 [patch 3/3] xen/privcmd: remove const modifier from declaration Dan Carpenter
2012-09-08  9:58 ` Dan Carpenter
2012-09-09 19:50 ` Andres Lagar-Cavilla
2012-09-09 19:50 ` Andres Lagar-Cavilla
2012-09-09 19:50   ` Andres Lagar-Cavilla
2012-09-10  9:03 ` [Xen-devel] " Jan Beulich
2012-09-10  9:03 ` Jan Beulich
2012-09-10  9:03   ` Jan Beulich
2012-09-10 10:21   ` [patch 3/3 v2] xen/privcmd: add a __user annotation to a cast Dan Carpenter
2012-09-10 10:21     ` Dan Carpenter
2012-09-10 10:43   ` David Vrabel [this message]
2012-09-10 10:43     ` [patch 3/3] xen/privcmd: remove const modifier from declaration David Vrabel
2012-09-10 10:43   ` [Xen-devel] " David Vrabel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=504DC447.9010301@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andreslc@gridcentric.ca \
    --cc=dan.carpenter@oracle.com \
    --cc=jeremy@goop.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=konrad.wilk@oracle.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.