]> git.hungrycats.org Git - linux/commitdiff
[PATCH] IS_ERR() unlikeliness cleanup
authorAndrew Morton <akpm@osdl.org>
Mon, 23 Aug 2004 06:05:01 +0000 (23:05 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 23 Aug 2004 06:05:01 +0000 (23:05 -0700)
Remove now-unneeded open-coded unlikelies around IS_ERR().

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/ia64/sn/io/hwgfs/interface.c
arch/x86_64/ia32/sys_ia32.c
fs/ntfs/aops.c
fs/ntfs/attrib.c
fs/ntfs/dir.c
fs/ntfs/index.c
fs/ntfs/inode.c
fs/ntfs/mft.c
fs/ntfs/namei.c
ipc/mqueue.c

index caac7f0672cf0969bff37c837f86c7bdd93a3e47..4e19418053c9108298275a0f9ccf7ba18437f804 100644 (file)
@@ -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;
index ab8003492318a19878f133a9cb91ec379e2ce892..00f6e151639a231005b95fb93e586b7a1f9d38d6 100644 (file)
@@ -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
index 0ffc1d19c9de05f1f786410888c2b765d3c5b606..35bcefbe15880687457bda47e13f9f3f28f4d7eb 100644 (file)
@@ -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;
index 55686f7bdc6b101282d1fc63d34fccfc0a43dccb..3d08b82f7505d9a0ddbaa31060bb916cd5fe2c70 100644 (file)
@@ -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;
index 24686227960ca377856739c64f3fd1291794596e..ccec0960f26d3b82c975797362dd3c383ad899e4 100644 (file)
@@ -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 @@ skip_index_root:
        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 @@ get_next_bmp_page:
                        ((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 @@ find_next_index_buffer:
                 * 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;
index f4396a02a722da4228e5b9d788967f37878a8dbe..786f6126b62c66785529517ed2d9e265f7e7fd07 100644 (file)
@@ -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);
index 686d5bbb52a54ebaa34d4f10a8c797e98b3e4abd..e24aa9bb238e8cc7a8870aeb0fed9cd7b2dacc70 100644 (file)
@@ -900,7 +900,7 @@ skip_attr_list_load:
                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;
index 712f7ad0ac501b26231f04413d5ebffe39241a4a..ed6f5bbe3c8fbe0fb2bebc1ae4aded7025e89865 100644 (file)
@@ -391,7 +391,7 @@ map_err_out:
        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;
index c5ab58086c2615692035447a44c3173e49cd0c48..4731d0979a14b40c6181a66a9dfaf52af41dd881 100644 (file)
@@ -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 @@ try_next:
        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;
        }
index c9ea777b145452d5ee5be2b114e3f23403bccd57..aee2696c30b1efdd6c549e01998a72a496a7972d 100644 (file)
@@ -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;
        }