linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/z3fold.c: remove useless code in z3fold_page_isolate
Date: Thu, 29 Aug 2019 18:37:07 -0700	[thread overview]
Message-ID: <20190829183707.71f13473d1b034dd424f85d7@linux-foundation.org> (raw)
In-Reply-To: <20190829191312.GA20298@embeddedor>

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;
 		}
_


      reply	other threads:[~2019-08-30  1:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-29 19:13 [PATCH] mm/z3fold.c: remove useless code in z3fold_page_isolate Gustavo A. R. Silva
2019-08-30  1:37 ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190829183707.71f13473d1b034dd424f85d7@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=gustavo@embeddedor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).