[PATCH -next] virtiofs: Move the assignment to ret outside the loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There is no need to do the assignment each time. So move the assignment
to ret outside the loop.

Signed-off-by: Jing Xiangfeng <jingxiangfeng@xxxxxxxxxx>
---
 fs/fuse/dax.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c
index e394dba08cc4..f18cd7b53ec7 100644
--- a/fs/fuse/dax.c
+++ b/fs/fuse/dax.c
@@ -1259,9 +1259,9 @@ static int fuse_dax_mem_range_init(struct fuse_conn_dax *fcd)
 	pr_debug("%s: dax mapped %ld pages. nr_ranges=%ld\n",
 		__func__, nr_pages, nr_ranges);
 
+	ret = -ENOMEM;
 	for (i = 0; i < nr_ranges; i++) {
 		range = kzalloc(sizeof(struct fuse_dax_mapping), GFP_KERNEL);
-		ret = -ENOMEM;
 		if (!range)
 			goto out_err;
 
-- 
2.26.0.106.g9fadedd




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux