Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1551742pxb; Tue, 8 Feb 2022 22:02:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxIShAGgwSuPAxLPw9u1WusMrxiqIVC6sHQVDqxvuUBltJBFPl9MgxH9ZEVpsti5IeQ1+cr X-Received: by 2002:a17:903:2441:: with SMTP id l1mr696460pls.142.1644386521908; Tue, 08 Feb 2022 22:02:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644386521; cv=none; d=google.com; s=arc-20160816; b=Zgf4NoAuH6tgQh1Spx33At5976Woss7jWJmNmCvO8pymomx69hSiEjBQhKrWuBLy8n RIf+Vv9VkDReItZqJpKWEsqPseZuQhdpw23lqYnbEmVgA5PDIFcITem1I8UYZ1kieYx1 +TzkJbjUph6YRatAx3k33DqBIJid7sehTTsOr7ugQpvd+YKt8Haj9/qDyuEGhOkNOwRt QQYP/UYwhT1snQwR2odkRySM7rF0vq1co6/YfFdgOfywa5/gGzlfixNtt3v9/Pb354v0 ylus62gRWFzc3BBODq9UY2RMx/0Fs902mS29RAI/L81urDlX39bSQSrj+M484IH4LDXw ZHMg== 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:dkim-signature; bh=CQsoOP8XBEf0Y9kggz5lsaybM/dPp9wM0PHidbsShwo=; b=dfsezvBoIiFkNNIPjEjOW58QelvzOZ6wlDbcILh9kDKL4hmzqa090qfFK4Atm+3cAY yjwYd5iL+CzOZmQZF4OtkXaTX+QBg1zohtveoUjffhTPkcxp90B1ZXkQfSSuI7XDJLGJ 95f2t5LUP6iyp242U7p4qIoJ88KJJAPWRKA4x2aTU9tfhF5ETVtQPD8pZo5GTaVgHkZF 2Mo3EHEACfcZssTq0zjOREF5ptX8Rjv4JhBI3R6hfi2QoVqsgq89KgTAXhbSwmM3nvg6 lL0xMip5cQU208LdPqydbDshy+1iYe8yhko1t6KuNMqv5rPruIikC/TFvuhByo1CnEPh w33A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OkCcogNC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id h184si1894364pge.637.2022.02.08.22.02.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 22:02:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OkCcogNC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 75185C05CBBC; Tue, 8 Feb 2022 21:51:27 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234966AbiBGRWm (ORCPT + 99 others); Mon, 7 Feb 2022 12:22:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1390804AbiBGRL0 (ORCPT ); Mon, 7 Feb 2022 12:11:26 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24353C0401E5 for ; Mon, 7 Feb 2022 09:11:21 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id B1A8D6118F for ; Mon, 7 Feb 2022 17:11:20 +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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) 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; base-commit: b3c0a155ef77550d48f6eb7c6fdd6075764a5622 -- 2.35.1