diff options
author | Jiapeng Chong <jiapeng.chong@linux.alibaba.com> | 2023-03-23 10:32:59 +0800 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2023-03-27 10:06:28 +0200 |
commit | dc7cb2d29805fe4fa4000fc0b09740fc24c93408 (patch) | |
tree | bc90b5eae2d22764f396a2d93702bc080d3125ce /fs/buffer.c | |
parent | 4e04143c869c5b6d499fbd5083caa860d5c942c3 (diff) | |
download | linux-dc7cb2d29805fe4fa4000fc0b09740fc24c93408.tar.gz linux-dc7cb2d29805fe4fa4000fc0b09740fc24c93408.tar.bz2 linux-dc7cb2d29805fe4fa4000fc0b09740fc24c93408.zip |
fs/buffer: Remove redundant assignment to err
Variable 'err' set but not used.
fs/buffer.c:2613:2: warning: Value stored to 'err' is never read.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4589
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/buffer.c')
-rw-r--r-- | fs/buffer.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index 9e1e2add541e..10390f53f3f5 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2581,7 +2581,7 @@ int block_truncate_page(struct address_space *mapping, struct inode *inode = mapping->host; struct page *page; struct buffer_head *bh; - int err; + int err = 0; blocksize = i_blocksize(inode); length = offset & (blocksize - 1); @@ -2594,9 +2594,8 @@ int block_truncate_page(struct address_space *mapping, iblock = (sector_t)index << (PAGE_SHIFT - inode->i_blkbits); page = grab_cache_page(mapping, index); - err = -ENOMEM; if (!page) - goto out; + return -ENOMEM; if (!page_has_buffers(page)) create_empty_buffers(page, blocksize, 0); @@ -2610,7 +2609,6 @@ int block_truncate_page(struct address_space *mapping, pos += blocksize; } - err = 0; if (!buffer_mapped(bh)) { WARN_ON(bh->b_size != blocksize); err = get_block(inode, iblock, bh, 0); @@ -2634,12 +2632,11 @@ int block_truncate_page(struct address_space *mapping, zero_user(page, offset, length); mark_buffer_dirty(bh); - err = 0; unlock: unlock_page(page); put_page(page); -out: + return err; } EXPORT_SYMBOL(block_truncate_page); |