lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f79d2587-2588-598f-f9b2-2e3548067d92@huawei.com>
Date: Fri, 1 Nov 2024 11:38:29 +0800
From: Jinjie Ruan <ruanjinjie@...wei.com>
To: Qi Xi <xiqi2@...wei.com>, <bobo.shaobowang@...wei.com>, <bhe@...hat.com>,
	<vgoyal@...hat.com>, <dyoung@...hat.com>, <holzheu@...ux.vnet.ibm.com>,
	<akpm@...ux-foundation.org>, <kexec@...ts.infradead.org>,
	<linux-fsdevel@...r.kernel.org>
CC: <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] fs/proc: Fix compile warning about variable
 'vmcore_mmap_ops'



On 2024/11/1 11:23, Qi Xi wrote:
> 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 = {
> 
> v2: use ifdef instead of __maybe_unused

Changelogs should go after the '---' line, otherwise they
end up in the git history.

> 
> Fixes: 9cb218131de1 ("vmcore: introduce remap_oldmem_pfn_range()")
> Reported-by: kernel test robot <lkp@...el.com>
> Closes: https://lore.kernel.org/lkml/202410301936.GcE8yUos-lkp@intel.com/
> Signed-off-by: Qi Xi <xiqi2@...wei.com>
> ---
>  fs/proc/vmcore.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
> index 1fb213f379a5..9ed1f6902c8f 100644
> --- a/fs/proc/vmcore.c
> +++ b/fs/proc/vmcore.c
> @@ -455,10 +455,6 @@ static vm_fault_t mmap_vmcore_fault(struct vm_fault *vmf)
>  #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
> @@ -486,6 +482,11 @@ static inline char *vmcore_alloc_buf(size_t size)
>   * 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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ