linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] mm/madvise: Remove set but not used variable 'zone'
@ 2020-09-17  7:17 Liu Shixin
  2020-09-17  7:53 ` Oscar Salvador
  0 siblings, 1 reply; 2+ messages in thread
From: Liu Shixin @ 2020-09-17  7:17 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm, linux-kernel, Liu Shixin

Fixes gcc '-Wunused-but-set-variable' warning:

mm/madvise.c: In function 'madvise_inject_error':
mm/madvise.c:882:15: warning: unused variable 'zone' [-Wunused-variable]

After 4b63fdbe2b25 ("mm: remove the now-unnecessary mmget_still_valid()
hack"), variable 'zone' is never used. Remove it to avoid build warning.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
 mm/madvise.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/mm/madvise.c b/mm/madvise.c
index 460e19d60ba3..94b9d17331b9 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -879,7 +879,6 @@ static long madvise_remove(struct vm_area_struct *vma,
 static int madvise_inject_error(int behavior,
 		unsigned long start, unsigned long end)
 {
-	struct zone *zone;
 	unsigned long size;
 
 	if (!capable(CAP_SYS_ADMIN))
-- 
2.25.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] mm/madvise: Remove set but not used variable 'zone'
  2020-09-17  7:17 [PATCH -next] mm/madvise: Remove set but not used variable 'zone' Liu Shixin
@ 2020-09-17  7:53 ` Oscar Salvador
  0 siblings, 0 replies; 2+ messages in thread
From: Oscar Salvador @ 2020-09-17  7:53 UTC (permalink / raw)
  To: Liu Shixin; +Cc: Andrew Morton, linux-mm, linux-kernel

On Thu, Sep 17, 2020 at 03:17:57PM +0800, Liu Shixin wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> mm/madvise.c: In function 'madvise_inject_error':
> mm/madvise.c:882:15: warning: unused variable 'zone' [-Wunused-variable]
> 
> After 4b63fdbe2b25 ("mm: remove the now-unnecessary mmget_still_valid()
> hack"), variable 'zone' is never used. Remove it to avoid build warning.

Hi Liu,

Andrew already fixed that in the mmotm tree.

Thanks anyway

> 
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
> ---
>  mm/madvise.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/mm/madvise.c b/mm/madvise.c
> index 460e19d60ba3..94b9d17331b9 100644
> --- a/mm/madvise.c
> +++ b/mm/madvise.c
> @@ -879,7 +879,6 @@ static long madvise_remove(struct vm_area_struct *vma,
>  static int madvise_inject_error(int behavior,
>  		unsigned long start, unsigned long end)
>  {
> -	struct zone *zone;
>  	unsigned long size;
>  
>  	if (!capable(CAP_SYS_ADMIN))
> -- 
> 2.25.1
> 
> 

-- 
Oscar Salvador
SUSE L3


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-17  7:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17  7:17 [PATCH -next] mm/madvise: Remove set but not used variable 'zone' Liu Shixin
2020-09-17  7:53 ` Oscar Salvador

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox