From 485205712433611ee9939a869b4f734f824a177a Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Wed, 15 Mar 2023 03:48:48 +0000 Subject: Remove a useless assignment in nxt_mem_zone_alloc_pages(). This was reported by the 'Clang Static Analyzer' as a 'dead nested assignment'. We assign prev_size then check if it's != 0 and if true we then set prev_pages to page_size right shifted by two at the same time setting prev_size to be right shifted by two (>>=), however page_size is never used again so no need to set it here. Reviewed-by: Alejandro Colomar Signed-off-by: Andrew Clayton --- src/nxt_mem_zone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nxt_mem_zone.c b/src/nxt_mem_zone.c index f8ab09d9..a3ba3700 100644 --- a/src/nxt_mem_zone.c +++ b/src/nxt_mem_zone.c @@ -672,7 +672,7 @@ nxt_mem_zone_alloc_pages(nxt_mem_zone_t *zone, size_t alignment, uint32_t pages) prev_size = p - (u_char *) block; if (prev_size != 0) { - prev_pages = prev_size >>= zone->page_size_shift; + prev_pages = prev_size >> zone->page_size_shift; node_pages -= prev_pages; block->size = prev_pages; -- cgit