From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (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 B38D0820FA for ; Thu, 16 Feb 2017 03:23:14 -0800 (PST) Received: by mail-it0-x232.google.com with SMTP id c7so95774494itd.1 for ; Thu, 16 Feb 2017 03:23:14 -0800 (PST) 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=GnC08V4xR+FeJHwsSBteDjKtnozGJ1acwP2OtB5UHRY=; b=R7Q/9sTqNgsuYqbM1JnIayOo9zBZzcQs+J8kcASQPA5X5nXgu9uLReMuppI9rmQCx6 5vAuqk4FnE13qgE9nDVnZm8Fa+7a/Kz+I+aVUufdm8mhA0fW4Qp2uDvK20iXOMrZVLQH gk0rWOxXD3B36Nzb1QRToTxqQUIz7TMQv5Wxs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GnC08V4xR+FeJHwsSBteDjKtnozGJ1acwP2OtB5UHRY=; b=gHTGyJMmAv3Lfpefy5sviw1oW0s3qJ5VnWBI0GPs2msQt7q7rdu0PHth32fWIYCaFW y2jE9cvVOhRyr9i/LgO9u8vlkDIaQpLLiVAVMT/VgYr37j6P+nfNckdnBFmjwi74v658 VgfdCEEULdrk8sGObgfT70jb+WJm30VgIS1UCZapUvm/94WegNe2QkeM+WzW4A4v2nkR yuqYl/MFy86lB7Lz/Rt9cda9KUXXJN0MP2l7XBg2q1nUPcRVVlwCgbBDxK/CSPzJQceA rzQgYj8hxwVukKy9p1Q7vPeS8VNxs7E4LGt7NwXvBx3KsS9tF9QNPlhzoqqahLVkPZmr GkUQ== X-Gm-Message-State: AMke39kZlGLehsKFRTvgoF78BSlB93akW2QlIQRpxb0NmYyX6RFl2pQKvbMotmtIpgRJjoeW/crkLPm4XMkyUtaj X-Received: by 10.36.207.212 with SMTP id y203mr1546610itf.63.1487244193990; Thu, 16 Feb 2017 03:23:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.198.134 with HTTP; Thu, 16 Feb 2017 03:23:13 -0800 (PST) In-Reply-To: <1486972380-24255-1-git-send-email-haojian.zhuang@linaro.org> References: <1486972380-24255-1-git-send-email-haojian.zhuang@linaro.org> From: Ard Biesheuvel Date: Thu, 16 Feb 2017 11:23:13 +0000 Message-ID: To: Haojian Zhuang Cc: Leif Lindholm , "edk2-devel@lists.01.org" Subject: Re: [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: Thu, 16 Feb 2017 11:23:14 -0000 Content-Type: text/plain; charset=UTF-8 On 13 February 2017 at 07:52, Haojian Zhuang wrote: > 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 Reviewed-by: Ard Biesheuvel > --- > 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 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel