All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Samuel <chris@csamuel.org>
To: linux-btrfs@vger.kernel.org
Cc: Chris Mason <chris.mason@oracle.com>
Subject: [PATCH] kmem_cache_alloc doesn't return ERR_PTR so no need to check for it.
Date: Sat, 13 Nov 2010 13:07:11 +1100	[thread overview]
Message-ID: <4CDDF2CF.9060605@csamuel.org> (raw)

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

                 reply	other threads:[~2010-11-13  2:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CDDF2CF.9060605@csamuel.org \
    --to=chris@csamuel.org \
    --cc=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.