From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-x234.google.com (mail-pg0-x234.google.com [IPv6:2607:f8b0:400e:c05::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 C17318210A for ; Sun, 12 Feb 2017 23:53:08 -0800 (PST) Received: by mail-pg0-x234.google.com with SMTP id v184so30513043pgv.3 for ; Sun, 12 Feb 2017 23:53:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=oFRgFQBv8Sf8mzFs4/ZB9PY4Nsyo/glEMuWph19l5So=; b=fItIpKez0M9u+TPnjxGs88F4X3aYsLXisRmhJsLWd/7SaIn4YJQZH1ab/7rPYHXtht 7GMl720d7VZii9L5wxVor3qYNbu15hYflI2mDzV3ynjrsj6aMoxXxeXZlfQN4OvvoQYj ZsXm67/RihV9zHGJD94iyp3WtwrlXsWRffJEU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=oFRgFQBv8Sf8mzFs4/ZB9PY4Nsyo/glEMuWph19l5So=; b=Ap75B5Gstw5Bar3ongiHXRjOkEeDy614YB7svonqvgyKozA7S2KlMwK36rmp6ySueW tkse8OwX2DZfPFtcKBo+vltdEN14Cq9jzCNyke/BvG6HkHvJYax4uEvbuzN2VlDeZUZs LBSZufzNlHERQvPIlyjiBBTa9rTKELWUqUPdkrnTF448dwWtIh0vy2dbFK60FeURbyPJ z+ph5t0QF3umocMITpZDuDWdNyvEIiRV3xHqlMYHN83/FeuZmo51Vrxm7YLFYRwvmx8a Tz6EAvjCJ2djaK73IYRm11upd3GCspy3q9JO5QYkzgfaoJn/gADXRGdSEF+u7BKiHUxY 0YZw== X-Gm-Message-State: AMke39nWI/7IyIWjtpmeY5qxMNAQCLV+VLDNwtOzUEVbczRx3+SgTpc35kTLb0Sx9yP516jk X-Received: by 10.84.217.68 with SMTP id e4mr27859705plj.99.1486972388408; Sun, 12 Feb 2017 23:53:08 -0800 (PST) Received: from localhost.localdomain ([45.56.159.191]) by smtp.gmail.com with ESMTPSA id m29sm18896624pfi.54.2017.02.12.23.53.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 12 Feb 2017 23:53:07 -0800 (PST) From: Haojian Zhuang To: leif.lindholm@linaro.org, ard.biesheuvel@linaro.o, edk2-devel@lists.01.org Cc: Haojian Zhuang Date: Mon, 13 Feb 2017 15:52:59 +0800 Message-Id: <1486972380-24255-1-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [PATCH 1/2] ArmPlatformPkg/PL061: remove duplicated PL061_GPIO_DATA_REG 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, 13 Feb 2017 07:53:08 -0000 PL061_GPIO_DATA_REG offset is referenced in PL061EffectiveAddress () already. So remove the duplicated reference when invoke PL061GetPins () or PL061SetPins (). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c index 0e2ea61..ff8bb3b 100644 --- a/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c +++ b/ArmPlatformPkg/Drivers/PL061GpioDxe/PL061Gpio.c @@ -186,7 +186,7 @@ Get ( return EFI_INVALID_PARAMETER; } - if (PL061GetPins (RegisterBase + PL061_GPIO_DATA_REG, Offset)) { + if (PL061GetPins (RegisterBase, Offset)) { *Value = 1; } else { *Value = 0; @@ -239,14 +239,14 @@ Set ( // Set the corresponding direction bit to HIGH for output MmioOr8 (RegisterBase + PL061_GPIO_DIR_REG, GPIO_PIN_MASK(Offset)); // Set the corresponding data bit to LOW for 0 - PL061SetPins (RegisterBase + PL061_GPIO_DATA_REG, GPIO_PIN_MASK(Offset), 0); + PL061SetPins (RegisterBase, GPIO_PIN_MASK(Offset), 0); break; case GPIO_MODE_OUTPUT_1: // Set the corresponding direction bit to HIGH for output MmioOr8 (RegisterBase + PL061_GPIO_DIR_REG, GPIO_PIN_MASK(Offset)); // Set the corresponding data bit to HIGH for 1 - PL061SetPins (RegisterBase + PL061_GPIO_DATA_REG, GPIO_PIN_MASK(Offset), 0xff); + PL061SetPins (RegisterBase, GPIO_PIN_MASK(Offset), 0xff); break; default: @@ -297,7 +297,7 @@ GetMode ( // Check if it is input or output if (MmioRead8 (RegisterBase + PL061_GPIO_DIR_REG) & GPIO_PIN_MASK(Offset)) { // Pin set to output - if (PL061GetPins (RegisterBase + PL061_GPIO_DATA_REG, GPIO_PIN_MASK(Offset))) { + if (PL061GetPins (RegisterBase, GPIO_PIN_MASK(Offset))) { *Mode = GPIO_MODE_OUTPUT_1; } else { *Mode = GPIO_MODE_OUTPUT_0; -- 2.7.4