From: "Maciej Rabeda" <maciej.rabeda@linux.intel.com>
To: devel@edk2.groups.io, philmd@redhat.com, shenglei.zhang@intel.com
Cc: Siyuan Fu <siyuan.fu@intel.com>, Jiaxin Wu <jiaxin.wu@intel.com>
Subject: Re: [edk2-devel] [PATCH v2] NetworkPkg/DxeNetLib: Change the order of conditions in IF statement
Date: Wed, 20 May 2020 14:48:17 +0200 [thread overview]
Message-ID: <55233fdb-6fc8-b03a-1448-234f2bdd2798@linux.intel.com> (raw)
In-Reply-To: <d9d55b4f-65b4-6ae1-f1aa-c97da55525a3@redhat.com>
Merged:
https://github.com/tianocore/edk2/pull/634
https://github.com/tianocore/edk2/commit/d3733188a2162abf72dd08c0cedd1119b5cfe6c4
Thanks,
Maciej
On 20-May-20 13:41, Philippe Mathieu-Daudé wrote:
> On 5/20/20 5:08 AM, Zhang, Shenglei wrote:
>> The condition, NET_HEADSPACE(&(Nbuf->BlockOp[Index])) < Len, is
>> meaningless if Index = 0. So checking 'Index != 0' should be
>> performed first in the if statement.
>>
>> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
>> Cc: Siyuan Fu <siyuan.fu@intel.com>
>> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
>> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
>> ---
>>
>> v2: Update 'Index > 0' to 'Index != 0'
>>
>> NetworkPkg/Library/DxeNetLib/NetBuffer.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/NetworkPkg/Library/DxeNetLib/NetBuffer.c
>> b/NetworkPkg/Library/DxeNetLib/NetBuffer.c
>> index a232802c9a21..329a17623d94 100644
>> --- a/NetworkPkg/Library/DxeNetLib/NetBuffer.c
>> +++ b/NetworkPkg/Library/DxeNetLib/NetBuffer.c
>> @@ -1063,7 +1063,7 @@ NetbufAllocSpace (
>> } else {
>> NetbufGetByte (Nbuf, 0, &Index);
>> - if ((NET_HEADSPACE(&(Nbuf->BlockOp[Index])) < Len) && (Index
>> > 0)) {
>> + if ((Index != 0) && (NET_HEADSPACE(&(Nbuf->BlockOp[Index])) <
>> Len)) {
>
> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
>
>> Index--;
>> }
>> }
>>
>
>
>
>
next prev parent reply other threads:[~2020-05-20 12:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 3:08 [PATCH v2] NetworkPkg/DxeNetLib: Change the order of conditions in IF statement Zhang, Shenglei
2020-05-20 9:03 ` Maciej Rabeda
2020-05-20 11:41 ` [edk2-devel] " Philippe Mathieu-Daudé
2020-05-20 12:48 ` Maciej Rabeda [this message]
[not found] <16109DC42FE5E79D.3891@groups.io>
2020-05-20 3:10 ` Zhang, Shenglei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55233fdb-6fc8-b03a-1448-234f2bdd2798@linux.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox