Commit 0e6b9c98be1b517bf99a21d8a7036a8a21e47dd1

Authored by Akinobu Mita
Committed by Linus Torvalds
1 parent 72280ede31

use SLAB_PANIC flag cleanup

Use SLAB_PANIC and delete duplicated panic().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Ian Molton <spyro@f2s.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 6 changed files with 11 additions and 27 deletions Side-by-side Diff

arch/arm26/mm/memc.c
... ... @@ -176,14 +176,10 @@
176 176 {
177 177 pte_cache = kmem_cache_create("pte-cache",
178 178 sizeof(pte_t) * PTRS_PER_PTE,
179   - 0, 0, pte_cache_ctor, NULL);
180   - if (!pte_cache)
181   - BUG();
  179 + 0, SLAB_PANIC, pte_cache_ctor, NULL);
182 180  
183 181 pgd_cache = kmem_cache_create("pgd-cache", MEMC_TABLE_SIZE +
184 182 sizeof(pgd_t) * PTRS_PER_PGD,
185   - 0, 0, pgd_cache_ctor, NULL);
186   - if (!pgd_cache)
187   - BUG();
  183 + 0, SLAB_PANIC, pgd_cache_ctor, NULL);
188 184 }
arch/frv/mm/pgalloc.c
... ... @@ -151,10 +151,8 @@
151 151 pgd_cache = kmem_cache_create("pgd",
152 152 PTRS_PER_PGD * sizeof(pgd_t),
153 153 PTRS_PER_PGD * sizeof(pgd_t),
154   - 0,
  154 + SLAB_PANIC,
155 155 pgd_ctor,
156 156 pgd_dtor);
157   - if (!pgd_cache)
158   - panic("pgtable_cache_init(): Cannot create pgd cache");
159 157 }
... ... @@ -751,12 +751,9 @@
751 751 pmd_cache = kmem_cache_create("pmd",
752 752 PTRS_PER_PMD*sizeof(pmd_t),
753 753 PTRS_PER_PMD*sizeof(pmd_t),
754   - 0,
  754 + SLAB_PANIC,
755 755 pmd_ctor,
756 756 NULL);
757   - if (!pmd_cache)
758   - panic("pgtable_cache_init(): cannot create pmd cache");
759   -
760 757 if (!SHARED_KERNEL_PMD) {
761 758 /* If we're in PAE mode and have a non-shared
762 759 kernel pmd, then the pgd size must be a
763 760  
... ... @@ -770,11 +767,9 @@
770 767 pgd_cache = kmem_cache_create("pgd",
771 768 pgd_size,
772 769 pgd_size,
773   - 0,
  770 + SLAB_PANIC,
774 771 pgd_ctor,
775 772 (!SHARED_KERNEL_PMD) ? pgd_dtor : NULL);
776   - if (!pgd_cache)
777   - panic("pgtable_cache_init(): Cannot create pgd cache");
778 773 }
779 774  
780 775 /*
arch/ia64/ia32/ia32_support.c
... ... @@ -252,10 +252,8 @@
252 252 extern struct kmem_cache *partial_page_cachep;
253 253  
254 254 partial_page_cachep = kmem_cache_create("partial_page_cache",
255   - sizeof(struct partial_page), 0, 0,
256   - NULL, NULL);
257   - if (!partial_page_cachep)
258   - panic("Cannot create partial page SLAB cache");
  255 + sizeof(struct partial_page),
  256 + 0, SLAB_PANIC, NULL, NULL);
259 257 }
260 258 #endif
261 259 return 0;
arch/powerpc/mm/init_64.c
... ... @@ -183,12 +183,9 @@
183 183 "for size: %08x...\n", name, i, size);
184 184 pgtable_cache[i] = kmem_cache_create(name,
185 185 size, size,
186   - 0,
  186 + SLAB_PANIC,
187 187 zero_ctor,
188 188 NULL);
189   - if (! pgtable_cache[i])
190   - panic("pgtable_cache_init(): could not create %s!\n",
191   - name);
192 189 }
193 190 }
... ... @@ -311,9 +311,9 @@
311 311  
312 312 BUG_ON(unlikely(nr_entries >= NR_PMB_ENTRIES));
313 313  
314   - pmb_cache = kmem_cache_create("pmb", sizeof(struct pmb_entry),
315   - 0, 0, pmb_cache_ctor, pmb_cache_dtor);
316   - BUG_ON(!pmb_cache);
  314 + pmb_cache = kmem_cache_create("pmb", sizeof(struct pmb_entry), 0,
  315 + SLAB_PANIC, pmb_cache_ctor,
  316 + pmb_cache_dtor);
317 317  
318 318 jump_to_P2();
319 319