From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mx.groups.io with SMTP id smtpd.web11.9664.1595501838422879650 for ; Thu, 23 Jul 2020 03:57:18 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=NqYruad2; spf=pass (domain: nuviainc.com, ip: 209.85.221.65, mailfrom: leif@nuviainc.com) Received: by mail-wr1-f65.google.com with SMTP id z18so1152097wrm.12 for ; Thu, 23 Jul 2020 03:57:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jmQMSBhwhrE12cQaJR07c+hYLRGltkrlZAEvpc0vqpg=; b=NqYruad2wyKO7K7Vw/aQLRGLT2XKEznZPfUABl6sWUIr8Hy3T4YXEp2FLVryBZCjvd 7RlwDJUhWOFIqNE062P1d3kCvznjAVOueL2DBfUli05v6EskNNpREzkoDMSSvYnBV0Wc 9ut9WAICESM13WAn3XF9MGzLj7SjrMeOW3/8YjD80CzFuTAJ4hKnUh4GbZaMajM/m/u7 sL6LT3ngU2oYzC7bYmXJSOdSYFTzcJQUjczts29eSbbKrvgnGjfPG3nIUelPmAOwI6ew hngcvjAF66pSx13KAqNy4FnmpW4+7t0wDKeiyNFChNp/VGTaUO4BMjxKu+TtHGUb07T5 kHtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jmQMSBhwhrE12cQaJR07c+hYLRGltkrlZAEvpc0vqpg=; b=KYMarbUNSjsy5MYKX52gRPgRlyyXnjvnB8HqVHQsRHZ/KYDvIUSxqzBTTKpbOWOsr2 anOyuzwxbB0F4aqp05pb//5bZc1Em1Y0ugkoAwtYViXLcnEMVHar8zxcS83ZKUl6tHBh MQls5JMBQ+YRvjgSSfROMxkA76r2sA/aKVcxJxat6wjfYOjQn8idBoG66dpDWyJUpyzP yj17ECITgfB1Kkhg7RPQQ2t4kfMz/DvSoPLfUbm7dSQNBnNnRuX/PGml8RBNSSG1f3qy DKQmvaeDGKrPvxpgYFkd9bTFZRTLoib73G1cAWm2l8FG9VTShcFbp2hTD5fj1eIDgxn9 nW7w== X-Gm-Message-State: AOAM533ZLEqIcHFq4bVBd4WkoPpOjUmZaX1C7TqJ2WpTrfw33NbAWV1A 3h6G+dHPvt0KhZv0xfIxhDf18A== X-Google-Smtp-Source: ABdhPJzF02RRltpjT654mLaVSJM68sEl/GKIxZgalOu2ixAdCgtz2xmJVZfdCaI3O2Kh+lii1ytj6g== X-Received: by 2002:adf:e704:: with SMTP id c4mr3850785wrm.81.1595501837061; Thu, 23 Jul 2020 03:57:17 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id a11sm3648763wrq.0.2020.07.23.03.57.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 03:57:16 -0700 (PDT) Date: Thu, 23 Jul 2020 11:57:14 +0100 From: "Leif Lindholm" To: Laszlo Ersek Cc: devel@edk2.groups.io, Pierre Gondois , Bob Feng Subject: Re: [PATCH 1/1] EmbeddedPkg: fix gcc build errors in AndroidBootImgLib Message-ID: <20200723105714.GL1337@vanye> References: <20200721125056.32195-1-leif@nuviainc.com> <4f591b72-94de-8a67-76dc-f82c41e11523@redhat.com> MIME-Version: 1.0 In-Reply-To: <4f591b72-94de-8a67-76dc-f82c41e11523@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jul 22, 2020 at 22:34:52 +0200, Laszlo Ersek wrote: > 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 Ah, do those get picked up automagically? If so we should definitely do that, as well as for ArmPkg. > > > > 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 > ) Yes, I'll do that. I just found the moving a single character aesthetically pleasing :) > Reviewed-by: Laszlo Ersek Thanks! / Leif