From patchwork Tue Nov 1 02:28:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?6YeR5aGU5bCW?= X-Patchwork-Id: 620782 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78AC7FA3740 for ; Tue, 1 Nov 2022 02:29:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229817AbiKAC2w (ORCPT ); Mon, 31 Oct 2022 22:28:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229868AbiKAC2u (ORCPT ); Mon, 31 Oct 2022 22:28:50 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 723F317898; Mon, 31 Oct 2022 19:28:48 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id l22-20020a17090a3f1600b00212fbbcfb78so17583664pjc.3; Mon, 31 Oct 2022 19:28:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=S9+wd/d26nPzxPMD3za/Xjqe3tTkigkq7OyKBI7dvzc=; b=CatEbRowU2ywt45dREKrkgA7CaFmvOdufAQ0prUMQblLdiEr+iKFatlv66jcBINXKt BApC7Xq10xrVvUJNyzzsYb6w7UYCDm2ZU0ICuFiPFNJPBCJEhs7jSZJMZf5E8fDvxhfn b/0TFgJlISYH/Kr/0JJ3sk9+ibPyMsgWoxKqBCcs/xMqGEcji1pxsNIT18YQGcJCQM9S uE4bHHtz6pUYZ9M9S9Y9n/j6NOuCxwkh7gnIFO2bGXnEc5MRBGK3IE6IbtEzFAWf/2Jj rVRvpfP6nbazaH5dSuFOdExlFpHQAlRezOlx6BviCcu5q9ogFYyKl2F1kGL5GZUYK2Is JsXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S9+wd/d26nPzxPMD3za/Xjqe3tTkigkq7OyKBI7dvzc=; b=QLsPe0pCkMYmQ68yQgK+vzDLzo/8D4dsKoFypv782Cyze/yNLqZ91c+/G58Sd8l+9G 5ANMS0qnj0Zq3MDAYI4eZP5MwNO8eoQEM1bwLagln2BAViFRAyMa6PEYGIe/Dlifc7BL 0WIRQV6+lJ+4Jo5/lnJaXm2APu2jt3oXklEN5Ajl/Ht6bzDfcJiR2EDu9ypve/c3nEWE tgKNWNdwpuUVFbaMGr51/HJ9uSBry3Pt9X1BcSxr3xKBadDDMNRxQjrOGGXlUioDApTB 1iperZOyOJo6UdWggsoj1viXUcC7DXVLHvJT6BipVa+JTiw2gWY6OpI9VwjrIDy3ygf8 wXhg== X-Gm-Message-State: ACrzQf2pnW+tWXlqBfavPjnb8XKrfru4Z9hm+33CsCdPzSdsutJYizV7 GHK6ZA+O7ES6HYylM4hk+zw= X-Google-Smtp-Source: AMsMyM6nc4eVpjuycwaedY8rS0v2bmpXj5xPgGwZChT1lD2VzXnww3zHJpoSD/oS/IVo5d0JiSTF6Q== X-Received: by 2002:a17:902:f686:b0:187:16a0:fd2b with SMTP id l6-20020a170902f68600b0018716a0fd2bmr11499574plg.91.1667269728041; Mon, 31 Oct 2022 19:28:48 -0700 (PDT) Received: from localhost.localdomain ([116.128.244.169]) by smtp.gmail.com with ESMTPSA id t5-20020a625f05000000b005385e2e86eesm5126925pfb.18.2022.10.31.19.28.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 19:28:47 -0700 (PDT) From: TGSP To: rafael@kernel.org, len.brown@intel.com, pavel@ucw.cz, huanglei@kylinos.cn Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, xiongxin , stable@vger.kernel.org Subject: [PATCH -next 1/2] PM: hibernate: fix spelling mistake for annotation Date: Tue, 1 Nov 2022 10:28:39 +0800 Message-Id: <20221101022840.1351163-2-tgsp002@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221101022840.1351163-1-tgsp002@gmail.com> References: <20221101022840.1351163-1-tgsp002@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: xiongxin 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 --- 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. *