From: Zheng Yongjun Date: Tue, 22 Dec 2020 13:34:15 +0000 (+0800) Subject: f2fs: Replace expression with offsetof() X-Git-Tag: microblaze-v5.13~169^2~30 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=36218b81f094648d929994399eb6eb5c97b991e5;p=linux-2.6-microblaze.git f2fs: Replace expression with offsetof() Use the existing offsetof() macro instead of duplicating code. Signed-off-by: Zheng Yongjun Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 3a24423ac65f..5e3fabacefb5 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -2696,7 +2696,7 @@ retry: src = F2FS_INODE(page); dst = F2FS_INODE(ipage); - memcpy(dst, src, (unsigned long)&src->i_ext - (unsigned long)src); + memcpy(dst, src, offsetof(struct f2fs_inode, i_ext)); dst->i_size = 0; dst->i_blocks = cpu_to_le64(1); dst->i_links = cpu_to_le32(1);