From patchwork Mon Oct 24 13:01:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 78950 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp2565616qge; Mon, 24 Oct 2016 06:01:37 -0700 (PDT) X-Received: by 10.107.159.5 with SMTP id i5mr12312607ioe.222.1477314097689; Mon, 24 Oct 2016 06:01:37 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id uc9si12731667pab.238.2016.10.24.06.01.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Oct 2016 06:01:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E77C41A1E3B; Mon, 24 Oct 2016 06:01:36 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (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 6FBD41A1E3A for ; Mon, 24 Oct 2016 06:01:35 -0700 (PDT) Received: by mail-wm0-x235.google.com with SMTP id c78so114571929wme.1 for ; Mon, 24 Oct 2016 06:01:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=cp17GQpXHVB2BANgOrdb23sNcAJ7tf8ALhBYF/A6AiA=; b=FnsNup7y9FP8DGZN4Pj+A0/Mn46gR15nWosfXkHjd0RvxSvx8DaF+T4eAiAupYqj0A kBxVrpFH7CRIxVz0s0Qpnee3y4xvdFZx3+9nJAW0BH2q5JuGCRDOtvA6QdD3BpLU4cz3 /ew+0Dl/6PVCJoa8W16wNCLXVn6Kpque5VNkA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=cp17GQpXHVB2BANgOrdb23sNcAJ7tf8ALhBYF/A6AiA=; b=Xr2fz0v61c2kGZ0E3UPFtfneaPL1ORIJRHFlhkgrIRiQJVcpgPDvKlwtSg4BjW0Y4v /WF+Ou9z55RBQ9XesSZczmMigGrr/bR0EepCxwVxbZ7V3pQRka+pjL6P4NTVicfY8XA2 /5HTYzVgVPFEn2Pv/Ivrowvdlwj2oHwxnrgys8/QWZyPSaKdoQfWVYBV2rF7W9X+rt+i 0VqsAJk7+p8JmSlqbMpkQ+wzJslGYXnTlY0d3zuAef78zC3iGmtlPn2ujwqFsoQpknd2 RuFpGHVermcTPzNHrYmbfFNC3vqo6IdolE7KQQKVpunLGyse6Kbe0cF8muTp1KqTpapN 9ExQ== X-Gm-Message-State: AA6/9RkW8CHMmcn3theIgzRF8zNUCe962HzwGy6XLxQ732QvuzFrfB6V4th1zjf1qKm0hcjB X-Received: by 10.28.132.130 with SMTP id g124mr23236133wmd.37.1477314090443; Mon, 24 Oct 2016 06:01:30 -0700 (PDT) Received: from localhost.localdomain ([105.146.229.54]) by smtp.gmail.com with ESMTPSA id 198sm14677375wmn.14.2016.10.24.06.01.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Oct 2016 06:01:29 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 24 Oct 2016 14:01:15 +0100 Message-Id: <1477314075-18874-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [edk2] [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: , Cc: lersek@redhat.com, leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Laszlo Ersek Reviewed-by: Ryan Harkin 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; }