Patchwork [1/2] jbd2: remove an unneeded NULL check

login
register
mail settings
Submitter Dan Carpenter
Date Aug. 26, 2011, 9:19 a.m.
Message ID <20110826091931.GM5975@shale.localdomain>
Download mbox | patch
Permalink /patch/111730/
State Accepted
Headers show

Comments

Dan Carpenter - Aug. 26, 2011, 9:19 a.m.
We dereference "transaction" at the start of the function so the NULL
check isn't needed here.  It's not harmful, but it silences a static
checker warning when we remove this.

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

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Theodore Ts'o - Sept. 4, 2011, 2:15 p.m.
On Fri, Aug 26, 2011 at 12:19:31PM +0300, Dan Carpenter wrote:
> We dereference "transaction" at the start of the function so the NULL
> check isn't needed here.  It's not harmful, but it silences a static
> checker warning when we remove this.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Thanks for pointing this out; I've merged in the fix.

       	   	    	      	   	  - Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index a242f6f..8d7013c 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -1143,8 +1143,7 @@  int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh)
 			       jh->b_next_transaction,
 			       jh->b_next_transaction ?
 			         jh->b_next_transaction->t_tid : 0,
-			       transaction,
-			       transaction ? transaction->t_tid : 0);
+			       transaction, transaction->t_tid);
 			BUG_ON(1);
 		}
 		/* And this case is illegal: we can't reuse another