Commit 579aa5b4 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] IS_ERR() unlikeliness cleanup

Remove now-unneeded open-coded unlikelies around IS_ERR().
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3b0b17a8
......@@ -42,7 +42,7 @@ walk_parents_mkdir(
nd->dentry = lookup_create(nd, is_dir);
nd->flags |= LOOKUP_PARENT;
if (unlikely(IS_ERR(nd->dentry)))
if (IS_ERR(nd->dentry))
return PTR_ERR(nd->dentry);
if (!nd->dentry->d_inode)
......@@ -89,7 +89,7 @@ hwgfs_decode(
*dentry = lookup_create(&nd, is_dir);
if (unlikely(IS_ERR(*dentry)))
if (IS_ERR(*dentry))
return PTR_ERR(*dentry);
*parent_inode = (*dentry)->d_parent->d_inode;
return 0;
......
......@@ -1262,7 +1262,7 @@ asmlinkage long sys32_open(const char __user * filename, int flags, int mode)
if (fd >= 0) {
struct file *f = filp_open(tmp, flags, mode);
error = PTR_ERR(f);
if (unlikely(IS_ERR(f))) {
if (IS_ERR(f)) {
put_unused_fd(fd);
fd = error;
} else
......
......@@ -393,7 +393,7 @@ int ntfs_readpage(struct file *file, struct page *page)
/* Map, pin, and lock the mft record. */
mrec = map_mft_record(base_ni);
if (unlikely(IS_ERR(mrec))) {
if (IS_ERR(mrec)) {
err = PTR_ERR(mrec);
goto err_out;
}
......@@ -1111,7 +1111,7 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
/* Map, pin, and lock the mft record. */
m = map_mft_record(base_ni);
if (unlikely(IS_ERR(m))) {
if (IS_ERR(m)) {
err = PTR_ERR(m);
m = NULL;
ctx = NULL;
......@@ -1885,7 +1885,7 @@ static int ntfs_commit_write(struct file *file, struct page *page,
/* Map, pin, and lock the mft record. */
m = map_mft_record(base_ni);
if (unlikely(IS_ERR(m))) {
if (IS_ERR(m)) {
err = PTR_ERR(m);
m = NULL;
ctx = NULL;
......
......@@ -507,7 +507,7 @@ run_list_element *ntfs_merge_run_lists(run_list_element *drl,
/* Check for silly calling... */
if (unlikely(!srl))
return drl;
if (unlikely(IS_ERR(srl) || IS_ERR(drl)))
if (IS_ERR(srl) || IS_ERR(drl))
return ERR_PTR(-EINVAL);
/* Check for the case where the first mapping is being done now. */
......@@ -977,7 +977,7 @@ int map_run_list(ntfs_inode *ni, VCN vcn)
rl = decompress_mapping_pairs(ni->vol, ctx->attr,
ni->run_list.rl);
if (unlikely(IS_ERR(rl)))
if (IS_ERR(rl))
err = PTR_ERR(rl);
else
ni->run_list.rl = rl;
......
......@@ -95,7 +95,7 @@ MFT_REF ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const ntfschar *uname,
BUG_ON(NInoAttr(dir_ni));
/* Get hold of the mft record for the directory. */
m = map_mft_record(dir_ni);
if (unlikely(IS_ERR(m))) {
if (IS_ERR(m)) {
ntfs_error(sb, "map_mft_record() failed with error code %ld.",
-PTR_ERR(m));
return ERR_MREF(PTR_ERR(m));
......@@ -1170,7 +1170,7 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
goto skip_index_root;
/* Get hold of the mft record for the directory. */
m = map_mft_record(ndir);
if (unlikely(IS_ERR(m))) {
if (IS_ERR(m)) {
err = PTR_ERR(m);
m = NULL;
goto err_out;
......@@ -1261,7 +1261,7 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
if (unlikely(!bmp_vi)) {
ntfs_debug("Inode 0x%lx, regetting index bitmap.", vdir->i_ino);
bmp_vi = ntfs_attr_iget(vdir, AT_BITMAP, I30, 4);
if (unlikely(IS_ERR(bmp_vi))) {
if (IS_ERR(bmp_vi)) {
ntfs_error(sb, "Failed to get bitmap attribute.");
err = PTR_ERR(bmp_vi);
goto err_out;
......@@ -1286,7 +1286,7 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
((PAGE_CACHE_SIZE * 8) - 1));
bmp_page = ntfs_map_page(bmp_mapping,
bmp_pos >> (3 + PAGE_CACHE_SHIFT));
if (unlikely(IS_ERR(bmp_page))) {
if (IS_ERR(bmp_page)) {
ntfs_error(sb, "Reading index bitmap failed.");
err = PTR_ERR(bmp_page);
bmp_page = NULL;
......@@ -1327,7 +1327,7 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
* reading it from disk if necessary.
*/
ia_page = ntfs_map_page(ia_mapping, ia_pos >> PAGE_CACHE_SHIFT);
if (unlikely(IS_ERR(ia_page))) {
if (IS_ERR(ia_page)) {
ntfs_error(sb, "Reading index allocation data failed.");
err = PTR_ERR(ia_page);
ia_page = NULL;
......
......@@ -157,7 +157,7 @@ int ntfs_index_lookup(const void *key, const int key_len,
}
/* Get hold of the mft record for the index inode. */
m = map_mft_record(base_ni);
if (unlikely(IS_ERR(m))) {
if (IS_ERR(m)) {
ntfs_error(sb, "map_mft_record() failed with error code %ld.",
-PTR_ERR(m));
return PTR_ERR(m);
......
......@@ -900,7 +900,7 @@ static int ntfs_read_locked_inode(struct inode *vi)
ctx = NULL;
/* Get the index bitmap attribute inode. */
bvi = ntfs_attr_iget(vi, AT_BITMAP, I30, 4);
if (unlikely(IS_ERR(bvi))) {
if (IS_ERR(bvi)) {
ntfs_error(vi->i_sb, "Failed to get bitmap attribute.");
err = PTR_ERR(bvi);
goto unm_err_out;
......@@ -1552,7 +1552,7 @@ static int ntfs_read_locked_index_inode(struct inode *base_vi, struct inode *vi)
ctx = NULL;
/* Get the index bitmap attribute inode. */
bvi = ntfs_attr_iget(base_vi, AT_BITMAP, ni->name, ni->name_len);
if (unlikely(IS_ERR(bvi))) {
if (IS_ERR(bvi)) {
ntfs_error(vi->i_sb, "Failed to get bitmap attribute.");
err = PTR_ERR(bvi);
goto unm_err_out;
......@@ -2336,7 +2336,7 @@ void ntfs_write_inode(struct inode *vi, int sync)
}
/* Map, pin, and lock the mft record belonging to the inode. */
m = map_mft_record(ni);
if (unlikely(IS_ERR(m))) {
if (IS_ERR(m)) {
err = PTR_ERR(m);
goto err_out;
}
......@@ -2391,7 +2391,7 @@ void ntfs_write_inode(struct inode *vi, int sync)
MFT_RECORD *tm = map_mft_record(tni);
int ret;
if (unlikely(IS_ERR(tm))) {
if (IS_ERR(tm)) {
if (!err || err == -ENOMEM)
err = PTR_ERR(tm);
continue;
......
......@@ -391,7 +391,7 @@ MFT_RECORD *map_extent_mft_record(ntfs_inode *base_ni, MFT_REF mref,
ni->ext.base_ntfs_ino = base_ni;
/* Now map the record. */
m = map_mft_record(ni);
if (unlikely(IS_ERR(m))) {
if (IS_ERR(m)) {
up(&base_ni->extent_lock);
atomic_dec(&base_ni->count);
ntfs_clear_extent_inode(ni);
......@@ -571,7 +571,7 @@ static int sync_mft_mirror(ntfs_inode *ni, MFT_RECORD *m, int sync)
/* Get the page containing the mirror copy of the mft record @m. */
page = ntfs_map_page(vol->mftmirr_ino->i_mapping, ni->mft_no >>
(PAGE_CACHE_SHIFT - vol->mft_record_size_bits));
if (unlikely(IS_ERR(page))) {
if (IS_ERR(page)) {
ntfs_error(vol->sb, "Failed to map mft mirror page.");
err = PTR_ERR(page);
goto err_out;
......
......@@ -376,7 +376,7 @@ struct dentry *ntfs_get_parent(struct dentry *child_dent)
ntfs_debug("Entering for inode 0x%lx.", vi->i_ino);
/* Get the mft record of the inode belonging to the child dentry. */
mrec = map_mft_record(ni);
if (unlikely(IS_ERR(mrec)))
if (IS_ERR(mrec))
return (struct dentry *)mrec;
/* Find the first file name attribute in the mft record. */
ctx = get_attr_search_ctx(ni, mrec);
......@@ -408,7 +408,7 @@ struct dentry *ntfs_get_parent(struct dentry *child_dent)
unmap_mft_record(ni);
/* Get the inode of the parent directory. */
parent_vi = ntfs_iget(vi->i_sb, parent_ino);
if (unlikely(IS_ERR(parent_vi) || is_bad_inode(parent_vi))) {
if (IS_ERR(parent_vi) || unlikely(is_bad_inode(parent_vi))) {
if (!IS_ERR(parent_vi))
iput(parent_vi);
ntfs_error(vi->i_sb, "Failed to get parent directory inode "
......@@ -451,7 +451,7 @@ struct dentry *ntfs_get_dentry(struct super_block *sb, void *fh)
ntfs_debug("Entering for inode 0x%lx, generation 0x%x.", ino, gen);
vi = ntfs_iget(sb, ino);
if (unlikely(IS_ERR(vi))) {
if (IS_ERR(vi)) {
ntfs_error(sb, "Failed to get inode 0x%lx.", ino);
return (struct dentry *)vi;
}
......
......@@ -828,7 +828,7 @@ asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *u_msg_ptr,
/* First try to allocate memory, before doing anything with
* existing queues. */
msg_ptr = load_msg(u_msg_ptr, msg_len);
if (unlikely(IS_ERR(msg_ptr))) {
if (IS_ERR(msg_ptr)) {
ret = PTR_ERR(msg_ptr);
goto out_fput;
}
......
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