aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorYu Jiaoliang <yujiaoliang@vivo.com>2024-09-20 10:14:40 +0800
committerTheodore Ts'o <tytso@mit.edu>2024-11-12 23:54:14 -0500
commit5ad585bcfe24d840f6d324951e4c18b0014c0178 (patch)
tree151c1fea273746c42389e5602adc68054f9dc273
parentmm: zero range of eof folio exposed by inode size extension (diff)
downloadwireguard-linux-5ad585bcfe24d840f6d324951e4c18b0014c0178.tar.xz
wireguard-linux-5ad585bcfe24d840f6d324951e4c18b0014c0178.zip
ext4: use ERR_CAST to return an error-valued pointer
Instead of directly casting and returning an error-valued pointer, use ERR_CAST to make the error handling more explicit and improve code clarity. Signed-off-by: Yu Jiaoliang <yujiaoliang@vivo.com> Link: https://patch.msgid.link/20240920021440.1959243-1-yujiaoliang@vivo.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to '')
-rw-r--r--fs/ext4/namei.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 08d15cd2b594..1012781ae9b4 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1747,7 +1747,7 @@ static struct buffer_head * ext4_dx_find_entry(struct inode *dir,
#endif
frame = dx_probe(fname, dir, NULL, frames);
if (IS_ERR(frame))
- return (struct buffer_head *) frame;
+ return ERR_CAST(frame);
do {
block = dx_get_block(frame->at);
bh = ext4_read_dirblock(dir, block, DIRENT_HTREE);
@@ -1952,7 +1952,7 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
if (IS_ERR(bh2)) {
brelse(*bh);
*bh = NULL;
- return (struct ext4_dir_entry_2 *) bh2;
+ return ERR_CAST(bh2);
}
BUFFER_TRACE(*bh, "get_write_access");