[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v4] xsm: add a default policy to .init.data



>>> On 07.07.16 at 16:44, <dgdegra@xxxxxxxxxxxxx> wrote:
> On 07/07/2016 06:30 AM, Jan Beulich wrote:
>>>>> On 05.07.16 at 19:44, <dgdegra@xxxxxxxxxxxxx> wrote:
>>> +static inline void xsm_policy_init(void)
>>> +{
>>> +#ifdef CONFIG_XSM_POLICY
>>> +    if ( policy_size == 0 )
>>> +    {
>>> +        policy_buffer = (char*)xsm_init_policy;
>>
>> Can't xsm_init_policy by of type const char[] then, avoiding the need
>> for a cast (you certainly shouldn't be casting away constness)? If not,
>> besides adding the const please also add a blank before the *.
> 
> The policy_buffer global cannot be a const char* because it is passed to
> xfree() below (only in ARM); the cast would only be moved.  The buffer is
> never modified, if that's what you are asking.
> 
> The reason that xsm_init_policy is unsigned is to avoid compiler warnings
> resulting from assigning values such as 0xF3 to a signed character.

This is all ugly, but you're the maintainer, so you know best.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.