Skip to contentSkip to conversation

staging: erofs: remove redundant likely/unlikely annotation in namei.c

PATCH New Chengguang Xu 3 participants 8 messages Feb 12, 2019 – Feb 13, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 staging: erofs: remove redundant likely/unlikely annotation in namei.c

unlikely has already included in IS_ERR(),
so just remove redundant likely/unlikely
annotation.

Signed-off-by Chengguang Xu <cgxu519 at gmx.com>
---
 drivers/staging/erofs/namei.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/erofs/namei.c +3 -3
index 5596c52e246d..1acd742a41ed 100644
@@ -144,7 +144,7 @@ static struct page *find_target_block_classic(
 				head = mid + 1;
 				startprfx = matched;
 
-				if (likely(!IS_ERR(candidate)))
+				if (!IS_ERR(candidate))
 					put_page(candidate);
 				candidate = page;
 			} else {
@@ -177,7 +177,7 @@ int erofs_namei(struct inode *dir,
 	diff = 1;
 	page = find_target_block_classic(dir, name, &diff);
 
-	if (unlikely(IS_ERR(page)))
+	if (IS_ERR(page))
 		return PTR_ERR(page);
 
 	data = kmap_atomic(page);
@@ -187,7 +187,7 @@ int erofs_namei(struct inode *dir,
 		find_target_dirent(name, data, EROFS_BLKSIZ) :
 		(struct erofs_dirent *)data;
 
-	if (likely(!IS_ERR(de))) {
+	if (!IS_ERR(de)) {
 		*nid = le64_to_cpu(de->nid);
 		*d_type = de->file_type;
 	}
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/2 staging: erofs: remove redundant unlikely annotation in unzip_vle.c

unlikely has already included in IS_ERR(),
so just remove it.

Signed-off-by Chengguang Xu <cgxu519 at gmx.com>
---
 drivers/staging/erofs/unzip_vle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/erofs/unzip_vle.c +1 -1
index 4ac1099a39c6..7cd2d4d9c264 100644
@@ -539,7 +539,7 @@ static int z_erofs_vle_work_iter_begin(struct z_erofs_vle_work_builder *builder,
 	if (unlikely(work == ERR_PTR(-EAGAIN)))
 		goto repeat;
 
-	if (unlikely(IS_ERR(work)))
+	if (IS_ERR(work))
 		return PTR_ERR(work);
 got_it:
 	z_erofs_pagevec_ctor_init(&builder->vector,
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/2 staging: erofs: remove redundant unlikely annotation in unzip_vle.c

Quoted 4 lines · Chengguang Xu

unlikely has already included in IS_ERR(),
so just remove it.

Signed-off-by Chengguang Xu <cgxu519 at gmx.com>
Reviewed-by Gao Xiang <gaoxiang25 at huawei.com>

Thanks,

Gao Xiang

#3 lore raw

PATCH 2/2 staging: erofs: remove redundant unlikely annotation in unzip_vle.c

In reply to Chengguang Xu
Quoted 4 lines · Chengguang Xu

unlikely has already included in IS_ERR(),
so just remove it.

Signed-off-by Chengguang Xu <cgxu519 at gmx.com>

It looks like we don't need to send two patch to fix two similar issues, if you can merge them, it will be better.

Reviewed-by Chao Yu <yuchao0 at huawei.com>

Thanks,

author
#4 lore raw

PATCH 2/2 staging: erofs: remove redundant unlikely annotation in unzip_vle.c

Quoted 7 lines · Chao Yu
Quoted 4 lines · Chengguang Xu

unlikely has already included in IS_ERR(),
so just remove it.

Signed-off-by Chengguang Xu <cgxu519 at gmx.com>

It looks like we don't need to send two patch to fix two similar issues, if you can merge them, it will be better.

I agree with you but I noticed the patches have already merged to Greg's staging tree,
so I'm not sure if it cause inconvenience to his management.

Thanks,
Chengguang

#5 lore raw

PATCH 2/2 staging: erofs: remove redundant unlikely annotation in unzip_vle.c

Hi Chengguang,

Quoted 12 lines · On 2019/2/13 22:50, cgxu519 wrote:
Quoted 7 lines · Chao Yu
Quoted 4 lines · Chengguang Xu

unlikely has already included in IS_ERR(),
so just remove it.

Signed-off-by Chengguang Xu <cgxu519 at gmx.com>

It looks like we don't need to send two patch to fix two similar issues, if you can merge them, it will be better.

I agree with you but I noticed the patches have already merged to Greg's staging tree, so I'm not sure if it cause inconvenience to his management.

I personally think it is not a big problem since that is indeed cleanup patches and

thanks for applying erofs patches and happy hacking :)

Thanks,

Gao Xiang

Quoted 4 lines

Thanks,
Chengguang

#6 lore raw

PATCH 1/2 staging: erofs: remove redundant likely/unlikely annotation in namei.c

In reply to Chengguang Xu
Quoted 5 lines · Chengguang Xu

unlikely has already included in IS_ERR(),
so just remove redundant likely/unlikely
annotation.

Signed-off-by Chengguang Xu <cgxu519 at gmx.com>

Thanks for the correction, and happy new lunar year :)

Reviewed-by Gao Xiang <gaoxiang25 at huawei.com>

Thanks,

Gao Xiang

#7 lore raw

PATCH 1/2 staging: erofs: remove redundant likely/unlikely annotation in namei.c

In reply to Chengguang Xu
Quoted 5 lines · Chengguang Xu

unlikely has already included in IS_ERR(),
so just remove redundant likely/unlikely
annotation.

Signed-off-by Chengguang Xu <cgxu519 at gmx.com>
Reviewed-by Chao Yu <yuchao0 at huawei.com>

Thanks,