Browse Source

fs: Drop unlikely before IS_ERR(_OR_NULL)

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>
Viresh Kumar 10 years ago
parent
commit
a1c83681d5
8 changed files with 11 additions and 11 deletions
  1. 1 1
      fs/cifs/readdir.c
  2. 1 1
      fs/ecryptfs/inode.c
  3. 3 3
      fs/ext4/extents.c
  4. 1 1
      fs/ext4/namei.c
  5. 2 2
      fs/namei.c
  6. 1 1
      fs/ncpfs/dir.c
  7. 1 1
      fs/nfs/objlayout/objio_osd.c
  8. 1 1
      fs/proc/proc_sysctl.c

+ 1 - 1
fs/cifs/readdir.c

@@ -84,7 +84,7 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
 	cifs_dbg(FYI, "%s: for %s\n", __func__, name->name);
 	cifs_dbg(FYI, "%s: for %s\n", __func__, name->name);
 
 
 	dentry = d_hash_and_lookup(parent, name);
 	dentry = d_hash_and_lookup(parent, name);
-	if (unlikely(IS_ERR(dentry)))
+	if (IS_ERR(dentry))
 		return;
 		return;
 
 
 	if (dentry) {
 	if (dentry) {

+ 1 - 1
fs/ecryptfs/inode.c

@@ -270,7 +270,7 @@ ecryptfs_create(struct inode *directory_inode, struct dentry *ecryptfs_dentry,
 
 
 	ecryptfs_inode = ecryptfs_do_create(directory_inode, ecryptfs_dentry,
 	ecryptfs_inode = ecryptfs_do_create(directory_inode, ecryptfs_dentry,
 					    mode);
 					    mode);
-	if (unlikely(IS_ERR(ecryptfs_inode))) {
+	if (IS_ERR(ecryptfs_inode)) {
 		ecryptfs_printk(KERN_WARNING, "Failed to create file in"
 		ecryptfs_printk(KERN_WARNING, "Failed to create file in"
 				"lower filesystem\n");
 				"lower filesystem\n");
 		rc = PTR_ERR(ecryptfs_inode);
 		rc = PTR_ERR(ecryptfs_inode);

+ 3 - 3
fs/ext4/extents.c

@@ -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,
 		bh = read_extent_tree_block(inode, path[ppos].p_block, --i,
 					    flags);
 					    flags);
-		if (unlikely(IS_ERR(bh))) {
+		if (IS_ERR(bh)) {
 			ret = PTR_ERR(bh);
 			ret = PTR_ERR(bh);
 			goto err;
 			goto err;
 		}
 		}
@@ -5792,7 +5792,7 @@ ext4_swap_extents(handle_t *handle, struct inode *inode1,
 		int split = 0;
 		int split = 0;
 
 
 		path1 = ext4_find_extent(inode1, lblk1, NULL, EXT4_EX_NOCACHE);
 		path1 = ext4_find_extent(inode1, lblk1, NULL, EXT4_EX_NOCACHE);
-		if (unlikely(IS_ERR(path1))) {
+		if (IS_ERR(path1)) {
 			*erp = PTR_ERR(path1);
 			*erp = PTR_ERR(path1);
 			path1 = NULL;
 			path1 = NULL;
 		finish:
 		finish:
@@ -5800,7 +5800,7 @@ ext4_swap_extents(handle_t *handle, struct inode *inode1,
 			goto repeat;
 			goto repeat;
 		}
 		}
 		path2 = ext4_find_extent(inode2, lblk2, NULL, EXT4_EX_NOCACHE);
 		path2 = ext4_find_extent(inode2, lblk2, NULL, EXT4_EX_NOCACHE);
-		if (unlikely(IS_ERR(path2))) {
+		if (IS_ERR(path2)) {
 			*erp = PTR_ERR(path2);
 			*erp = PTR_ERR(path2);
 			path2 = NULL;
 			path2 = NULL;
 			goto finish;
 			goto finish;

+ 1 - 1
fs/ext4/namei.c

@@ -1429,7 +1429,7 @@ restart:
 				}
 				}
 				num++;
 				num++;
 				bh = ext4_getblk(NULL, dir, b++, 0);
 				bh = ext4_getblk(NULL, dir, b++, 0);
-				if (unlikely(IS_ERR(bh))) {
+				if (IS_ERR(bh)) {
 					if (ra_max == 0) {
 					if (ra_max == 0) {
 						ret = bh;
 						ret = bh;
 						goto cleanup_and_exit;
 						goto cleanup_and_exit;

+ 2 - 2
fs/namei.c

@@ -1942,7 +1942,7 @@ OK:
 		if (err) {
 		if (err) {
 			const char *s = get_link(nd);
 			const char *s = get_link(nd);
 
 
-			if (unlikely(IS_ERR(s)))
+			if (IS_ERR(s))
 				return PTR_ERR(s);
 				return PTR_ERR(s);
 			err = 0;
 			err = 0;
 			if (unlikely(!s)) {
 			if (unlikely(!s)) {
@@ -3356,7 +3356,7 @@ struct file *do_file_open_root(struct dentry *dentry, struct vfsmount *mnt,
 		return ERR_PTR(-ELOOP);
 		return ERR_PTR(-ELOOP);
 
 
 	filename = getname_kernel(name);
 	filename = getname_kernel(name);
-	if (unlikely(IS_ERR(filename)))
+	if (IS_ERR(filename))
 		return ERR_CAST(filename);
 		return ERR_CAST(filename);
 
 
 	set_nameidata(&nd, -1, filename);
 	set_nameidata(&nd, -1, filename);

+ 1 - 1
fs/ncpfs/dir.c

@@ -597,7 +597,7 @@ ncp_fill_cache(struct file *file, struct dir_context *ctx,
 	qname.name = __name;
 	qname.name = __name;
 
 
 	newdent = d_hash_and_lookup(dentry, &qname);
 	newdent = d_hash_and_lookup(dentry, &qname);
-	if (unlikely(IS_ERR(newdent)))
+	if (IS_ERR(newdent))
 		goto end_advance;
 		goto end_advance;
 	if (!newdent) {
 	if (!newdent) {
 		newdent = d_alloc(dentry, &qname);
 		newdent = d_alloc(dentry, &qname);

+ 1 - 1
fs/nfs/objlayout/objio_osd.c

@@ -124,7 +124,7 @@ objio_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev,
 
 
 retry_lookup:
 retry_lookup:
 	od = osduld_info_lookup(&odi);
 	od = osduld_info_lookup(&odi);
-	if (unlikely(IS_ERR(od))) {
+	if (IS_ERR(od)) {
 		err = PTR_ERR(od);
 		err = PTR_ERR(od);
 		dprintk("%s: osduld_info_lookup => %d\n", __func__, err);
 		dprintk("%s: osduld_info_lookup => %d\n", __func__, err);
 		if (err == -ENODEV && retry_flag) {
 		if (err == -ENODEV && retry_flag) {

+ 1 - 1
fs/proc/proc_sysctl.c

@@ -948,7 +948,7 @@ static struct ctl_dir *get_subdir(struct ctl_dir *dir,
 found:
 found:
 	subdir->header.nreg++;
 	subdir->header.nreg++;
 failed:
 failed:
-	if (unlikely(IS_ERR(subdir))) {
+	if (IS_ERR(subdir)) {
 		pr_err("sysctl could not get directory: ");
 		pr_err("sysctl could not get directory: ");
 		sysctl_print_dir(dir);
 		sysctl_print_dir(dir);
 		pr_cont("/%*.*s %ld\n",
 		pr_cont("/%*.*s %ld\n",