linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/rmap.c: remove set but not used variable 'cstart'
@ 2019-07-24 14:14 YueHaibing
  2019-07-24 18:24 ` Mike Kravetz
  2019-07-25  8:23 ` Kirill Tkhai
  0 siblings, 2 replies; 5+ messages in thread
From: YueHaibing @ 2019-07-24 14:14 UTC (permalink / raw)
  To: akpm, jglisse, kirill.shutemov, mike.kravetz, rcampbell, ktkhai,
	colin.king
  Cc: linux-kernel, linux-mm, YueHaibing

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

mm/rmap.c: In function page_mkclean_one:
mm/rmap.c:906:17: warning: variable cstart set but not used [-Wunused-but-set-variable]

It is not used any more since
commit cdb07bdea28e ("mm/rmap.c: remove redundant variable cend")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 mm/rmap.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/mm/rmap.c b/mm/rmap.c
index ec1af8b..40e4def 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -903,10 +903,9 @@ static bool page_mkclean_one(struct page *page, struct vm_area_struct *vma,
 	mmu_notifier_invalidate_range_start(&range);
 
 	while (page_vma_mapped_walk(&pvmw)) {
-		unsigned long cstart;
 		int ret = 0;
 
-		cstart = address = pvmw.address;
+		address = pvmw.address;
 		if (pvmw.pte) {
 			pte_t entry;
 			pte_t *pte = pvmw.pte;
@@ -933,7 +932,6 @@ static bool page_mkclean_one(struct page *page, struct vm_area_struct *vma,
 			entry = pmd_wrprotect(entry);
 			entry = pmd_mkclean(entry);
 			set_pmd_at(vma->vm_mm, address, pmd, entry);
-			cstart &= PMD_MASK;
 			ret = 1;
 #else
 			/* unexpected pmd-mapped page? */
-- 
2.7.4



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

* Re: [PATCH] mm/rmap.c: remove set but not used variable 'cstart'
  2019-07-24 14:14 [PATCH] mm/rmap.c: remove set but not used variable 'cstart' YueHaibing
@ 2019-07-24 18:24 ` Mike Kravetz
  2019-07-25  8:23 ` Kirill Tkhai
  1 sibling, 0 replies; 5+ messages in thread
From: Mike Kravetz @ 2019-07-24 18:24 UTC (permalink / raw)
  To: YueHaibing, akpm, jglisse, kirill.shutemov, rcampbell, ktkhai,
	colin.king
  Cc: linux-kernel, linux-mm

On 7/24/19 7:14 AM, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> mm/rmap.c: In function page_mkclean_one:
> mm/rmap.c:906:17: warning: variable cstart set but not used [-Wunused-but-set-variable]
> 
> It is not used any more since
> commit cdb07bdea28e ("mm/rmap.c: remove redundant variable cend")

It appears Commit 0f10851ea475 ("mm/mmu_notifier: avoid double notification
when it is useless") is what removed the use of cstart and cend.  And, they
should have been removed then.

> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
-- 
Mike Kravetz

> ---
>  mm/rmap.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/mm/rmap.c b/mm/rmap.c
> index ec1af8b..40e4def 100644
> --- a/mm/rmap.c
> +++ b/mm/rmap.c
> @@ -903,10 +903,9 @@ static bool page_mkclean_one(struct page *page, struct vm_area_struct *vma,
>  	mmu_notifier_invalidate_range_start(&range);
>  
>  	while (page_vma_mapped_walk(&pvmw)) {
> -		unsigned long cstart;
>  		int ret = 0;
>  
> -		cstart = address = pvmw.address;
> +		address = pvmw.address;
>  		if (pvmw.pte) {
>  			pte_t entry;
>  			pte_t *pte = pvmw.pte;
> @@ -933,7 +932,6 @@ static bool page_mkclean_one(struct page *page, struct vm_area_struct *vma,
>  			entry = pmd_wrprotect(entry);
>  			entry = pmd_mkclean(entry);
>  			set_pmd_at(vma->vm_mm, address, pmd, entry);
> -			cstart &= PMD_MASK;
>  			ret = 1;
>  #else
>  			/* unexpected pmd-mapped page? */
> 


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

* Re: [PATCH] mm/rmap.c: remove set but not used variable 'cstart'
  2019-07-24 14:14 [PATCH] mm/rmap.c: remove set but not used variable 'cstart' YueHaibing
  2019-07-24 18:24 ` Mike Kravetz
@ 2019-07-25  8:23 ` Kirill Tkhai
  1 sibling, 0 replies; 5+ messages in thread
From: Kirill Tkhai @ 2019-07-25  8:23 UTC (permalink / raw)
  To: YueHaibing, akpm, jglisse, kirill.shutemov, mike.kravetz,
	rcampbell, colin.king
  Cc: linux-kernel, linux-mm

On 24.07.2019 17:14, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> mm/rmap.c: In function page_mkclean_one:
> mm/rmap.c:906:17: warning: variable cstart set but not used [-Wunused-but-set-variable]
> 
> It is not used any more since
> commit cdb07bdea28e ("mm/rmap.c: remove redundant variable cend")
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>

> ---
>  mm/rmap.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/mm/rmap.c b/mm/rmap.c
> index ec1af8b..40e4def 100644
> --- a/mm/rmap.c
> +++ b/mm/rmap.c
> @@ -903,10 +903,9 @@ static bool page_mkclean_one(struct page *page, struct vm_area_struct *vma,
>  	mmu_notifier_invalidate_range_start(&range);
>  
>  	while (page_vma_mapped_walk(&pvmw)) {
> -		unsigned long cstart;
>  		int ret = 0;
>  
> -		cstart = address = pvmw.address;
> +		address = pvmw.address;
>  		if (pvmw.pte) {
>  			pte_t entry;
>  			pte_t *pte = pvmw.pte;
> @@ -933,7 +932,6 @@ static bool page_mkclean_one(struct page *page, struct vm_area_struct *vma,
>  			entry = pmd_wrprotect(entry);
>  			entry = pmd_mkclean(entry);
>  			set_pmd_at(vma->vm_mm, address, pmd, entry);
> -			cstart &= PMD_MASK;
>  			ret = 1;
>  #else
>  			/* unexpected pmd-mapped page? */
> 


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

* Re: [PATCH] mm/rmap.c: remove set but not used variable 'cstart'
  2019-08-23  4:08 zhengbin
@ 2019-08-23 11:54 ` Kirill A. Shutemov
  0 siblings, 0 replies; 5+ messages in thread
From: Kirill A. Shutemov @ 2019-08-23 11:54 UTC (permalink / raw)
  To: zhengbin
  Cc: akpm, kirill.shutemov, jglisse, mike.kravetz, rcampbell, ktkhai,
	aryabinin, hughd, linux-mm, yi.zhang

On Fri, Aug 23, 2019 at 12:08:41PM +0800, zhengbin wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> mm/rmap.c: In function page_mkclean_one:
> mm/rmap.c:906:17: warning: variable cstart set but not used [-Wunused-but-set-variable]
> 
> It is not used since commit 0f10851ea475 ("mm/mmu_notifier:
> avoid double notification when it is useless")
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>

There is already fix in the mm tree. See

http://lkml.kernel.org/r/20190724141453.38536-1-yuehaibing@huawei.com

-- 
 Kirill A. Shutemov


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

* [PATCH] mm/rmap.c: remove set but not used variable 'cstart'
@ 2019-08-23  4:08 zhengbin
  2019-08-23 11:54 ` Kirill A. Shutemov
  0 siblings, 1 reply; 5+ messages in thread
From: zhengbin @ 2019-08-23  4:08 UTC (permalink / raw)
  To: akpm, kirill.shutemov, jglisse, mike.kravetz, rcampbell, ktkhai,
	aryabinin, hughd, linux-mm
  Cc: yi.zhang, zhengbin13

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

mm/rmap.c: In function page_mkclean_one:
mm/rmap.c:906:17: warning: variable cstart set but not used [-Wunused-but-set-variable]

It is not used since commit 0f10851ea475 ("mm/mmu_notifier:
avoid double notification when it is useless")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 mm/rmap.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/mm/rmap.c b/mm/rmap.c
index 003377e..31352bb 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -903,10 +903,9 @@ static bool page_mkclean_one(struct page *page, struct vm_area_struct *vma,
 	mmu_notifier_invalidate_range_start(&range);

 	while (page_vma_mapped_walk(&pvmw)) {
-		unsigned long cstart;
 		int ret = 0;

-		cstart = address = pvmw.address;
+		address = pvmw.address;
 		if (pvmw.pte) {
 			pte_t entry;
 			pte_t *pte = pvmw.pte;
@@ -933,7 +932,6 @@ static bool page_mkclean_one(struct page *page, struct vm_area_struct *vma,
 			entry = pmd_wrprotect(entry);
 			entry = pmd_mkclean(entry);
 			set_pmd_at(vma->vm_mm, address, pmd, entry);
-			cstart &= PMD_MASK;
 			ret = 1;
 #else
 			/* unexpected pmd-mapped page? */
--
2.7.4



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

end of thread, other threads:[~2019-08-23 11:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-24 14:14 [PATCH] mm/rmap.c: remove set but not used variable 'cstart' YueHaibing
2019-07-24 18:24 ` Mike Kravetz
2019-07-25  8:23 ` Kirill Tkhai
2019-08-23  4:08 zhengbin
2019-08-23 11:54 ` Kirill A. Shutemov

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