From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=A2HQ6voL; spf=pass (domain: linaro.org, ip: 209.85.221.65, mailfrom: leif.lindholm@linaro.org) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by groups.io with SMTP; Mon, 10 Jun 2019 04:14:46 -0700 Received: by mail-wr1-f65.google.com with SMTP id c2so8731007wrm.8 for ; Mon, 10 Jun 2019 04:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+5/Efc5NU7mHy3ZeG4R6VKZNkeXonaZbsNYUS2lazlM=; b=A2HQ6voLLIwozlLq93uWKHhsN8Yq/k+Yn3gxuC9GCwwQ7fWIjEgI8VaX4y3lzLpkr/ yGmGj4KefFXqkCzKg8Ug0pgcl2256+uZPCxho029LezaUfGJ9obIH1vmlbs4CW6/hXYk gbsWaO4vs2zaISVMJEs8HZc2pV9TN8eiITzP5I/YpZt9QZtate3QVEKJzQjtw8MdIgcR COiThFRqRM8RVZgEpzkBQ2/mqPO8PgKDqyCS6Z6P8iEdXf72/ki7QauF/s3NMBol27Kd fxh0lENIzlfg+BVMUnthyGsd/n3qwHslWNwS6GxO8G7LeKb6s3kMJUvbFIdNRlaW9wRV 0IJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+5/Efc5NU7mHy3ZeG4R6VKZNkeXonaZbsNYUS2lazlM=; b=dpMKuzQhXXDu3QkEw+J/eqWgQiVLKcUNEHLLPfDMxa595NNtD8b0T2ups8ixQLoIDd YOaET1899TdRMWihF8PbP8srWk5tLfI5eUvY/GajajZVFxJCjwMQms/CRrmNFu2vAjnN RSAhsn48//RB7jIPH+n20Dx9p9tOss9kbd/rPVc6aG9sguHvZfhccNmhDmaK0G5KxM8C I/mZmMgaHA2YCRXs4yHVLtPj33hQ0YK/TG6vE3OiB2N+22wwjT+Do8AIIWc4zf07MSmQ RMWfr2XV8Qt5gciKz4o8n6ze9zwRJR0epoZ3Z71b3HRe0MPA1tzcGyEb228W+TA1gKie 8EcQ== X-Gm-Message-State: APjAAAUCJY+O48UKV8XlAMcEy+/t3+HHCcC7SepvHE3dc3+LWVQVbr/t xvYbKTGNa4UlzArwOeXd1Xcnxg== X-Google-Smtp-Source: APXvYqxmClLvwuBSrPeOekiIUKv/1pS0T2mzPKUsRZ0LElWBSAxMDbWptHpZhD9j1XA0izIaSvwLOA== X-Received: by 2002:a5d:414c:: with SMTP id c12mr32132634wrq.88.1560165284716; Mon, 10 Jun 2019 04:14:44 -0700 (PDT) Return-Path: Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id o1sm13123006wre.76.2019.06.10.04.14.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jun 2019 04:14:43 -0700 (PDT) Date: Mon, 10 Jun 2019 12:14:42 +0100 From: "Leif Lindholm" To: Zhichao Gao Cc: devel@edk2.groups.io, Jian J Wang , Hao A Wu , Ray Ni , Star Zeng , Liming Gao , Sean Brogan , Michael Turner , Bret Barkelew Subject: Re: [PATCH v5 5/5] MdeMoudlePkg/CapsulePei: No need to remain space for null-terminate Message-ID: <20190610111441.vgba27vikp2ntc2p@bivouac.eciton.net> References: <20190610052036.11924-1-zhichao.gao@intel.com> <20190610052036.11924-6-zhichao.gao@intel.com> MIME-Version: 1.0 In-Reply-To: <20190610052036.11924-6-zhichao.gao@intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Many thanks for reworking this series. This will make the code much more accessible in the future. One very minor comment below: On Mon, Jun 10, 2019 at 01:20:36PM +0800, Zhichao Gao wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1853 > > UnicodeValueToStringS would remain two bytes for the first > parameter to set the null- terminate. So remove this change > in Mu. > > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Ray Ni > Cc: Star Zeng > Cc: Liming Gao > Cc: Sean Brogan > Cc: Michael Turner > Cc: Bret Barkelew > Cc: Leif Lindholm > Signed-off-by: Zhichao gao > --- > MdeModulePkg/Universal/CapsulePei/UefiCapsule.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c b/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c > index 3ac95b7be6..fabf30926c 100644 > --- a/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c > +++ b/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c > @@ -922,7 +922,7 @@ GetScatterGatherHeadEntries ( > if (Index != 0) { > UnicodeValueToStringS ( > TempVarName, > - (sizeof (CapsuleVarName) - ((StrLen (CapsuleVarName) + 1) * sizeof (CHAR16))), > + (sizeof(CapsuleVarName) - ((UINTN)TempVarName - (UINTN)CapsuleVarName)), Could you add the space back after sizeof before committing? With that - for the series: Reviewed-by: Leif Lindholm > 0, > Index, > 0 > -- > 2.21.0.windows.1 >