From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web12.28379.1595450150926224399 for ; Wed, 22 Jul 2020 13:35:51 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ThHI5N14; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595450149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oaxX++0gP6UdFhH0Tba70DiVhZitboUc5hvW2nh2mDQ=; b=ThHI5N14h4cqZzJTmGUbC3Z3V623jlPlSBitzzjLoKQ5dG2zYT5/MfhC410IT40mZGBa3B bea0rMVYhcaMo0oOx7ajRAuwzkkYxMGkTBodjOAAdrs7NrebYSwWODXFofolYKXVH7y8gJ KAus1yk8s0Ieorc7U9zU60O1gvEQAnE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-376-AIoS2z3BMEqOiy8J-zg7YA-1; Wed, 22 Jul 2020 16:34:55 -0400 X-MC-Unique: AIoS2z3BMEqOiy8J-zg7YA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1A86A106B24B; Wed, 22 Jul 2020 20:34:54 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-129.ams2.redhat.com [10.36.113.129]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0EB3471D00; Wed, 22 Jul 2020 20:34:52 +0000 (UTC) Subject: Re: [PATCH 1/1] EmbeddedPkg: fix gcc build errors in AndroidBootImgLib To: Leif Lindholm , devel@edk2.groups.io Cc: Pierre Gondois , Bob Feng References: <20200721125056.32195-1-leif@nuviainc.com> From: "Laszlo Ersek" Message-ID: <4f591b72-94de-8a67-76dc-f82c41e11523@redhat.com> Date: Wed, 22 Jul 2020 22:34:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200721125056.32195-1-leif@nuviainc.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 07/21/20 14:50, Leif Lindholm wrote: > Commit dbd546a32d5a > ("BaseTools: Add gcc flag to warn on void* pointer arithmetic") > does its work and triggers build errors in this library. > Update the affected code to build correctly again. > > Cc: Pierre Gondois > Cc: Laszlo Ersek > Cc: Bob Feng > Signed-off-by: Leif Lindholm > --- > > Pierre - can you please ensure to CC Arm maintainers when proposing > changes to Arm build flags? (And build test all the top-level edk2 > packages *cough*.) or we could perhaps introduce EmbeddedPkg/EmbeddedPkg.ci.yaml > > Bob - can you please ensure Arm maintainers have commented on changes to > global build flags? > (Would it be possible to break up tools_def.template into separate > arch-specific include files so we could have GetMaintainer.py be > more helpful for this?) > > Laszlo - you're not formally an EmbeddedPkg reviewer, but Ard is out for > another couple of weeks. But since the Linaro CI is currently broken and > the fix is trivial, could you have a look please? > > EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c b/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c > index e1036954ee58..15b5bf451330 100644 > --- a/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c > +++ b/EmbeddedPkg/Library/AndroidBootImgLib/AndroidBootImgLib.c > @@ -97,7 +97,7 @@ AndroidBootImgGetKernelInfo ( > ASSERT (IS_VALID_ANDROID_PAGE_SIZE (Header->PageSize)); > > *KernelSize = Header->KernelSize; > - *Kernel = BootImg + Header->PageSize; > + *Kernel = (VOID *)((UINTN)BootImg + Header->PageSize); > return EFI_SUCCESS; > } > Header->PageSize has type UINT32, so this is OK (the addition is performed in UINTN, so the conversion back to VOID* is from UINTN). > @@ -341,7 +341,7 @@ AndroidBootImgUpdateFdt ( > > Status = AndroidBootImgSetProperty64 (UpdatedFdtBase, ChosenNode, > "linux,initrd-end", > - (UINTN)(RamdiskData + RamdiskSize)); > + ((UINTN)RamdiskData + RamdiskSize)); > if (EFI_ERROR (Status)) { > goto Fdt_Exit; > } > RamdiskSize is a UINTN, so this is OK too. (You could even strip the outer parentheses: (UINTN)RamdiskData + RamdiskSize ) Reviewed-by: Laszlo Ersek Thanks Laszlo