Chris Samuel
2010-Nov-13 02:07 UTC
[PATCH] kmem_cache_alloc doesn''t return ERR_PTR so no need to check for it.
According to scripts/coccinelle/null/eno.cocci "The various basic memory allocation functions don''t return ERR_PTR" so there''s no point in calling IS_ERR() on the return value from them, the existing test is good enough. Signed-off-by: Chris Samuel <chris@csamuel.org> --- fs/btrfs/extent_map.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 23cb8da..8797704 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c @@ -50,7 +50,7 @@ struct extent_map *alloc_extent_map(gfp_t mask) { struct extent_map *em; em = kmem_cache_alloc(extent_map_cache, mask); - if (!em || IS_ERR(em)) + if (!em) return em; em->in_tree = 0; em->flags = 0; -- 1.7.0.4 -- Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html