Re: checkpatch, a patch checking script.

Andi Kleen
2007-04-28T09:51:11Z

Andrew Morton <akpm@linux-foundation.org> writes:

> box:/usr/src/25> ~/checkpatch.pl patches/slub-core.patch
> Checking patches/slub-core.patch: signoffs = 30
> Use WARN_ON & Recovery code rather than BUG() and BUG_ON()

The warning is bogus imho. How do you write recovery code for internal
broken code logic?

-Andi

> 1588:+ VM_BUG_ON(!irqs_disabled());
> 1834:+ BUG_ON(flags & ~(GFP_DMA | GFP_LEVEL_MASK));
> 2538:+ BUG_ON(kmalloc_caches->size < sizeof(struct kmem_cache_node));
> 2544:+ BUG_ON(!page);
> 2546:+ BUG_ON(!n);
> 2736:+ BUG_ON(err);
> 2762:+ BUG_ON(flags & SLUB_UNIMPLEMENTED);
> 2777:+ BUG_ON(flags & (SLAB_RED_ZONE | SLAB_POISON |
> 2779:+ BUG_ON(ctor || dtor);
> 3054:+ BUG_ON(index < 0);
> 3118:+ BUG_ON(!page);
> 3120:+ BUG_ON(!s);
> 4062:+ BUG_ON(!name);
> 4083:+ BUG_ON(p > name + ID_STR_LENGTH - 1);
> 4188:+ BUG_ON(err);
>