Re: [PATCH] inetpeer: use else if instead of if to reduce judgment

2021-02-28 Thread Yejune Deng
Thanks,I will adopt it and resubmit. On Fri, Feb 26, 2021 at 10:50 PM Eric Dumazet wrote: > > > > On 2/26/21 11:57 AM, Yejune Deng wrote: > > In inet_initpeers(), if si.totalram <= (8192*1024)/PAGE_SIZE, it will > > be judged three times. Use else if instead of if, it only needs to be > > judged

Re: [PATCH] inetpeer: use else if instead of if to reduce judgment

2021-02-26 Thread Eric Dumazet
On 2/26/21 11:57 AM, Yejune Deng wrote: > In inet_initpeers(), if si.totalram <= (8192*1024)/PAGE_SIZE, it will > be judged three times. Use else if instead of if, it only needs to be > judged once. > > Signed-off-by: Yejune Deng > --- > net/ipv4/inetpeer.c | 10 +- > 1 file changed,

[PATCH] inetpeer: use else if instead of if to reduce judgment

2021-02-26 Thread Yejune Deng
In inet_initpeers(), if si.totalram <= (8192*1024)/PAGE_SIZE, it will be judged three times. Use else if instead of if, it only needs to be judged once. Signed-off-by: Yejune Deng --- net/ipv4/inetpeer.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git