Skip to contentSkip to conversation

- [4/15] - remove defconfig ptr comparisons to 0 - fs/jbd

PATCH New Joe Perches 1 participant 1 message Nov 14, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 - [4/15] - remove defconfig ptr comparisons to 0 - fs/jbd

Remove defconfig ptr comparison to 0

Remove sparse warning: Using plain integer as NULL pointer

---

fs/jbd/journal.c +2 -2
index 5d14243..0459657 100644
@@ -1619,14 +1619,14 @@ static int journal_init_journal_head_cache(void)
 {
 	int retval;
 
-	J_ASSERT(journal_head_cache == 0);
+	J_ASSERT(!journal_head_cache);
 	journal_head_cache = kmem_cache_create("journal_head",
 				sizeof(struct journal_head),
 				0,		/* offset */
 				SLAB_TEMPORARY,	/* flags */
 				NULL);		/* ctor */
 	retval = 0;
-	if (journal_head_cache == 0) {
+	if (!journal_head_cache) {
 		retval = -ENOMEM;
 		printk(KERN_EMERG "JBD: no memory for journal_head cache\n");
 	}
fs/jbd/revoke.c +2 -2
index ad2eacf..d5f8eee 100644
@@ -173,13 +173,13 @@ int __init journal_init_revoke_caches(void)
 					   0,
 					   SLAB_HWCACHE_ALIGN|SLAB_TEMPORARY,
 					   NULL);
-	if (revoke_record_cache == 0)
+	if (!revoke_record_cache)
 		return -ENOMEM;
 
 	revoke_table_cache = kmem_cache_create("revoke_table",
 					   sizeof(struct jbd_revoke_table_s),
 					   0, SLAB_TEMPORARY, NULL);
-	if (revoke_table_cache == 0) {
+	if (!revoke_table_cache) {
 		kmem_cache_destroy(revoke_record_cache);
 		revoke_record_cache = NULL;
 		return -ENOMEM;