Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4973979pxu; Tue, 22 Dec 2020 05:35:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxzxLE55/5nwqlleG67O+HniP7nd5Rg3UrmHQKj3l06L3aMNOwmOlTisop5gBv7TM/sSNh0 X-Received: by 2002:aa7:d784:: with SMTP id s4mr20123432edq.215.1608644156562; Tue, 22 Dec 2020 05:35:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608644156; cv=none; d=google.com; s=arc-20160816; b=gEr3dSG10RQTwkG77L2cAjwotQQ+ktjlnTSzogr1JyV6yuY48ei31ob2+z3E5yUUzM ybAPwT4jCzWlHFTCSBQ9qfRP9lvUoRE3hHUKPTznk1IYjiKKXJ4HDQqABBpCRPoaFE+P 3vrap9H853jFMZbT7eyuXl/uJJyNZthJ9tiGllWM/GTYn94lSg9lpxMFPDK9kzO5tUL7 B8Q7x+xQvMih138OaX2MEzl1bXeGsVhuwutOMEJCaO+PxYepVRy1qBRbt9KX+6ILJMwo Wwc0t8JrzF4AOcCrLjOXA+bn4g1P4j0c83cps8rJDWVZx2qonvBP+MUBZcezOQCIxzJa 3L2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Ioc4w23Sj0f0+9J48LOwiHREbHqYihtgEygjv4wYOTY=; b=diWv+M8HB0hxtkVqZpSQjrmKPRct3ptGudPULQv7tDjsYHdwKz+0G7t38Ixu3O/dG2 EFAGQKwqd7XmPJ/0K/u6xznMIPQxnLXJYHOyD/gNOdMztKRkAQI4Ysy/Xa/6XkVdfq/L oYZIZrscjEW7HC5VqE65B9+EvPXLepCp1NuWmixc1WpJCp5nwGH4nZw8x+D+pzRBaNGw YzcwuKV+1sQntNiDBv8315Cz9kdMRQ3x8QWFVtrJG7p919eSfEDfJtOk8Q4zC/OH+cHF 0e8eSw4KN4LFhM2hNh3CcavMCBA/3Z62uKzYqYk8J7zNV/oZCzik1ZCB/vR8VIkXuj8c yPJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bd1si11911995edb.168.2020.12.22.05.35.34; Tue, 22 Dec 2020 05:35:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727689AbgLVNec (ORCPT + 99 others); Tue, 22 Dec 2020 08:34:32 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:9238 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727288AbgLVNeb (ORCPT ); Tue, 22 Dec 2020 08:34:31 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4D0cj25xsTzktP5; Tue, 22 Dec 2020 21:32:54 +0800 (CST) Received: from ubuntu.network (10.175.138.68) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.498.0; Tue, 22 Dec 2020 21:33:39 +0800 From: Zheng Yongjun To: , , , CC: Zheng Yongjun Subject: [PATCH -next] f2fs: Replace expression with offsetof() Date: Tue, 22 Dec 2020 21:34:15 +0800 Message-ID: <20201222133415.19915-1-zhengyongjun3@huawei.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.138.68] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the existing offsetof() macro instead of duplicating code. Signed-off-by: Zheng Yongjun --- fs/f2fs/node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index d5d8ce077f29..000cafb522ec 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -2686,7 +2686,7 @@ int f2fs_recover_inode_page(struct f2fs_sb_info *sbi, struct page *page) 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); -- 2.22.0