linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm:remove unneeded variable
@ 2021-12-07  8:32 cgel.zte
  2021-12-07 10:18 ` David Hildenbrand
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: cgel.zte @ 2021-12-07  8:32 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, chiminghao, Zeal Robot

From: chiminghao <chi.minghao@zte.com.cn>

return value form directly instead of
taking this in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cm>
Signed-off-by: chiminghao <chi.minghao@zte.com.cn>
---
 mm/truncate.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/mm/truncate.c b/mm/truncate.c
index cc83a3f7c1ad..41b8249b3b4a 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -205,7 +205,6 @@ static void truncate_cleanup_page(struct page *page)
 static int
 invalidate_complete_page(struct address_space *mapping, struct page *page)
 {
-	int ret;
 
 	if (page->mapping != mapping)
 		return 0;
@@ -213,9 +212,7 @@ invalidate_complete_page(struct address_space *mapping, struct page *page)
 	if (page_has_private(page) && !try_to_release_page(page, 0))
 		return 0;
 
-	ret = remove_mapping(mapping, page);
-
-	return ret;
+	return remove_mapping(mapping, page);
 }
 
 int truncate_inode_page(struct address_space *mapping, struct page *page)
-- 
2.25.1


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

* Re: [PATCH] mm:remove unneeded variable
  2021-12-07  8:32 [PATCH] mm:remove unneeded variable cgel.zte
@ 2021-12-07 10:18 ` David Hildenbrand
  2021-12-08  9:35 ` Muchun Song
  2021-12-08 12:35 ` Pankaj Gupta
  2 siblings, 0 replies; 4+ messages in thread
From: David Hildenbrand @ 2021-12-07 10:18 UTC (permalink / raw)
  To: cgel.zte, akpm; +Cc: linux-mm, linux-kernel, chiminghao, Zeal Robot

On 07.12.21 09:32, cgel.zte@gmail.com wrote:
> From: chiminghao <chi.minghao@zte.com.cn>
> 
> return value form directly instead of
> taking this in another redundant variable.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cm>
> Signed-off-by: chiminghao <chi.minghao@zte.com.cn>
> ---
>  mm/truncate.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/mm/truncate.c b/mm/truncate.c
> index cc83a3f7c1ad..41b8249b3b4a 100644
> --- a/mm/truncate.c
> +++ b/mm/truncate.c
> @@ -205,7 +205,6 @@ static void truncate_cleanup_page(struct page *page)
>  static int
>  invalidate_complete_page(struct address_space *mapping, struct page *page)
>  {
> -	int ret;
>  
>  	if (page->mapping != mapping)
>  		return 0;
> @@ -213,9 +212,7 @@ invalidate_complete_page(struct address_space *mapping, struct page *page)
>  	if (page_has_private(page) && !try_to_release_page(page, 0))
>  		return 0;
>  
> -	ret = remove_mapping(mapping, page);
> -
> -	return ret;
> +	return remove_mapping(mapping, page);
>  }
>  
>  int truncate_inode_page(struct address_space *mapping, struct page *page)
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb


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

* Re: [PATCH] mm:remove unneeded variable
  2021-12-07  8:32 [PATCH] mm:remove unneeded variable cgel.zte
  2021-12-07 10:18 ` David Hildenbrand
@ 2021-12-08  9:35 ` Muchun Song
  2021-12-08 12:35 ` Pankaj Gupta
  2 siblings, 0 replies; 4+ messages in thread
From: Muchun Song @ 2021-12-08  9:35 UTC (permalink / raw)
  To: cgel.zte
  Cc: Andrew Morton, Linux Memory Management List, LKML, chiminghao,
	Zeal Robot

On Tue, Dec 7, 2021 at 4:32 PM <cgel.zte@gmail.com> wrote:
>
> From: chiminghao <chi.minghao@zte.com.cn>
>
> return value form directly instead of
> taking this in another redundant variable.
>
> Reported-by: Zeal Robot <zealci@zte.com.cm>
> Signed-off-by: chiminghao <chi.minghao@zte.com.cn>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.

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

* Re: [PATCH] mm:remove unneeded variable
  2021-12-07  8:32 [PATCH] mm:remove unneeded variable cgel.zte
  2021-12-07 10:18 ` David Hildenbrand
  2021-12-08  9:35 ` Muchun Song
@ 2021-12-08 12:35 ` Pankaj Gupta
  2 siblings, 0 replies; 4+ messages in thread
From: Pankaj Gupta @ 2021-12-08 12:35 UTC (permalink / raw)
  To: cgel.zte; +Cc: Andrew Morton, Linux MM, LKML, chiminghao, Zeal Robot

> return value form directly instead of
> taking this in another redundant variable.
>
> Reported-by: Zeal Robot <zealci@zte.com.cm>
> Signed-off-by: chiminghao <chi.minghao@zte.com.cn>
> ---
>  mm/truncate.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/mm/truncate.c b/mm/truncate.c
> index cc83a3f7c1ad..41b8249b3b4a 100644
> --- a/mm/truncate.c
> +++ b/mm/truncate.c
> @@ -205,7 +205,6 @@ static void truncate_cleanup_page(struct page *page)
>  static int
>  invalidate_complete_page(struct address_space *mapping, struct page *page)
>  {
> -       int ret;
>
>         if (page->mapping != mapping)
>                 return 0;
> @@ -213,9 +212,7 @@ invalidate_complete_page(struct address_space *mapping, struct page *page)
>         if (page_has_private(page) && !try_to_release_page(page, 0))
>                 return 0;
>
> -       ret = remove_mapping(mapping, page);
> -
> -       return ret;
> +       return remove_mapping(mapping, page);
>  }
>
>  int truncate_inode_page(struct address_space *mapping, struct page *page)

 Reviewed-by: Pankaj Gupta <pankaj.gupta@ionos.com>

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

end of thread, other threads:[~2021-12-08 12:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-07  8:32 [PATCH] mm:remove unneeded variable cgel.zte
2021-12-07 10:18 ` David Hildenbrand
2021-12-08  9:35 ` Muchun Song
2021-12-08 12:35 ` Pankaj Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).