mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 09:33:31 +02:00
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<FOO> 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 <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190829171741.225219-1-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8d8a09b093
commit
097a802ae1
|
|
@ -69,8 +69,7 @@ struct page *__erofs_get_meta_page(struct super_block *sb,
|
|||
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user