From patchwork Mon Feb 7 17:10:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 12737688 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 F23F5C433EF for ; Mon, 7 Feb 2022 17:11:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 330AA6B0074; Mon, 7 Feb 2022 12:11:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2B9576B0075; Mon, 7 Feb 2022 12:11:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 132846B0078; Mon, 7 Feb 2022 12:11:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0056.hostedemail.com [216.40.44.56]) by kanga.kvack.org (Postfix) with ESMTP id 010096B0074 for ; Mon, 7 Feb 2022 12:11:28 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B94B2181B5EAC for ; Mon, 7 Feb 2022 17:11:28 +0000 (UTC) X-FDA: 79116625056.16.ADBEBFD Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf20.hostedemail.com (Postfix) with ESMTP id 1E5871C0002 for ; Mon, 7 Feb 2022 17:11:27 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id D40C9CE118B; Mon, 7 Feb 2022 17:11:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D04AFC340F2; Mon, 7 Feb 2022 17:11:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644253880; bh=RgvX0jcqavLp9XJXFApY0G2VLvAkEQCQ/aIXU87qu70=; h=From:To:Cc:Subject:Date:From; b=OkCcogNC3DZDflNBkNEseageG13LbVg9LQZvtOXB2Byk0lRVth8BWE4B8zl6BQ4B2 Q6qcx7bKtTzImt1qw7mQBZJbnB457mIJ9sL+6mPL0OZSNZwdXms6wt9c02GsSqyN+c zesZ0T+Czt3HiwzGJeeyxfd0/AubF8J2RszyG/1hRLB0UG16WVfZQSPrJIn+AmwNRl 5jQSgG7WgRLtHharj+imJ5wq0knTUjChsJCTgvpujHa+7xqwjBRXYlK0why6jpQ2jt 1bImjPr0PPVJU8mqz3YGpAACWsDmjXZBseNiggfcIwiGgELoiXuJUexfGQWnv6TGVy 1WetWAtPQl5iA== From: Nathan Chancellor To: Andrew Morton Cc: Yang Shi , David Hildenbrand , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Nathan Chancellor Subject: [PATCH] proc: Avoid unused variable warning in pagemap_pmd_range() Date: Mon, 7 Feb 2022 10:10:50 -0700 Message-Id: <20220207171049.1102239-1-nathan@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Rspam-User: nil X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 1E5871C0002 X-Stat-Signature: oip13bn4dj9o4dkjoqdcoz9ac18qnhae Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=OkCcogNC; spf=pass (imf20.hostedemail.com: domain of nathan@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=nathan@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-HE-Tag: 1644253887-163459 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: When building with CONFIG_TRANSPARENT_HUGEPAGE=n, there is a warning about migration being unused: fs/proc/task_mmu.c:1444:7: warning: unused variable 'migration' [-Wunused-variable] bool migration = false; ^ 1 warning generated. Move the ifdef preprocessor directive up to include migration so it is only included in the file when it is used. Signed-off-by: Nathan Chancellor --- This is a fix for fs-proc-task_mmuc-dont-read-mapcount-for-migration-entry-v4.patch. fs/proc/task_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: b3c0a155ef77550d48f6eb7c6fdd6075764a5622 diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index bc2f46033231..6e97ed775074 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -1441,9 +1441,9 @@ static int pagemap_pmd_range(pmd_t *pmdp, unsigned long addr, unsigned long end, spinlock_t *ptl; pte_t *pte, *orig_pte; int err = 0; +#ifdef CONFIG_TRANSPARENT_HUGEPAGE bool migration = false; -#ifdef CONFIG_TRANSPARENT_HUGEPAGE ptl = pmd_trans_huge_lock(pmdp, vma); if (ptl) { u64 flags = 0, frame = 0;