hv_balloon: Remove redundant assignment to region_start
Subsystems (2)
PATCH 1/1 hv_balloon: Remove redundant assignment to region_start
Variable region_start is set to pg_start but this value is never read as it is overwritten later on, hence it is a redundant assignment and can be removed.
Cleans up the following clang-analyzer warning:
drivers/hv/hv_balloon.c:1013:3: warning: Value stored to 'region_start' is never read [clang-analyzer-deadcode.DeadStores].
--- drivers/hv/hv_balloon.c | 1 - 1 file changed, 1 deletion(-)
drivers/hv/hv_balloon.c +0 -1
@@ -1010,7 +1010,6 @@ static void hot_add_req(struct work_struct *dummy)* that need to be hot-added while ensuring the alignment * and size requirements of Linux as it relates to hot-add. */ - region_start = pg_start; region_size = (pfn_cnt /HA_CHUNK ) *HA_CHUNK ;if (pfn_cnt %HA_CHUNK ) region_size +=HA_CHUNK ;
Signature · 1 line
1.8.3.1
Quoted 3 lines · Jiapeng Chong
Variable
region_startis set topg_startbut this value is never read as it is overwritten later on, hence it is a redundant assignment and can be removed.
Indeed. It is overwritten a few lines below.
Quoted 8 lines
Cleans up the following clang-analyzer warning:
drivers/hv/hv_balloon.c:1013:3: warning: Value stored to 'region_start' is never read [clang-analyzer-deadcode.DeadStores].Reported-by Abaci Robot <[email protected]>Signed-off-by Jiapeng Chong <[email protected]>
Applied to hyperv-next. Thanks.
Wei.
Quoted 19 lines
--- drivers/hv/hv_balloon.c | 1 - 1 file changed, 1 deletion(-)drivers/hv/hv_balloon.c +0
-1@@ -1010,7 +1010,6 @@ static void hot_add_req(struct work_struct *dummy)* that need to be hot-added while ensuring the alignment * and size requirements of Linux as it relates to hot-add. */ - region_start = pg_start; region_size = (pfn_cnt /HA_CHUNK ) *HA_CHUNK ;if (pfn_cnt %HA_CHUNK ) region_size +=HA_CHUNK ;Signature · 1 line
1.8.3.1