diff mbox series

[2/5] mm/swap: remove unused local variable nr_shadows

Message ID 20210518135352.3705306-3-linmiaohe@huawei.com (mailing list archive)
State New, archived
Headers show
Series Cleanups for swap | expand

Commit Message

Miaohe Lin May 18, 2021, 1:53 p.m. UTC
Since commit 55c653b71e8c ("mm: stop accounting shadow entries"),
nr_shadows is not used anymore.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/swap_state.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Matthew Wilcox (Oracle) May 18, 2021, 2:37 p.m. UTC | #1
On Tue, May 18, 2021 at 09:53:49PM +0800, Miaohe Lin wrote:
> Since commit 55c653b71e8c ("mm: stop accounting shadow entries"),
> nr_shadows is not used anymore.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>

> +++ b/mm/swap_state.c
> @@ -114,7 +114,6 @@ int add_to_swap_cache(struct page *page, swp_entry_t entry,
>  	SetPageSwapCache(page);
>  
>  	do {
> -		unsigned long nr_shadows = 0;
>  

Perhaps delete the blank line as well?
Miaohe Lin May 19, 2021, 1:37 a.m. UTC | #2
On 2021/5/18 22:37, Matthew Wilcox wrote:
> On Tue, May 18, 2021 at 09:53:49PM +0800, Miaohe Lin wrote:
>> Since commit 55c653b71e8c ("mm: stop accounting shadow entries"),
>> nr_shadows is not used anymore.
>>
>> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> 
> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> 
>> +++ b/mm/swap_state.c
>> @@ -114,7 +114,6 @@ int add_to_swap_cache(struct page *page, swp_entry_t entry,
>>  	SetPageSwapCache(page);
>>  
>>  	do {
>> -		unsigned long nr_shadows = 0;
>>  
> 
> Perhaps delete the blank line as well?

Will do. Many thanks for the review.

> 
> .
>
diff mbox series

Patch

diff --git a/mm/swap_state.c b/mm/swap_state.c
index df5405384520..bab386c7b655 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -114,7 +114,6 @@  int add_to_swap_cache(struct page *page, swp_entry_t entry,
 	SetPageSwapCache(page);
 
 	do {
-		unsigned long nr_shadows = 0;
 
 		xas_lock_irq(&xas);
 		xas_create_range(&xas);
@@ -124,7 +123,6 @@  int add_to_swap_cache(struct page *page, swp_entry_t entry,
 			VM_BUG_ON_PAGE(xas.xa_index != idx + i, page);
 			old = xas_load(&xas);
 			if (xa_is_value(old)) {
-				nr_shadows++;
 				if (shadowp)
 					*shadowp = old;
 			}
@@ -260,7 +258,6 @@  void clear_shadow_from_swap_cache(int type, unsigned long begin,
 	void *old;
 
 	for (;;) {
-		unsigned long nr_shadows = 0;
 		swp_entry_t entry = swp_entry(type, curr);
 		struct address_space *address_space = swap_address_space(entry);
 		XA_STATE(xas, &address_space->i_pages, curr);
@@ -270,7 +267,6 @@  void clear_shadow_from_swap_cache(int type, unsigned long begin,
 			if (!xa_is_value(old))
 				continue;
 			xas_store(&xas, NULL);
-			nr_shadows++;
 		}
 		xa_unlock_irq(&address_space->i_pages);