Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp946088pxb; Wed, 3 Mar 2021 22:04:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJxnujABrVw8/HjEziAxPvi00RszI84cIt02WXGZR899F+BWcm+1Fd6jxAAg+vajP36k/gb/ X-Received: by 2002:a17:906:5607:: with SMTP id f7mr2437139ejq.262.1614837892577; Wed, 03 Mar 2021 22:04:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614837892; cv=none; d=google.com; s=arc-20160816; b=LBUmFNZ5S5+salOzkkm22peCw9Xa4FnXDIvlYI9XqyXNgvVmDtFuIXvj6CkkvWWdBo XIrPPYOH7vMNPHoot4Lp4H46fHuM2H1CWLXG15UEkMUgOv1Kwlx8szOHQpMZbo2p493r PggCaOZLP3TqjLWe9jpzsPQTYwIxs3veVLPD4XFSuPsJi9CnMAid/deAnZtmKoowVEbe sIyM5PubqyF2cSGi9VbmVtnk9MTxT5S0FTUR/gn6rKcsXdacBgVT8mh5WjJS0zQQDkos 5JAaLFnr/1EPKmeFdH4OKmze9No1uxuSIaEpmnxC8qniDodBorRE0cw93AK4cRydw6UV eKKA== 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=tjPk8xLgadw1iHyaQbsgWxT9AgdacJP3jUVHxEK6vQw=; b=gis+bDNuATcH2ub6yGBh2HAMZl0OGKNxlJOsgpMY2n+DtkxSRs+DU+zKBt0q4gAmW+ vQkhPt0AgrTrpigWEJBapoXRbjanrIBTGiJAhpaX8MFo4JsZsCyZ4IaYToy/vScih/tP Emjd7f+dwTuwjws8H8rkyzg+F4GIBNh2+FEYVOSR4ASoFr+Ai771IQ752DMWbwLS7Lvh 93kadfyIr+ju8BCzFvfu0Iqxuh89sRrRKDDLcPRL5gvpt5bkrUb6062GMOkD3JDmX+HP 5NtzWKTx3+5jeqUyizjWyOIiAaSNRHSeR+780miHelIkhZ1wBmlcw0Ky3oO0OfU5VLM+ LPuw== 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 r6si4750198eda.292.2021.03.03.22.04.29; Wed, 03 Mar 2021 22:04:52 -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 S1378812AbhCBIzM (ORCPT + 99 others); Tue, 2 Mar 2021 03:55:12 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:13036 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377952AbhCBIpx (ORCPT ); Tue, 2 Mar 2021 03:45:53 -0500 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DqVyF3N21zMh6R; Tue, 2 Mar 2021 16:43:01 +0800 (CST) Received: from szvp000203569.huawei.com (10.120.216.130) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.498.0; Tue, 2 Mar 2021 16:45:01 +0800 From: Chao Yu To: CC: , , , Chao Yu Subject: [PATCH] f2fs: fix compile warning Date: Tue, 2 Mar 2021 16:44:58 +0800 Message-ID: <20210302084458.15077-1-yuchao0@huawei.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.120.216.130] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org node.c: In function ‘f2fs_restore_node_summary’: ./include/linux/minmax.h:18:28: warning: comparison of distinct pointer types lacks a cast (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) ^ ./include/linux/minmax.h:32:4: note: in expansion of macro ‘__typecheck’ (__typecheck(x, y) && __no_side_effects(x, y)) ^ ./include/linux/minmax.h:42:24: note: in expansion of macro ‘__safe_cmp’ __builtin_choose_expr(__safe_cmp(x, y), \ ^ ./include/linux/minmax.h:51:19: note: in expansion of macro ‘__careful_cmp’ #define min(x, y) __careful_cmp(x, y, <) ^ node.c:2750:13: note: in expansion of macro ‘min’ nrpages = min(last_offset - i, BIO_MAX_PAGES); Use min_t() rather than min() to do type cast before comparing. Signed-off-by: Chao Yu --- fs/f2fs/node.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index a8a0fb890e8d..77f9ffaf9b8e 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -2747,7 +2747,8 @@ int f2fs_restore_node_summary(struct f2fs_sb_info *sbi, sum_entry = &sum->entries[0]; for (i = 0; i < last_offset; i += nrpages, addr += nrpages) { - nrpages = min(last_offset - i, BIO_MAX_PAGES); + nrpages = min_t(unsigned long, last_offset - i, + BIO_MAX_PAGES); /* readahead node pages */ f2fs_ra_meta_pages(sbi, addr, nrpages, META_POR, true); -- 2.29.2