From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 29DE41A1E3A for ; Mon, 24 Oct 2016 06:05:07 -0700 (PDT) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 96FDC821C3; Mon, 24 Oct 2016 13:05:06 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-107.phx2.redhat.com [10.3.116.107]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9OD55bO030981; Mon, 24 Oct 2016 09:05:05 -0400 To: Ard Biesheuvel , edk2-devel@ml01.01.org References: <1477314075-18874-1-git-send-email-ard.biesheuvel@linaro.org> Cc: leif.lindholm@linaro.org From: Laszlo Ersek Message-ID: Date: Mon, 24 Oct 2016 15:05:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1477314075-18874-1-git-send-email-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 24 Oct 2016 13:05:06 +0000 (UTC) Subject: Re: [PATCH] ArmPlatformPkg/NorFlashDxe: eliminate void pointer arithmetic X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2016 13:05:07 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 10/24/16 15:01, Ard Biesheuvel wrote: > While most compilers happily allow arithmetic on void pointer, > the RVCT compiler does not, and throws the following warning for > NorFlashDxe: > > ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c(894,48) : > error #1254-D: arithmetic on pointer to void or function type > > Since the expression in question involves a cast from UINTN to VOID*, > simply add some parentheses to eliminate this warning. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Ard Biesheuvel > --- > ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c > index ca61ac5e1983..1098d9501cc7 100644 > --- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c > +++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c > @@ -891,7 +891,7 @@ NorFlashRead ( > SEND_NOR_COMMAND (Instance->DeviceBaseAddress, 0, P30_CMD_READ_ARRAY); > > // Readout the data > - AlignedCopyMem (Buffer, (VOID *)StartAddress + Offset, BufferSizeInBytes); > + AlignedCopyMem (Buffer, (VOID *)(StartAddress + Offset), BufferSizeInBytes); > > return EFI_SUCCESS; > } > Reviewed-by: Laszlo Ersek