From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8527C2FD1AD; Tue, 12 Aug 2025 18:26:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755023189; cv=none; b=MvEYDVrR8Z5cege89ZfyQE9o/APQ+ba+xY0OyC4XeIIp9bt7YuJFaqKGkQ3q4hDJ9eeNPD/ZAFF01binsYkjyXX8dKgEaNtzsytKqoemZwpkY9G67uKF5k0YbFr+NHGQXQ1kvLMTeRuW6gm9FR2X3W2/uxzAMxW+m5HQv31drqQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755023189; c=relaxed/simple; bh=ali0WR53wtsWkv2c16MW8jhpVYrDFlrDFFGJPrMcZJY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DS8N3aK8hQ0U3Bn/LBCCtg3fRz0I0rzJXEJqvZXPF04izPEnnOUqkyq+XejjlXYSECgVLftKI1fFLN2se84TCwzYvOByJNfgPsLjdOSZdpgNWbvikzoPYOipRc456hRo18w593evnO6CkpVLw+AZxpLZ5TFDq6fZFooB2lcoXpY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=s2Dc97QY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="s2Dc97QY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D275DC4CEF6; Tue, 12 Aug 2025 18:26:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755023189; bh=ali0WR53wtsWkv2c16MW8jhpVYrDFlrDFFGJPrMcZJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s2Dc97QYbbXYxXdGjNwazKOFLYAxRmG/5wVSqHJqxwgyDsBUhusEaBDUylLn1BXSP jzPtgWa8O14LccIpLPacak6zapSCmOCN6Iwwcs8qDrXrxr1HiT2WXp3+hdvdaU5C9c bE+wpjGGpS5BeqWoGl7ui0xUERH6QhNQH3aARius= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Andy Shevchenko , Leon Romanovsky , Alistair Popple , Bill Wendling , Jerome Glisse , Justin Stitt , Nathan Chancellor , Andrew Morton Subject: [PATCH 6.12 362/369] mm/hmm: move pmd_to_hmm_pfn_flags() to the respective #ifdeffery Date: Tue, 12 Aug 2025 19:30:59 +0200 Message-ID: <20250812173030.302564737@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250812173014.736537091@linuxfoundation.org> References: <20250812173014.736537091@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andy Shevchenko commit 188cb385bbf04d486df3e52f28c47b3961f5f0c0 upstream. When pmd_to_hmm_pfn_flags() is unused, it prevents kernel builds with clang, `make W=1` and CONFIG_TRANSPARENT_HUGEPAGE=n: mm/hmm.c:186:29: warning: unused function 'pmd_to_hmm_pfn_flags' [-Wunused-function] Fix this by moving the function to the respective existing ifdeffery for its the only user. See also: 6863f5643dd7 ("kbuild: allow Clang to find unused static inline functions for W=1 build") Link: https://lkml.kernel.org/r/20250710082403.664093-1-andriy.shevchenko@linux.intel.com Fixes: 992de9a8b751 ("mm/hmm: allow to mirror vma of a file on a DAX backed filesystem") Signed-off-by: Andy Shevchenko Reviewed-by: Leon Romanovsky Reviewed-by: Alistair Popple Cc: Andriy Shevchenko Cc: Bill Wendling Cc: Jerome Glisse Cc: Justin Stitt Cc: Nathan Chancellor Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- mm/hmm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/hmm.c +++ b/mm/hmm.c @@ -173,6 +173,7 @@ static inline unsigned long hmm_pfn_flag return order << HMM_PFN_ORDER_SHIFT; } +#ifdef CONFIG_TRANSPARENT_HUGEPAGE static inline unsigned long pmd_to_hmm_pfn_flags(struct hmm_range *range, pmd_t pmd) { @@ -183,7 +184,6 @@ static inline unsigned long pmd_to_hmm_p hmm_pfn_flags_order(PMD_SHIFT - PAGE_SHIFT); } -#ifdef CONFIG_TRANSPARENT_HUGEPAGE static int hmm_vma_handle_pmd(struct mm_walk *walk, unsigned long addr, unsigned long end, unsigned long hmm_pfns[], pmd_t pmd)