"%zu bytes\n", vm.addr, static_size);
 
        ret = pcpu_setup_first_chunk(pcpur_get_page, static_size,
-                                    PERCPU_FIRST_CHUNK_RESERVE,
-                                    PMD_SIZE, dyn_size, vm.addr, NULL);
+                                    PERCPU_FIRST_CHUNK_RESERVE, dyn_size,
+                                    PMD_SIZE, vm.addr, NULL);
        goto out_free_ar;
 
 enomem:
                pcpue_size >> PAGE_SHIFT, pcpue_ptr, static_size);
 
        return pcpu_setup_first_chunk(pcpue_get_page, static_size,
-                                     PERCPU_FIRST_CHUNK_RESERVE,
-                                     pcpue_unit_size, dyn_size,
-                                     pcpue_ptr, NULL);
+                                     PERCPU_FIRST_CHUNK_RESERVE, dyn_size,
+                                     pcpue_unit_size, pcpue_ptr, NULL);
 }
 
 /*
                pcpu4k_nr_static_pages, static_size);
 
        ret = pcpu_setup_first_chunk(pcpu4k_get_page, static_size,
-                                    PERCPU_FIRST_CHUNK_RESERVE, -1, -1, NULL,
-                                    pcpu4k_populate_pte);
+                                    PERCPU_FIRST_CHUNK_RESERVE, -1,
+                                    -1, NULL, pcpu4k_populate_pte);
        goto out_free_ar;
 
 enomem:
 
  * @get_page_fn: callback to fetch page pointer
  * @static_size: the size of static percpu area in bytes
  * @reserved_size: the size of reserved percpu area in bytes
- * @unit_size: unit size in bytes, must be multiple of PAGE_SIZE, -1 for auto
  * @dyn_size: free size for dynamic allocation in bytes, -1 for auto
+ * @unit_size: unit size in bytes, must be multiple of PAGE_SIZE, -1 for auto
  * @base_addr: mapped address, NULL for auto
  * @populate_pte_fn: callback to allocate pagetable, NULL if unnecessary
  *
  * limited offset range for symbol relocations to guarantee module
  * percpu symbols fall inside the relocatable range.
  *
+ * @dyn_size, if non-negative, determines the number of bytes
+ * available for dynamic allocation in the first chunk.  Specifying
+ * non-negative value makes percpu leave alone the area beyond
+ * @static_size + @reserved_size + @dyn_size.
+ *
  * @unit_size, if non-negative, specifies unit size and must be
  * aligned to PAGE_SIZE and equal to or larger than @static_size +
- * @reserved_size + @dyn_size.
- *
- * @dyn_size, if non-negative, limits the number of bytes available
- * for dynamic allocation in the first chunk.  Specifying non-negative
- * value make percpu leave alone the area beyond @static_size +
- * @reserved_size + @dyn_size.
+ * @reserved_size + if non-negative, @dyn_size.
  *
  * Non-null @base_addr means that the caller already allocated virtual
  * region for the first chunk and mapped it.  percpu must not mess
  */
 size_t __init pcpu_setup_first_chunk(pcpu_get_page_fn_t get_page_fn,
                                     size_t static_size, size_t reserved_size,
-                                    ssize_t unit_size, ssize_t dyn_size,
+                                    ssize_t dyn_size, ssize_t unit_size,
                                     void *base_addr,
                                     pcpu_populate_pte_fn_t populate_pte_fn)
 {
        static struct vm_struct first_vm;
        static int smap[2], dmap[2];
+       size_t size_sum = static_size + reserved_size +
+                         (dyn_size >= 0 ? dyn_size : 0);
        struct pcpu_chunk *schunk, *dchunk = NULL;
        unsigned int cpu;
        int nr_pages;
                     ARRAY_SIZE(dmap) >= PCPU_DFL_MAP_ALLOC);
        BUG_ON(!static_size);
        if (unit_size >= 0) {
-               BUG_ON(unit_size < static_size + reserved_size +
-                                  (dyn_size >= 0 ? dyn_size : 0));
+               BUG_ON(unit_size < size_sum);
                BUG_ON(unit_size & ~PAGE_MASK);
-       } else {
-               BUG_ON(dyn_size >= 0);
+               BUG_ON(unit_size < PCPU_MIN_UNIT_SIZE);
+       } else
                BUG_ON(base_addr);
-       }
        BUG_ON(base_addr && populate_pte_fn);
 
        if (unit_size >= 0)
                pcpu_unit_pages = unit_size >> PAGE_SHIFT;
        else
                pcpu_unit_pages = max_t(int, PCPU_MIN_UNIT_SIZE >> PAGE_SHIFT,
-                                       PFN_UP(static_size + reserved_size));
+                                       PFN_UP(size_sum));
 
        pcpu_unit_size = pcpu_unit_pages << PAGE_SHIFT;
        pcpu_chunk_size = num_possible_cpus() * pcpu_unit_size;