lkml.org 
[lkml]   [2021]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/4] hugetlb: Remove redundant validation in has_same_uncharge_info()
Date
The callers of has_same_uncharge_info() has accessed the original file_region
and new file_region, and they are impossible to be NULL now. So we can remove
the file_region validation in has_same_uncharge_info() to simplify the code.

Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
---
mm/hugetlb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 8902b07..5922629 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -333,8 +333,7 @@ static bool has_same_uncharge_info(struct file_region *rg,
struct file_region *org)
{
#ifdef CONFIG_CGROUP_HUGETLB
- return rg && org &&
- rg->reservation_counter == org->reservation_counter &&
+ return rg->reservation_counter == org->reservation_counter &&
rg->css == org->css;

#else
--
1.8.3.1
\
 
 \ /
  Last update: 2021-10-21 08:32    [W:2.262 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site