xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Keir Fraser <keir.xen@gmail.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Jan Beulich <JBeulich@suse.com>, Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Patch v2] common/initcall: Extern linker symbols with correct types.
Date: Tue, 22 Oct 2013 17:56:14 +0100	[thread overview]
Message-ID: <CE8C6CBE.3A115%keir.xen@gmail.com> (raw)
In-Reply-To: <5266A901.2070904@citrix.com>

On 22/10/2013 17:34, "Andrew Cooper" <andrew.cooper3@citrix.com> wrote:

> On 18/10/13 15:06, Andrew Cooper wrote:
>> Coverity IDs 1054956, 1054957
>> 
>> Coverity pointed out that we applying array operations based on an expression
>> which yielded singleton pointers.  The problem is actually that the externs
>> were typed incorrectly.
>> 
>> Correct the extern declaration to prevent straying into undefined behaviour,
>> and relying on the lenience of GCC to work.
>> 
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> CC: Keir Fraser <keir@xen.org>
>> CC: Jan Beulich <JBeulich@suse.com>
> 
> Ping?

Acked-by: Keir Fraser <keir@xen.org>

>> 
>> ---
>> 
>> Changes in v2: apply const correctness as well.
>> ---
>>  xen/common/kernel.c |   11 ++++++-----
>>  1 file changed, 6 insertions(+), 5 deletions(-)
>> 
>> diff --git a/xen/common/kernel.c b/xen/common/kernel.c
>> index b8707d9..4ca50c4 100644
>> --- a/xen/common/kernel.c
>> +++ b/xen/common/kernel.c
>> @@ -196,19 +196,20 @@ void add_taint(unsigned flag)
>>      tainted |= flag;
>>  }
>>  
>> -extern initcall_t __initcall_start, __presmp_initcall_end, __initcall_end;
>> +extern const initcall_t __initcall_start[], __presmp_initcall_end[],
>> +    __initcall_end[];
>>  
>>  void __init do_presmp_initcalls(void)
>>  {
>> -    initcall_t *call;
>> -    for ( call = &__initcall_start; call < &__presmp_initcall_end; call++ )
>> +    const initcall_t *call;
>> +    for ( call = __initcall_start; call < __presmp_initcall_end; call++ )
>>          (*call)();
>>  }
>>  
>>  void __init do_initcalls(void)
>>  {
>> -    initcall_t *call;
>> -    for ( call = &__presmp_initcall_end; call < &__initcall_end; call++ )
>> +    const initcall_t *call;
>> +    for ( call = __presmp_initcall_end; call < __initcall_end; call++ )
>>          (*call)();
>>  }
>>  
> 

      reply	other threads:[~2013-10-22 16:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-17 17:03 [PATCH] common/initcall: Extern linker symbols with correct types Andrew Cooper
2013-10-18  7:51 ` Jan Beulich
2013-10-18  9:33   ` Andrew Cooper
2013-10-18 14:06     ` [Patch v2] " Andrew Cooper
2013-10-22 16:34       ` Andrew Cooper
2013-10-22 16:56         ` Keir Fraser [this message]

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=CE8C6CBE.3A115%keir.xen@gmail.com \
    --to=keir.xen@gmail.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.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 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).