From: Corneliu ZUZU <czuzu@bitdefender.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Tamas K Lengyel <tamas@tklengyel.com>, Keir Fraser <keir@xen.org>,
Ian Campbell <ian.campbell@citrix.com>,
Razvan Cojocaru <rcojocaru@bitdefender.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
xen-devel@lists.xen.org,
Stefano Stabellini <stefano.stabellini@citrix.com>
Subject: Re: [PATCH v2] arm/monitor vm-events: Implement guest-request support
Date: Fri, 26 Feb 2016 14:53:37 +0200 [thread overview]
Message-ID: <56D04AD1.10704@bitdefender.com> (raw)
In-Reply-To: <56D053B902000078000D6AB4@prv-mh.provo.novell.com>
[-- Attachment #1.1: Type: text/plain, Size: 2230 bytes --]
On 2/26/2016 2:31 PM, Jan Beulich wrote:
>>>> On 26.02.16 at 13:20, <czuzu@bitdefender.com> wrote:
>> On 2/26/2016 2:14 PM, Razvan Cojocaru wrote:
>>> On 02/26/2016 02:05 PM, Corneliu ZUZU wrote:
>>>> On 2/26/2016 1:56 PM, Jan Beulich wrote:
>>>>>>>> On 26.02.16 at 12:07, <czuzu@bitdefender.com> wrote:
>>>>>> --- a/xen/include/asm-x86/altp2m.h
>>>>>> +++ b/xen/include/asm-x86/altp2m.h
>>>>>> @@ -15,8 +15,8 @@
>>>>>> * this program; If not, see <http://www.gnu.org/licenses/>.
>>>>>> */
>>>>>> -#ifndef _X86_ALTP2M_H
>>>>>> -#define _X86_ALTP2M_H
>>>>>> +#ifndef __ASM_X86_ALTP2M_H
>>>>>> +#define __ASM_X86_ALTP2M_H
>>>>> Unrelated change? (No need to undo, but please don't mix such
>>>>> into patches especially when they are quite large already anyway.)
>>>> Noted.
>>>>
>>>>>> @@ -33,5 +33,9 @@ void altp2m_vcpu_initialise(struct vcpu *v);
>>>>>> void altp2m_vcpu_destroy(struct vcpu *v);
>>>>>> void altp2m_vcpu_reset(struct vcpu *v);
>>>>>> -#endif /* _X86_ALTP2M_H */
>>>>>> +static inline uint16_t altp2m_vcpu_idx(struct vcpu *v)
>>>>> const
>>>> 'const', as in:
>>>>
>>>> +static inline const uint16_t altp2m_vcpu_idx(struct vcpu *v)
>>> Since there's no functional difference between returning const uint6_t
>>> and plain uint16_t, I assume that Jan meant "const struct vcpu *v".
>> I thought the functional difference would be when calling:
>>
>> uint16_t idx = altp2m_vcpu_idx(v); // => can subsequently modify idx
>> const uint16_t idx = altp2m_vcpu_idx(v); // => cannot subsequently
>> modify idx (unless const is casted to non-const)
> That's correct, but for this the return type of the function doesn't
> matter. In fact I'd expect the compiler to warn about a meaningless
> modifier placed on a function return type.
>
> Jan
>
>
I find having
static inline const uint16_t altp2m_vcpu_idx(struct vcpu *v)
and subsequently writing
uint16_t idx = altp2m_vcpu_idx(v);
instead of
const uint16_t idx = altp2m_vcpu_idx(v);
without the compiler throwing at least a warning counter-intuitive.
Reminds me of something Linus said in an email: "it would be *stupid*
for a C compiler to do anything but what we assume it does".
Noted, will change to 'const struct vcpu *v'.
Corneliu.
[-- Attachment #1.2: Type: text/html, Size: 4388 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-02-26 12:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-26 11:07 [PATCH v2] arm/monitor vm-events: Implement guest-request support Corneliu ZUZU
2016-02-26 11:56 ` Jan Beulich
2016-02-26 12:05 ` Corneliu ZUZU
2016-02-26 12:14 ` Razvan Cojocaru
2016-02-26 12:20 ` Corneliu ZUZU
2016-02-26 12:30 ` Razvan Cojocaru
2016-02-26 12:31 ` Jan Beulich
2016-02-26 12:53 ` Corneliu ZUZU [this message]
2016-02-26 13:42 ` Tamas K Lengyel
2016-02-26 13:52 ` Razvan Cojocaru
2016-02-26 14:25 ` Stefano Stabellini
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=56D04AD1.10704@bitdefender.com \
--to=czuzu@bitdefender.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=keir@xen.org \
--cc=rcojocaru@bitdefender.com \
--cc=stefano.stabellini@citrix.com \
--cc=tamas@tklengyel.com \
--cc=xen-devel@lists.xen.org \
/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.