public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Chris Mason <chris.mason@oracle.com>
Cc: linux-btrfs@vger.kernel.org
Subject: [patch] btrfs: remove dead code
Date: Thu, 7 Jan 2010 18:25:44 +0300	[thread overview]
Message-ID: <20100107152544.GC8134@bicker> (raw)

rb_node cannot be an ERR_PTR() here.  Both implimentations of __tree_search()
return either a valid pointer or NULL.

It doesn't make a runtime difference but without this patch smatch thinks that
lookup_extent_mapping() can return an ERR_PTR().  It can wait until 2.6.34 
obviously.

Signed-off-by: Dan Carpenter <error27@gmail.com>

--- orig/fs/btrfs/extent_map.c	2010-01-07 10:50:30.000000000 +0300
+++ devel/fs/btrfs/extent_map.c	2010-01-07 10:50:40.000000000 +0300
@@ -349,10 +349,6 @@ struct extent_map *lookup_extent_mapping
 		em = NULL;
 		goto out;
 	}
-	if (IS_ERR(rb_node)) {
-		em = ERR_PTR(PTR_ERR(rb_node));
-		goto out;
-	}
 	em = rb_entry(rb_node, struct extent_map, rb_node);
 	if (end > em->start && start < extent_map_end(em))
 		goto found;

             reply	other threads:[~2010-01-07 15:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-07 15:25 Dan Carpenter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-01-28 11:50 [PATCH] btrfs: Remove dead code Muhammad Usama Anjum
2022-02-01 14:05 ` David Sterba
2013-11-29 17:01 [PATCH] btrfs: remove " Michal Nazarewicz
2013-11-29 20:00 ` Filipe David Manana
2009-08-24 18:40 [PATCH] Btrfs: " Josef Bacik
2009-03-26 13:39 btrfs: memory leak on error path error27
2009-03-26 13:54 ` unhandled kmallocs remaining Dan Carpenter
2009-03-26 14:10   ` [patch] btrfs: remove dead code Dan Carpenter

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=20100107152544.GC8134@bicker \
    --to=error27@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox