From: Gao Xiang Date: Thu, 29 Aug 2019 17:17:41 +0000 (+0800) Subject: erofs: reduntant assignment in __erofs_get_meta_page() X-Git-Tag: microblaze-v5.5-rc1~163^2~76 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=097a802ae15e2c6d17256a6fe0712a655ba10823;p=linux-2.6-microblaze.git erofs: reduntant assignment in __erofs_get_meta_page() As Joe Perches suggested [1], err = bio_add_page(bio, page, PAGE_SIZE, 0); - if (unlikely(err != PAGE_SIZE)) { + if (err != PAGE_SIZE) { err = -EFAULT; goto err_out; } The initial assignment to err is odd as it's not actually an error value -E but a int size from a unsigned int len. Here the return is either 0 or PAGE_SIZE. This would be more legible to me as: if (bio_add_page(bio, page, PAGE_SIZE, 0) != PAGE_SIZE) { err = -EFAULT; goto err_out; } [1] https://lore.kernel.org/r/74c4784319b40deabfbaea92468f7e3ef44f1c96.camel@perches.com/ Signed-off-by: Gao Xiang Link: https://lore.kernel.org/r/20190829171741.225219-1-gaoxiang25@huawei.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/erofs/data.c b/fs/erofs/data.c index 0f2f1a839372..0983807737fd 100644 --- a/fs/erofs/data.c +++ b/fs/erofs/data.c @@ -69,8 +69,7 @@ repeat: goto err_out; } - err = bio_add_page(bio, page, PAGE_SIZE, 0); - if (err != PAGE_SIZE) { + if (bio_add_page(bio, page, PAGE_SIZE, 0) != PAGE_SIZE) { err = -EFAULT; goto err_out; }