diff mbox series

mm/z3fold.c: remove useless code in z3fold_page_isolate

Message ID 20190829191312.GA20298@embeddedor (mailing list archive)
State New, archived
Headers show
Series mm/z3fold.c: remove useless code in z3fold_page_isolate | expand

Commit Message

Gustavo A. R. Silva Aug. 29, 2019, 7:13 p.m. UTC
Remove duplicate and useless code.

Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 mm/z3fold.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Andrew Morton Aug. 30, 2019, 1:37 a.m. UTC | #1
On Thu, 29 Aug 2019 14:13:12 -0500 "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:

> Remove duplicate and useless code.
> 
> ...
>
> --- a/mm/z3fold.c
> +++ b/mm/z3fold.c
> @@ -1400,15 +1400,13 @@ static bool z3fold_page_isolate(struct page *page, isolate_mode_t mode)
>  			 * can call the release logic.
>  			 */
>  			if (unlikely(kref_put(&zhdr->refcount,
> -					      release_z3fold_page_locked))) {
> +					      release_z3fold_page_locked)))
>  				/*
>  				 * If we get here we have kref problems, so we
>  				 * should freak out.
>  				 */
>  				WARN(1, "Z3fold is experiencing kref problems\n");
> -				z3fold_page_unlock(zhdr);
> -				return false;
> -			}
> +
>  			z3fold_page_unlock(zhdr);
>  			return false;
>  		}

Thanks.

We prefer to retain the braces around a code block which is more than a
single line - it's easier on the eyes.

--- a/mm/z3fold.c~mm-z3foldc-remove-useless-code-in-z3fold_page_isolate-fix
+++ a/mm/z3fold.c
@@ -1400,13 +1400,13 @@ static bool z3fold_page_isolate(struct p
 			 * can call the release logic.
 			 */
 			if (unlikely(kref_put(&zhdr->refcount,
-					      release_z3fold_page_locked)))
+					      release_z3fold_page_locked))) {
 				/*
 				 * If we get here we have kref problems, so we
 				 * should freak out.
 				 */
 				WARN(1, "Z3fold is experiencing kref problems\n");
-
+			}
 			z3fold_page_unlock(zhdr);
 			return false;
 		}
diff mbox series

Patch

diff --git a/mm/z3fold.c b/mm/z3fold.c
index 75b7962439ff..044b7075d0ba 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -1400,15 +1400,13 @@  static bool z3fold_page_isolate(struct page *page, isolate_mode_t mode)
 			 * can call the release logic.
 			 */
 			if (unlikely(kref_put(&zhdr->refcount,
-					      release_z3fold_page_locked))) {
+					      release_z3fold_page_locked)))
 				/*
 				 * If we get here we have kref problems, so we
 				 * should freak out.
 				 */
 				WARN(1, "Z3fold is experiencing kref problems\n");
-				z3fold_page_unlock(zhdr);
-				return false;
-			}
+
 			z3fold_page_unlock(zhdr);
 			return false;
 		}