From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] common/initcall: Extern linker symbols with correct types. Date: Fri, 18 Oct 2013 10:33:03 +0100 Message-ID: <5261004F.9000304@citrix.com> References: <1382029433-28919-1-git-send-email-andrew.cooper3@citrix.com> <5261048902000078000FBFCA@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VX6Qd-0005D5-7e for xen-devel@lists.xenproject.org; Fri, 18 Oct 2013 09:33:07 +0000 In-Reply-To: <5261048902000078000FBFCA@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org On 18/10/13 08:51, Jan Beulich wrote: >>>> On 17.10.13 at 19:03, 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. > Fine by me, but if you already touch this I would have really liked > to see you also make the declarations const-correct. > > Jan Very good point - I shall submit v2 in due course. ~Andrew > >> Signed-off-by: Andrew Cooper >> CC: Keir Fraser >> CC: Jan Beulich >> --- >> xen/common/kernel.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/xen/common/kernel.c b/xen/common/kernel.c >> index b8707d9..e785edb 100644 >> --- a/xen/common/kernel.c >> +++ b/xen/common/kernel.c >> @@ -196,19 +196,19 @@ void add_taint(unsigned flag) >> tainted |= flag; >> } >> >> -extern initcall_t __initcall_start, __presmp_initcall_end, __initcall_end; >> +extern 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++ ) >> + 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++ ) >> + for ( call = __presmp_initcall_end; call < __initcall_end; call++ ) >> (*call)(); >> } >> >> -- >> 1.7.10.4 > >