From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb0-x234.google.com (mail-yb0-x234.google.com [IPv6:2607:f8b0:4002:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3D90E1A1E3B for ; Mon, 24 Oct 2016 09:25:21 -0700 (PDT) Received: by mail-yb0-x234.google.com with SMTP id v190so3262104ybg.6 for ; Mon, 24 Oct 2016 09:25:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Mm/ybGhPqKL7my/kqBUD5UiMBC+Pts21j6drNpAJx5M=; b=ZAiL2t3ynQ4rjTKkpcLbq+tPinsASQhY2I7W2J0/8cx4eC5kQ6W7qpyyHm29qKDOGu ROk3kqC14aTp8EQZcBy/jbdCrBjJSP17B1ayb8GgApF7ZUrY/6mjt9x8KrKhgjNBVT8r 4WPRePONO9Pot7kLicC2bsy6lzeS6SAwKwE2s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Mm/ybGhPqKL7my/kqBUD5UiMBC+Pts21j6drNpAJx5M=; b=N4ubnfGVBv3rSUwwlW97y00j3DLDEzkEKLNZIi2oMeKRY+FXKfYDmADJxzYP2dc0Ma fL9TEc/pjhIgRre+udW/RTiHT4HgNs3PsDlCOwOXHqi5X3qtHxoJuW0OlFDeCECqgcf8 CyYtPkt/6wIjLaLPHDr1cgIwZ8Kf7We4NXj2p8Hn920wN/LyytN+GQwPMGjV1JUZNcPD emdzeIkf6ATwZyLyIPzNq+m1Pmp/761KuZNLh0p7GjjEAuE1I0bBCPtj4bvUJdTqj6o0 TgsQ5wLNJe8nud+wfz+kNb3I+VxqUXp0sxXgy61UdvtrRiR7Qwc6450aR3A1mPN+eWIi 8K3w== X-Gm-Message-State: ABUngveQQgMNumBhpAyZk+JFv1bGYsNYFXHYz29RYGFRzQztw3lcPkRDdyIHeIQ12qzPWS+a7Mo1xSf2H42fBqxI X-Received: by 10.36.66.142 with SMTP id i136mr2869791itb.63.1477326319690; Mon, 24 Oct 2016 09:25:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.5.139 with HTTP; Mon, 24 Oct 2016 09:25:19 -0700 (PDT) In-Reply-To: References: <1477314075-18874-1-git-send-email-ard.biesheuvel@linaro.org> From: Ard Biesheuvel Date: Mon, 24 Oct 2016 17:25:19 +0100 Message-ID: To: Ryan Harkin Cc: Laszlo Ersek , "edk2-devel@lists.01.org" , Leif Lindholm 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 16:25:21 -0000 Content-Type: text/plain; charset=UTF-8 On 24 October 2016 at 16:36, Ryan Harkin wrote: > On 24 October 2016 at 14:05, Laszlo Ersek wrote: >> 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 > Reviewed-by: Ryan Harkin > Pushed, thanks all