Commit 09aaa749 authored by Joe Perches's avatar Joe Perches Committed by Dave Kleikamp

JFS: Remove defconfig ptr comparison to 0

Remove sparse warning: Using plain integer as NULL pointer
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDave Kleikamp <shaggy@linux.vnet.ibm.com>
parent a7fe0ba7
...@@ -284,11 +284,11 @@ static struct dir_table_slot *find_index(struct inode *ip, u32 index, ...@@ -284,11 +284,11 @@ static struct dir_table_slot *find_index(struct inode *ip, u32 index,
release_metapage(*mp); release_metapage(*mp);
*mp = NULL; *mp = NULL;
} }
if (*mp == 0) { if (!(*mp)) {
*lblock = blkno; *lblock = blkno;
*mp = read_index_page(ip, blkno); *mp = read_index_page(ip, blkno);
} }
if (*mp == 0) { if (!(*mp)) {
jfs_err("free_index: error reading directory table"); jfs_err("free_index: error reading directory table");
return NULL; return NULL;
} }
...@@ -413,7 +413,8 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot) ...@@ -413,7 +413,8 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot)
} }
ip->i_size = PSIZE; ip->i_size = PSIZE;
if ((mp = get_index_page(ip, 0)) == 0) { mp = get_index_page(ip, 0);
if (!mp) {
jfs_err("add_index: get_metapage failed!"); jfs_err("add_index: get_metapage failed!");
xtTruncate(tid, ip, 0, COMMIT_PWMAP); xtTruncate(tid, ip, 0, COMMIT_PWMAP);
memcpy(&jfs_ip->i_dirtable, temp_table, memcpy(&jfs_ip->i_dirtable, temp_table,
...@@ -461,7 +462,7 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot) ...@@ -461,7 +462,7 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot)
} else } else
mp = read_index_page(ip, blkno); mp = read_index_page(ip, blkno);
if (mp == 0) { if (!mp) {
jfs_err("add_index: get/read_metapage failed!"); jfs_err("add_index: get/read_metapage failed!");
goto clean_up; goto clean_up;
} }
...@@ -499,7 +500,7 @@ static void free_index(tid_t tid, struct inode *ip, u32 index, u32 next) ...@@ -499,7 +500,7 @@ static void free_index(tid_t tid, struct inode *ip, u32 index, u32 next)
dirtab_slot = find_index(ip, index, &mp, &lblock); dirtab_slot = find_index(ip, index, &mp, &lblock);
if (dirtab_slot == 0) if (!dirtab_slot)
return; return;
dirtab_slot->flag = DIR_INDEX_FREE; dirtab_slot->flag = DIR_INDEX_FREE;
...@@ -526,7 +527,7 @@ static void modify_index(tid_t tid, struct inode *ip, u32 index, s64 bn, ...@@ -526,7 +527,7 @@ static void modify_index(tid_t tid, struct inode *ip, u32 index, s64 bn,
dirtab_slot = find_index(ip, index, mp, lblock); dirtab_slot = find_index(ip, index, mp, lblock);
if (dirtab_slot == 0) if (!dirtab_slot)
return; return;
DTSaddress(dirtab_slot, bn); DTSaddress(dirtab_slot, bn);
...@@ -552,7 +553,7 @@ static int read_index(struct inode *ip, u32 index, ...@@ -552,7 +553,7 @@ static int read_index(struct inode *ip, u32 index,
struct dir_table_slot *slot; struct dir_table_slot *slot;
slot = find_index(ip, index, &mp, &lblock); slot = find_index(ip, index, &mp, &lblock);
if (slot == 0) { if (!slot) {
return -EIO; return -EIO;
} }
...@@ -593,7 +594,7 @@ int dtSearch(struct inode *ip, struct component_name * key, ino_t * data, ...@@ -593,7 +594,7 @@ int dtSearch(struct inode *ip, struct component_name * key, ino_t * data,
struct super_block *sb = ip->i_sb; struct super_block *sb = ip->i_sb;
ciKey.name = kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t), GFP_NOFS); ciKey.name = kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t), GFP_NOFS);
if (ciKey.name == 0) { if (!ciKey.name) {
rc = -ENOMEM; rc = -ENOMEM;
goto dtSearch_Exit2; goto dtSearch_Exit2;
} }
...@@ -956,7 +957,7 @@ static int dtSplitUp(tid_t tid, ...@@ -956,7 +957,7 @@ static int dtSplitUp(tid_t tid,
sp = DT_PAGE(ip, smp); sp = DT_PAGE(ip, smp);
key.name = kmalloc((JFS_NAME_MAX + 2) * sizeof(wchar_t), GFP_NOFS); key.name = kmalloc((JFS_NAME_MAX + 2) * sizeof(wchar_t), GFP_NOFS);
if (key.name == 0) { if (!key.name) {
DT_PUTPAGE(smp); DT_PUTPAGE(smp);
rc = -ENOMEM; rc = -ENOMEM;
goto dtSplitUp_Exit; goto dtSplitUp_Exit;
......
...@@ -381,7 +381,7 @@ int diRead(struct inode *ip) ...@@ -381,7 +381,7 @@ int diRead(struct inode *ip)
/* read the page of disk inode */ /* read the page of disk inode */
mp = read_metapage(ipimap, pageno << sbi->l2nbperpage, PSIZE, 1); mp = read_metapage(ipimap, pageno << sbi->l2nbperpage, PSIZE, 1);
if (mp == 0) { if (!mp) {
jfs_err("diRead: read_metapage failed"); jfs_err("diRead: read_metapage failed");
return -EIO; return -EIO;
} }
...@@ -654,7 +654,7 @@ int diWrite(tid_t tid, struct inode *ip) ...@@ -654,7 +654,7 @@ int diWrite(tid_t tid, struct inode *ip)
/* read the page of disk inode */ /* read the page of disk inode */
retry: retry:
mp = read_metapage(ipimap, pageno << sbi->l2nbperpage, PSIZE, 1); mp = read_metapage(ipimap, pageno << sbi->l2nbperpage, PSIZE, 1);
if (mp == 0) if (!mp)
return -EIO; return -EIO;
/* get the pointer to the disk inode */ /* get the pointer to the disk inode */
......
...@@ -2345,7 +2345,7 @@ int jfsIOWait(void *arg) ...@@ -2345,7 +2345,7 @@ int jfsIOWait(void *arg)
do { do {
spin_lock_irq(&log_redrive_lock); spin_lock_irq(&log_redrive_lock);
while ((bp = log_redrive_list) != 0) { while ((bp = log_redrive_list)) {
log_redrive_list = bp->l_redrive_next; log_redrive_list = bp->l_redrive_next;
bp->l_redrive_next = NULL; bp->l_redrive_next = NULL;
spin_unlock_irq(&log_redrive_lock); spin_unlock_irq(&log_redrive_lock);
......
...@@ -147,7 +147,7 @@ int jfs_mount(struct super_block *sb) ...@@ -147,7 +147,7 @@ int jfs_mount(struct super_block *sb)
*/ */
if ((sbi->mntflag & JFS_BAD_SAIT) == 0) { if ((sbi->mntflag & JFS_BAD_SAIT) == 0) {
ipaimap2 = diReadSpecial(sb, AGGREGATE_I, 1); ipaimap2 = diReadSpecial(sb, AGGREGATE_I, 1);
if (ipaimap2 == 0) { if (!ipaimap2) {
jfs_err("jfs_mount: Faild to read AGGREGATE_I"); jfs_err("jfs_mount: Faild to read AGGREGATE_I");
rc = -EIO; rc = -EIO;
goto errout35; goto errout35;
......
...@@ -1103,7 +1103,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1103,7 +1103,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
* Make sure dest inode number (if any) is what we think it is * Make sure dest inode number (if any) is what we think it is
*/ */
rc = dtSearch(new_dir, &new_dname, &ino, &btstack, JFS_LOOKUP); rc = dtSearch(new_dir, &new_dname, &ino, &btstack, JFS_LOOKUP);
if (rc == 0) { if (!rc) {
if ((new_ip == 0) || (ino != new_ip->i_ino)) { if ((new_ip == 0) || (ino != new_ip->i_ino)) {
rc = -ESTALE; rc = -ESTALE;
goto out3; goto out3;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment