From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.groups.io with SMTP id smtpd.web10.10796.1595506109520011396 for ; Thu, 23 Jul 2020 05:08:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=jGBEE7WQ; spf=pass (domain: nuviainc.com, ip: 209.85.128.65, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f65.google.com with SMTP id w3so4959843wmi.4 for ; Thu, 23 Jul 2020 05:08:29 -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=Fb7oZ4kQRNI1fdA/Xqa3zMnpgmzjBKrXiN9BR4cGyWA=; b=jGBEE7WQesOpLMLqusbTlWpWVYWdtuyClRtuuSOvs5BzrQiVn0ooI5qvazb6Kfwmtg 0vA1nvEVwXyn9ht0YoGqSX+AZ33FeiAA9oWd2F3YZ4jMmyrytxUc2yswV6BdYFhI6WKx cAT4RVBEF4Fa4AHyZX36u5EluYWxzkykS/38BnclHgnoY6OKw+k3ZzQT4YOtsI5RlL79 oZz+kPXc4xCyvn8KVb3QpfVZ44z+YrZ0ox4OJ8SCLrDNkCswLfht3xxEm7U5wQHeZpwo 3a76HkF9gxyuRRqrhvGkjQllEC/9ZE0XW5dhwH8UlMGw/u4NKkMwD/dhZ8GHhQIv2Orn UuQw== 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=Fb7oZ4kQRNI1fdA/Xqa3zMnpgmzjBKrXiN9BR4cGyWA=; b=BL8Mdh1RTMPbaiofg8B9BGCmxI4eVLmaOCSYb3oHD2S87wdGQMyoSjLv+n35O5LQEE xR05o+Ic0goBo3w+qs0vexA5MPkaJYYJeKgzy+H3WhPpI0T0QGUWUfRKRUwHLYVEbG44 fnRLcpSu+j+0lr2GQWU2ZbvwseB+BMSxDrMtmZQaqSw0+U78/5qIS0WFcoAvWjRooJfA c2gYqm+fWuKMBhbIPBblRMdgyaVc5tlABotCITM7zlP5h2oA2GR5UcEBtL2p5qE7W878 1kS2pP8RFxA1CdEKmVoxJrXoSw5e4kOPFyCNpE2gWhSWlgRwl4tztY7oxeQghYDOnM2i 5lzQ== X-Gm-Message-State: AOAM533CTS9C1H611m5hSu9gZ+e/vZP4kqdrsUhpmCobyuDKGwfivoHj 7nJu5vp5Oo0rg7xXvUrm7k+Fag== X-Google-Smtp-Source: ABdhPJwvc/RN8s3wIIE3clmF76a/U7NgAfR7hGcpay77yuc+g9OB2mZa8RpqeNbNLglOyd7U2b5ZBw== X-Received: by 2002:a05:600c:204d:: with SMTP id p13mr3848444wmg.88.1595506108139; Thu, 23 Jul 2020 05:08:28 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id k62sm2088037wmb.16.2020.07.23.05.08.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 05:08:26 -0700 (PDT) Date: Thu, 23 Jul 2020 13:08:24 +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: <20200723120824.GN1337@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 Series pushed as d0da48f112de..e43d0884ed93, with parentheses dropped as per Laszlo's comment, and Pierre added as reported-by for this flavour of this patch. Regards, Leif 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 > > > > > 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 >