[1/3] mm/percpu.c: remove redundant check

Message ID 20230721131800.20003-2-bhe@redhat.com
State New
Headers
Series percpu: some trivial cleanup patches |

Commit Message

Baoquan He July 21, 2023, 1:17 p.m. UTC
  The conditional check "(ai->dyn_size < PERCPU_DYNAMIC_EARLY_SIZE) has
covered the check '(!ai->dyn_size)'.

Signed-off-by: Baoquan He <bhe@redhat.com>
---
 mm/percpu.c | 1 -
 1 file changed, 1 deletion(-)
  

Comments

Dennis Zhou July 21, 2023, 8:55 p.m. UTC | #1
On Fri, Jul 21, 2023 at 09:17:58PM +0800, Baoquan He wrote:
> The conditional check "(ai->dyn_size < PERCPU_DYNAMIC_EARLY_SIZE) has
> covered the check '(!ai->dyn_size)'.
> 
> Signed-off-by: Baoquan He <bhe@redhat.com>
> ---
>  mm/percpu.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/mm/percpu.c b/mm/percpu.c
> index 28e07ede46f6..1480bf283d11 100644
> --- a/mm/percpu.c
> +++ b/mm/percpu.c
> @@ -2615,7 +2615,6 @@ void __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
>  	PCPU_SETUP_BUG_ON(ai->unit_size < PCPU_MIN_UNIT_SIZE);
>  	PCPU_SETUP_BUG_ON(!IS_ALIGNED(ai->unit_size, PCPU_BITMAP_BLOCK_SIZE));
>  	PCPU_SETUP_BUG_ON(ai->dyn_size < PERCPU_DYNAMIC_EARLY_SIZE);
> -	PCPU_SETUP_BUG_ON(!ai->dyn_size);
>  	PCPU_SETUP_BUG_ON(!IS_ALIGNED(ai->reserved_size, PCPU_MIN_ALLOC_SIZE));
>  	PCPU_SETUP_BUG_ON(!(IS_ALIGNED(PCPU_BITMAP_BLOCK_SIZE, PAGE_SIZE) ||
>  			    IS_ALIGNED(PAGE_SIZE, PCPU_BITMAP_BLOCK_SIZE)));
> -- 
> 2.34.1
> 

Acked-by: Dennis Zhou <dennis@kernel.org>

Thanks,
Dennis
  

Patch

diff --git a/mm/percpu.c b/mm/percpu.c
index 28e07ede46f6..1480bf283d11 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -2615,7 +2615,6 @@  void __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
 	PCPU_SETUP_BUG_ON(ai->unit_size < PCPU_MIN_UNIT_SIZE);
 	PCPU_SETUP_BUG_ON(!IS_ALIGNED(ai->unit_size, PCPU_BITMAP_BLOCK_SIZE));
 	PCPU_SETUP_BUG_ON(ai->dyn_size < PERCPU_DYNAMIC_EARLY_SIZE);
-	PCPU_SETUP_BUG_ON(!ai->dyn_size);
 	PCPU_SETUP_BUG_ON(!IS_ALIGNED(ai->reserved_size, PCPU_MIN_ALLOC_SIZE));
 	PCPU_SETUP_BUG_ON(!(IS_ALIGNED(PCPU_BITMAP_BLOCK_SIZE, PAGE_SIZE) ||
 			    IS_ALIGNED(PAGE_SIZE, PCPU_BITMAP_BLOCK_SIZE)));