From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Mon, 01 Jul 2019 02:24:57 -0700 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3981F821D8; Mon, 1 Jul 2019 09:24:45 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (unknown [10.36.118.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC5F76B8C9; Mon, 1 Jul 2019 09:24:39 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH 1/3] MdePkg/BaseLib: Adjust the coding style in Base64Decode To: devel@edk2.groups.io, zhichao.gao@intel.com Cc: Michael D Kinney , Liming Gao References: <20190628035746.24160-1-zhichao.gao@intel.com> <20190628035746.24160-2-zhichao.gao@intel.com> From: "Laszlo Ersek" Message-ID: <6468ec59-5d69-b8f2-e7f4-01318e0dcc79@redhat.com> Date: Mon, 1 Jul 2019 11:24:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190628035746.24160-2-zhichao.gao@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 01 Jul 2019 09:24:50 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit I have to revise my previous R-b for this patch. The patch is not wrong, but it's not complete: On 06/28/19 05:57, Gao, Zhichao wrote: > Adjust the code style for better view. > > Cc: Michael D Kinney > Cc: Liming Gao > Signed-off-by: Zhichao Gao > --- > MdePkg/Library/BaseLib/String.c | 12 +++++------- > 1 file changed, 5 insertions(+), 7 deletions(-) > > diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c > index 32e189791c..b86e7e9436 100644 > --- a/MdePkg/Library/BaseLib/String.c > +++ b/MdePkg/Library/BaseLib/String.c > @@ -1993,8 +1993,7 @@ Base64Decode ( > if (BufferSize < -2) { > return RETURN_INVALID_PARAMETER; > } > - } > - else { > + } else { > Chr = Source[SourceIndex]; > if (BAD_V != DecodingTable[(UINT8) Chr]) { > > @@ -2006,8 +2005,7 @@ Base64Decode ( > return RETURN_INVALID_PARAMETER; > } > ActualSourceLength++; The line above remains incorrectly indented. Thanks Laszlo > - } > - else { > + } else { > > // > // The reset of the decoder will ignore all invalid characters allowed here. > @@ -2029,8 +2027,8 @@ Base64Decode ( > } > > BufferSize += ActualSourceLength / 4 * 3; > - if (BufferSize < 0) { > - return RETURN_INVALID_PARAMETER; > + if (BufferSize < 0) { > + return RETURN_INVALID_PARAMETER; > } > > // > @@ -2061,7 +2059,7 @@ Base64Decode ( > // > for (Index = 0; Index < 4; Index++) { > do { > - Chr = DecodingTable[(UINT8) Source[SourceIndex++]]; > + Chr = DecodingTable[(UINT8) Source[SourceIndex++]]; > } while (Chr == BAD_V); > Value <<= 6; > Value |= (UINT32)Chr; >