From patchwork Fri Mar 18 13:01:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charan Teja Kalla X-Patchwork-Id: 12785221 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 145C3C433F5 for ; Fri, 18 Mar 2022 13:02:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 88DB18D0002; Fri, 18 Mar 2022 09:02:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8156D8D0001; Fri, 18 Mar 2022 09:02:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B59D8D0002; Fri, 18 Mar 2022 09:02:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0022.hostedemail.com [216.40.44.22]) by kanga.kvack.org (Postfix) with ESMTP id 550928D0001 for ; Fri, 18 Mar 2022 09:02:44 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E5F878249980 for ; Fri, 18 Mar 2022 13:02:43 +0000 (UTC) X-FDA: 79257521406.19.C1403FB Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by imf26.hostedemail.com (Postfix) with ESMTP id 1BEE6140033 for ; Fri, 18 Mar 2022 13:02:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1647608563; x=1679144563; h=from:to:cc:subject:date:message-id:mime-version; bh=vsczFr3MgbsN8jGklVyt7JkNJ3ifHP1+yQDJ5SClufU=; b=XjVevO+rKazEpM1wE51y4rnkp3gPfLF+QLRALV1hPsDXI6Pwj2VNfyQ2 CKpCdC+bPIwVQxbPYk20VtazTUcY2wxupgsKUkXlMtrGlCv6jp4SD3+SX 6kI3Ax5OlSrgorD8/QBFwKZnUfx04QF/yDqnabBM9wG+JOHY8EFOhq5RZ M=; Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-01.qualcomm.com with ESMTP; 18 Mar 2022 06:02:41 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg03-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2022 06:02:41 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 18 Mar 2022 06:02:40 -0700 Received: from hu-charante-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 18 Mar 2022 06:02:38 -0700 From: Charan Teja Kalla To: , , CC: , , Charan Teja Kalla Subject: [PATCH] mm: compaction: fix compiler warning when CONFIG_COMPACTION=n Date: Fri, 18 Mar 2022 18:31:58 +0530 Message-ID: <1647608518-20924-1-git-send-email-quic_charante@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 1BEE6140033 X-Stat-Signature: bh1x9bik4e6nwpqd6aejwrjzqr3qhop8 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcdkim header.b=XjVevO+r; spf=pass (imf26.hostedemail.com: domain of quic_charante@quicinc.com designates 199.106.114.38 as permitted sender) smtp.mailfrom=quic_charante@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com X-HE-Tag: 1647608562-381268 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The below warning is reported when CONFIG_COMPACTION=n: mm/compaction.c:56:27: warning: 'HPAGE_FRAG_CHECK_INTERVAL_MSEC' defined but not used [-Wunused-const-variable=] 56 | static const unsigned int HPAGE_FRAG_CHECK_INTERVAL_MSEC = 500; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix it by moving 'HPAGE_FRAG_CHECK_INTERVAL_MSEC' under CONFIG_COMPACTION defconfig. Also since this is just a 'static const int' type, use #define for it. Reported-by: kernel test robot Signed-off-by: Charan Teja Kalla Acked-by: Vlastimil Babka --- mm/compaction.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index b4e94cd..4d86d04 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -26,6 +26,11 @@ #include "internal.h" #ifdef CONFIG_COMPACTION +/* + * Fragmentation score check interval for proactive compaction purposes. + */ +#define HPAGE_FRAG_CHECK_INTERVAL_MSEC (500) + static inline void count_compact_event(enum vm_event_item item) { count_vm_event(item); @@ -51,11 +56,6 @@ static inline void count_compact_events(enum vm_event_item item, long delta) #define pageblock_end_pfn(pfn) block_end_pfn(pfn, pageblock_order) /* - * Fragmentation score check interval for proactive compaction purposes. - */ -static const unsigned int HPAGE_FRAG_CHECK_INTERVAL_MSEC = 500; - -/* * Page order with-respect-to which proactive compaction * calculates external fragmentation, which is used as * the "fragmentation score" of a node/zone.