diff mbox series

Fixed Kunit test warning message for 'fs' module

Message ID 20230928085311.938163-1-singhabhinav9051571833@gmail.com (mailing list archive)
State New, archived
Headers show
Series Fixed Kunit test warning message for 'fs' module | expand

Commit Message

Abhinav Singh Sept. 28, 2023, 8:53 a.m. UTC
fs/proc/task_mmu : fix warning

All the caller of the function pagemap_scan_backout_range(...) are inside
ifdef preprocessor which is checking for the macro
'CONFIG_TRANSPARENT_HUGEPAGE' is set or not. When it is not set the
function doesn't have a caller and it generates a warning unused
function.

Putting the whole function inside the preprocessor fixes this warning.

Signed-off-by: Abhinav <singhabhinav9051571833@gmail.com>
---
 fs/proc/task_mmu.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Randy Dunlap Sept. 30, 2023, 2:45 a.m. UTC | #1
Hi,

On 9/28/23 01:53, Abhinav wrote:
> fs/proc/task_mmu : fix warning
> 
> All the caller of the function pagemap_scan_backout_range(...) are inside
> ifdef preprocessor which is checking for the macro
> 'CONFIG_TRANSPARENT_HUGEPAGE' is set or not. When it is not set the
> function doesn't have a caller and it generates a warning unused
> function.
> 
> Putting the whole function inside the preprocessor fixes this warning.
> 
> Signed-off-by: Abhinav <singhabhinav9051571833@gmail.com>

We have this patch:
  https://lore.kernel.org/all/20230927060257.2975412-1-arnd@kernel.org/

which is already merged.

Thanks.

> ---
>  fs/proc/task_mmu.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
> index 27da6337d675..88b6b8847cf3 100644
> --- a/fs/proc/task_mmu.c
> +++ b/fs/proc/task_mmu.c
> @@ -2019,6 +2019,7 @@ static bool pagemap_scan_push_range(unsigned long categories,
>  	return true;
>  }
>  
> +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
>  static void pagemap_scan_backout_range(struct pagemap_scan_private *p,
>  				       unsigned long addr, unsigned long end)
>  {
> @@ -2031,6 +2032,7 @@ static void pagemap_scan_backout_range(struct pagemap_scan_private *p,
>  
>  	p->found_pages -= (end - addr) / PAGE_SIZE;
>  }
> +#endif
>  
>  static int pagemap_scan_output(unsigned long categories,
>  			       struct pagemap_scan_private *p,
diff mbox series

Patch

diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 27da6337d675..88b6b8847cf3 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -2019,6 +2019,7 @@  static bool pagemap_scan_push_range(unsigned long categories,
 	return true;
 }
 
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 static void pagemap_scan_backout_range(struct pagemap_scan_private *p,
 				       unsigned long addr, unsigned long end)
 {
@@ -2031,6 +2032,7 @@  static void pagemap_scan_backout_range(struct pagemap_scan_private *p,
 
 	p->found_pages -= (end - addr) / PAGE_SIZE;
 }
+#endif
 
 static int pagemap_scan_output(unsigned long categories,
 			       struct pagemap_scan_private *p,