From patchwork Fri Nov 4 05:41:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: TGSP X-Patchwork-Id: 15336 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp188694wru; Thu, 3 Nov 2022 22:45:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Udiw0pXkKahtCpOkExzCyCwFV0dBtTL0Vl93l9HJQYMNd5qpmsHOsqYgPa26JessiofGb X-Received: by 2002:a50:fb95:0:b0:463:526:308b with SMTP id e21-20020a50fb95000000b004630526308bmr31747379edq.424.1667540702889; Thu, 03 Nov 2022 22:45:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667540702; cv=none; d=google.com; s=arc-20160816; b=UvQshoMph6jZa+RKy5rr6alBQGiniGHMhQrP/dw64DrEvplaEexQ07eEETVRkINd72 fgioP7Hx4mFJT3L3h/AaQ7JB5GhOFl+GPp1ACiqXQASgMcxNxdPslK0DfQPgpsAdGbIh 7WqdQXhOe+S35NjxxM5IvFdYNAwYgSx6FJgCdYUWS4l8E7AL4fuHEaVWV8+XsRqFpXlB +sRPCf4jjY9hg3LHbVFxAkZhcy5DBrkJKS4uO7ZUm78BgBpwYmX05nvfeJUg+RNF6/NM CI7d9EGJb3K+M01xP4xkGl8ft4pRulT2Gz0vEJLxMwVWmXPQe8fUgiEa76s+ARuDZ/rj nAMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=S9+wd/d26nPzxPMD3za/Xjqe3tTkigkq7OyKBI7dvzc=; b=rzCWzfF0/mYgWecclSdVrDPtltwjC7OC0NIgqB+4+a+VnTeccSEjjOJVsIOHj+QIcn jlg8V9EinBPRTsN0TYX2wMQAEgUhBtoBe3kcDtC+fK+x9uJfNQ+mUDvs2hcJn+nIJRAi U6iNknUGUCNuCK/bNPXkdV9+ltFtuFTsGhKBWpG9SADDQnYbr49XJ65/fqhz7ZkZeWM/ ncMvAdBlvkbk3u7p9bzGWUsS8qciLX1Rx9mSv3n2objOHNtLKDU4anV9vtlNFDstLaHd JpGT7eU/31UEPNhnSRsZHIJm3+O3ukfHueU/LIPbybZZgNgI2sCOotILqnGQql6gm6Gg MU0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pNnLMLpB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p11-20020a056402500b00b0045b265a1712si3597295eda.595.2022.11.03.22.44.39; Thu, 03 Nov 2022 22:45:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pNnLMLpB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231243AbiKDFld (ORCPT + 99 others); Fri, 4 Nov 2022 01:41:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230377AbiKDFl3 (ORCPT ); Fri, 4 Nov 2022 01:41:29 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C94A8275CD; Thu, 3 Nov 2022 22:41:28 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id k22so3615158pfd.3; Thu, 03 Nov 2022 22:41:28 -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=pNnLMLpBzc+72sVwLQ4rebigm5zWOx4LYczRbHPQpI7CDybS5XeVsceGIwLeSpM7iT qikW5kfEFH0tn4B3m0b8GBR+xb64tfFFQN1sBE+4ZpNe5FrTozqrXThq5FeSgqctCGUV sEDRCq5byPTXSz/yigP8CyE+iM/G76pQ9LoveN4Aod8jUCYpqpCddm7oPxlT7HipBHsA 9KL6bCRRbkZFLXEbagVgott+y+tlk5CIcRDsxFpxOFGUJjiwjvRyzLJjLcXZ0uPpc5nE mu20rOG63OERUuwa7Obmq+ZPzK2Td0Os0Q0BhxdusOoJ4ecigPbuXx7txImUyGbkrc6I 8H2A== 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=UTZEJIPHdhV+6FXCPXDqC1FtpvJQzsR4YlCTlQxq1+TqvuoAaJCzJIpZ85NMTg4jSx qvNqjzYYLEG/YNg1CNaYnCn92ZShEmCn8F1YB6ioXQwUhzw0MCUGFJ1b8elCroKxMuO+ G3YGFZhMtH5BbFmwHmG9XqwFIJYnAZh5odfp+yjt8iem7f+RHOg1dWU8S+Xd/9iJIIZv Dv1FtYvrg0YAqXk8foMrGnFUQajlV2bGY63ubFsQcsig1NxkWjsPdh1Caqmtqq9Kc2A2 NKMOp5F0lYV/Bx08RrJVXu0uWYxlvLftfmeatD+krOwzJ9JGz19DgTU2vSyJ4HAXAT5Q yeXw== X-Gm-Message-State: ACrzQf005+rrUEhGcnFTsyrNPvnMPNBMZ6z91tzkgdBTlZqm1Y3pD21x p+HmbCNSm0Sd1Nk8+qv1P8U= X-Received: by 2002:a05:6a00:1905:b0:566:2a02:e1a1 with SMTP id y5-20020a056a00190500b005662a02e1a1mr34370199pfi.1.1667540488374; Thu, 03 Nov 2022 22:41:28 -0700 (PDT) Received: from localhost.localdomain ([116.128.244.169]) by smtp.gmail.com with ESMTPSA id q15-20020aa7960f000000b0056bdc3f5b29sm1684043pfg.186.2022.11.03.22.41.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 22:41:27 -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 v2 1/2] PM: hibernate: fix spelling mistake for annotation Date: Fri, 4 Nov 2022 13:41:18 +0800 Message-Id: <20221104054119.1946073-2-tgsp002@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221104054119.1946073-1-tgsp002@gmail.com> References: <20221104054119.1946073-1-tgsp002@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748543160104622678?= X-GMAIL-MSGID: =?utf-8?q?1748543160104622678?= 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. *