fs: Drop unlikely before IS_ERR(_OR_NULL)
authorViresh Kumar <viresh.kumar@linaro.org>
Wed, 12 Aug 2015 10:29:44 +0000 (15:59 +0530)
committerJiri Kosina <jkosina@suse.cz>
Tue, 29 Sep 2015 13:13:58 +0000 (15:13 +0200)
IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there
is no need to do that again from its callers. Drop it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Jeff Layton <jlayton@poochiereds.net>
Reviewed-by: David Howells <dhowells@redhat.com>
Reviewed-by: Steve French <smfrench@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
fs/cifs/readdir.c
fs/ecryptfs/inode.c
fs/ext4/extents.c
fs/ext4/namei.c
fs/namei.c
fs/ncpfs/dir.c
fs/nfs/objlayout/objio_osd.c
fs/proc/proc_sysctl.c

index b1eede3678a91d8d1ea3e350cb035cabf1da7ba7..0557c45e9c3308a368f7ff3e73f9423c81eedea4 100644 (file)
@@ -84,7 +84,7 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
        cifs_dbg(FYI, "%s: for %s\n", __func__, name->name);
 
        dentry = d_hash_and_lookup(parent, name);
-       if (unlikely(IS_ERR(dentry)))
+       if (IS_ERR(dentry))
                return;
 
        if (dentry) {
index 3c4db1172d222840b8cf0fcd50a61437ebf5f4c7..e2e47ba5d313a5f2aca58589e08d2d3df969bed2 100644 (file)
@@ -270,7 +270,7 @@ ecryptfs_create(struct inode *directory_inode, struct dentry *ecryptfs_dentry,
 
        ecryptfs_inode = ecryptfs_do_create(directory_inode, ecryptfs_dentry,
                                            mode);
-       if (unlikely(IS_ERR(ecryptfs_inode))) {
+       if (IS_ERR(ecryptfs_inode)) {
                ecryptfs_printk(KERN_WARNING, "Failed to create file in"
                                "lower filesystem\n");
                rc = PTR_ERR(ecryptfs_inode);
index 2553aa8b608d84d1673190ea634c5e84c86d9f0b..799f017147675fb386b4fe0fbaa62377cff71d85 100644 (file)
@@ -899,7 +899,7 @@ ext4_find_extent(struct inode *inode, ext4_lblk_t block,
 
                bh = read_extent_tree_block(inode, path[ppos].p_block, --i,
                                            flags);
-               if (unlikely(IS_ERR(bh))) {
+               if (IS_ERR(bh)) {
                        ret = PTR_ERR(bh);
                        goto err;
                }
@@ -5792,7 +5792,7 @@ ext4_swap_extents(handle_t *handle, struct inode *inode1,
                int split = 0;
 
                path1 = ext4_find_extent(inode1, lblk1, NULL, EXT4_EX_NOCACHE);
-               if (unlikely(IS_ERR(path1))) {
+               if (IS_ERR(path1)) {
                        *erp = PTR_ERR(path1);
                        path1 = NULL;
                finish:
@@ -5800,7 +5800,7 @@ ext4_swap_extents(handle_t *handle, struct inode *inode1,
                        goto repeat;
                }
                path2 = ext4_find_extent(inode2, lblk2, NULL, EXT4_EX_NOCACHE);
-               if (unlikely(IS_ERR(path2))) {
+               if (IS_ERR(path2)) {
                        *erp = PTR_ERR(path2);
                        path2 = NULL;
                        goto finish;
index 011dcfb5cce37688d2cc6153526f5741204a66d9..0554e4be1fb8c8bfdc6439abe9b94735e59df46b 100644 (file)
@@ -1429,7 +1429,7 @@ restart:
                                }
                                num++;
                                bh = ext4_getblk(NULL, dir, b++, 0);
-                               if (unlikely(IS_ERR(bh))) {
+                               if (IS_ERR(bh)) {
                                        if (ra_max == 0) {
                                                ret = bh;
                                                goto cleanup_and_exit;
index fbbcf0993312eb9c278dc1343ea2db0fe4edf959..d3f84069a9aa82d25dae0f7b07b2c696a1d91d07 100644 (file)
@@ -1942,7 +1942,7 @@ OK:
                if (err) {
                        const char *s = get_link(nd);
 
-                       if (unlikely(IS_ERR(s)))
+                       if (IS_ERR(s))
                                return PTR_ERR(s);
                        err = 0;
                        if (unlikely(!s)) {
@@ -3356,7 +3356,7 @@ struct file *do_file_open_root(struct dentry *dentry, struct vfsmount *mnt,
                return ERR_PTR(-ELOOP);
 
        filename = getname_kernel(name);
-       if (unlikely(IS_ERR(filename)))
+       if (IS_ERR(filename))
                return ERR_CAST(filename);
 
        set_nameidata(&nd, -1, filename);
index 93575e91a7aa7b2993afb16b781c657fa2d6a7af..356816e7bc90d2d2de4a4fc0e25b10ad42b839dc 100644 (file)
@@ -597,7 +597,7 @@ ncp_fill_cache(struct file *file, struct dir_context *ctx,
        qname.name = __name;
 
        newdent = d_hash_and_lookup(dentry, &qname);
-       if (unlikely(IS_ERR(newdent)))
+       if (IS_ERR(newdent))
                goto end_advance;
        if (!newdent) {
                newdent = d_alloc(dentry, &qname);
index 5aaed363556a66e7bd5bb43d4619d037108f5421..5c0c6b58157f906d6c35ce737a6d4a5623027bf1 100644 (file)
@@ -124,7 +124,7 @@ objio_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
 
 retry_lookup:
        od = osduld_info_lookup(&odi);
-       if (unlikely(IS_ERR(od))) {
+       if (IS_ERR(od)) {
                err = PTR_ERR(od);
                dprintk("%s: osduld_info_lookup => %d\n", __func__, err);
                if (err == -ENODEV && retry_flag) {
index fdda62e6115e1c4584cc88d360c27de7a26e1793..fe5b6e6c46719a79de1d808de782ccfd20bf67a8 100644 (file)
@@ -948,7 +948,7 @@ static struct ctl_dir *get_subdir(struct ctl_dir *dir,
 found:
        subdir->header.nreg++;
 failed:
-       if (unlikely(IS_ERR(subdir))) {
+       if (IS_ERR(subdir)) {
                pr_err("sysctl could not get directory: ");
                sysctl_print_dir(dir);
                pr_cont("/%*.*s %ld\n",