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 6F3591F26E3; Tue, 12 Nov 2024 10:32:16 +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=1731407536; cv=none; b=Q1REZ+Hna/SYunwHuCZ1JfugQotzGzdqCYyEZVEyE8+7UQZEimQZyiYPhhSuAFWtVpFAPw7H8K26FnMvC9qrl0iSG96OM67QDcNoseMGsOUrbbsfkcO7fJBetLLo8Jh1N9/GBShtJHHQTRPETgNX3pMA2MCJPY0GJ1x5zlsT9Js= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731407536; c=relaxed/simple; bh=njpGOjrg+r//TIgBYYPzn/F2OKblnOqi8CCKx+uGlpM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X3XtsdO7MpkZmfVr89KpoHtpI33vq7vn/4yCSLHorTOFGqSO0OS3e18uN+SUmu8yXnWC9cXUlbG4g9mjnSLieTMwDWhx6XaIrsNpKRu3uSnVneYIyANbQtSmahbj967gn4ju44LlpyOphA+rzCRPxPuDwijzhmKXWn+AIAPFRsI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XCqZ80M6; 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="XCqZ80M6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C572AC4CECD; Tue, 12 Nov 2024 10:32:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1731407536; bh=njpGOjrg+r//TIgBYYPzn/F2OKblnOqi8CCKx+uGlpM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XCqZ80M64UTJljceWEiaINOKg8X5qfP7LL8CAigEyvFyV4uVmipyjHfLBRZQyxssl ukLY3L1Q+2reX2QwJKU7zLC07mdNzFxvGsEZjtyBqFgLTVXidmL3TITTnJ4mmMLy3a 3YT0MaBzR1b6Z8KdaPK/ggAxxMCp07QLnPN+B+nU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Qi Xi , kernel test robot , Baoquan He , Dave Young , Michael Holzheu , Vivek Goyal , Wang ShaoBo , Andrew Morton Subject: [PATCH 6.1 82/98] fs/proc: fix compile warning about variable vmcore_mmap_ops Date: Tue, 12 Nov 2024 11:21:37 +0100 Message-ID: <20241112101847.374756510@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241112101844.263449965@linuxfoundation.org> References: <20241112101844.263449965@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Qi Xi commit b8ee299855f08539e04d6c1a6acb3dc9e5423c00 upstream. When build with !CONFIG_MMU, the variable 'vmcore_mmap_ops' is defined but not used: >> fs/proc/vmcore.c:458:42: warning: unused variable 'vmcore_mmap_ops' 458 | static const struct vm_operations_struct vmcore_mmap_ops = { Fix this by only defining it when CONFIG_MMU is enabled. Link: https://lkml.kernel.org/r/20241101034803.9298-1-xiqi2@huawei.com Fixes: 9cb218131de1 ("vmcore: introduce remap_oldmem_pfn_range()") Signed-off-by: Qi Xi Reported-by: kernel test robot Closes: https://lore.kernel.org/lkml/202410301936.GcE8yUos-lkp@intel.com/ Cc: Baoquan He Cc: Dave Young Cc: Michael Holzheu Cc: Vivek Goyal Cc: Wang ShaoBo Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- fs/proc/vmcore.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) --- a/fs/proc/vmcore.c +++ b/fs/proc/vmcore.c @@ -457,10 +457,6 @@ static vm_fault_t mmap_vmcore_fault(stru #endif } -static const struct vm_operations_struct vmcore_mmap_ops = { - .fault = mmap_vmcore_fault, -}; - /** * vmcore_alloc_buf - allocate buffer in vmalloc memory * @size: size of buffer @@ -488,6 +484,11 @@ static inline char *vmcore_alloc_buf(siz * virtually contiguous user-space in ELF layout. */ #ifdef CONFIG_MMU + +static const struct vm_operations_struct vmcore_mmap_ops = { + .fault = mmap_vmcore_fault, +}; + /* * remap_oldmem_pfn_checked - do remap_oldmem_pfn_range replacing all pages * reported as not being ram with the zero page.