All of lore.kernel.org
 help / color / mirror / Atom feed
From: xiongxin <xiongxin@kylinos.cn>
To: xiongxin@kylinos.cn
Cc: stable@vger.kernel.org
Subject: [PATCH -next 1/2] PM: hibernate: fix spelling mistake for annotation
Date: Mon, 31 Oct 2022 20:48:36 +0800	[thread overview]
Message-ID: <20221031124837.720118-2-xiongxin@kylinos.cn> (raw)
In-Reply-To: <20221031124837.720118-1-xiongxin@kylinos.cn>

The actual calculation formula in the code below is:

max_size = (count - (size + PAGES_FOR_IO)) / 2
	    - 2 * DIV_ROUND_UP(reserved_size, PAGE_SIZE);

But function comments are written differently, the comment is wrong?

By the way, what exactly do the "/ 2" and "2 *" mean?

Cc: stable@vger.kernel.org
Signed-off-by: xiongxin <xiongxin@kylinos.cn>
---
 kernel/power/snapshot.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index 2a406753af90..c20ca5fb9adc 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -1723,8 +1723,8 @@ static unsigned long minimum_image_size(unsigned long saveable)
  * /sys/power/reserved_size, respectively).  To make this happen, we compute the
  * total number of available page frames and allocate at least
  *
- * ([page frames total] + PAGES_FOR_IO + [metadata pages]) / 2
- *  + 2 * DIV_ROUND_UP(reserved_size, PAGE_SIZE)
+ * ([page frames total] - PAGES_FOR_IO - [metadata pages]) / 2
+ *  - 2 * DIV_ROUND_UP(reserved_size, PAGE_SIZE)
  *
  * of them, which corresponds to the maximum size of a hibernation image.
  *
-- 
2.25.1


No virus found
		Checked by Hillstone Network AntiVirus

       reply	other threads:[~2022-10-31 12:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20221031124837.720118-1-xiongxin@kylinos.cn>
2022-10-31 12:48 ` xiongxin [this message]
2022-11-01  2:28 [PATCH -next 0/2] Fixes to the hibernate_preallocate_memory() TGSP
2022-11-01  2:28 ` [PATCH -next 1/2] PM: hibernate: fix spelling mistake for annotation TGSP
2022-11-01 12:45   ` Bagas Sanjaya
2022-11-03 16:25   ` Rafael J. Wysocki
2022-11-04  7:31     ` TGSP
2022-11-05 18:09       ` Rafael J. Wysocki
     [not found] <20221101022342.1345980-1-tgsp002@gmail.com>
2022-11-01  2:23 ` TGSP
     [not found] <20221031124823.719912-1-xiongxin@kylinos.cn>
2022-10-31 12:48 ` xiongxin

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=20221031124837.720118-2-xiongxin@kylinos.cn \
    --to=xiongxin@kylinos.cn \
    --cc=stable@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.