From patchwork Mon Aug 7 11:58:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 131930 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp1421214vqr; Mon, 7 Aug 2023 05:46:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGTNDw6Fpf00LYAVzP4yCelYqYp4ckYCV+MimMq9qAK9+79/D6az6WOG2lNMYgeAG0QpWv+ X-Received: by 2002:a17:902:da90:b0:1b8:3dec:48de with SMTP id j16-20020a170902da9000b001b83dec48demr9612719plx.47.1691412407827; Mon, 07 Aug 2023 05:46:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691412407; cv=none; d=google.com; s=arc-20160816; b=X4BX6IwNPQBovzPKz//JAeHaYJqeK8uXlt88n4t9gxfqYnpw0i7pOgZJHXNAYRUuJn 8zeNnL13bWLPK6cp5e3YgzEsteaS1lFm1QuvjTFgccmEgxGob3LSklDIKFYMlWWETvu4 6JHPt1VJmaz89NNBBuxljKsfSGl3/ODbQc4aL2mdrCGpZtlSPzn5xI9wn4Ppk+TotY0I U6YYf5ImcpGSVewigBpTmQ2bTyZ1tuFlW7s0hKPNLV1FHaRQW+2Q/MDnaxyrawo/GWi/ /TP101DIAKklMn/N2jQ1Ny9GpPi75BXLfuUhK+9P15Gi81fhTyW4xzSZCSI4D1+eAfAh GPAQ== 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 :message-id:date:subject:cc:to:from; bh=mYgA+OE1a9iI4dX0U913JF6Nfy3tZFpduJWv7lFLtSY=; fh=pZWOv2pRkfQFUJ1QSi9xw43l3YtSwTmReJZNUnZfmEA=; b=X5HBEJYaXoPbUVJnHHIoFOv8HqhR8xiBLyz40/0IO1F60bAFidD48OEqRn52dl0FLZ +xSzd3k+xsZEQHDymEXIGtTgIhKE1GDuQIOvXpZThRk/8IorOKvAC/znc5vpViUmOuHR 7uu9tzGkHGZ2GEAVAkWHlzNKyTauYTawVk7mTpKKwKIo0YuIHVXhynLt/Y+qyGgFw6p6 JZBwb+bAQ8iX8CSFZU+VMf1NV+XLWIXQvG7Q0z6tvMoxzWXUlLPE66X1MxGiFfncjXW7 DY5ujpgiiVVF894ROZQtmjwFVI89iFTsLXJ6sxqf0j7YmFoPt0Zu/+qzneZDFQ4zU9M2 umxg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c10-20020a170903234a00b001b8ae34f1b7si2978318plh.631.2023.08.07.05.46.32; Mon, 07 Aug 2023 05:46:47 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231447AbjHGL7A (ORCPT + 99 others); Mon, 7 Aug 2023 07:59:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230054AbjHGL66 (ORCPT ); Mon, 7 Aug 2023 07:58:58 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E446106; Mon, 7 Aug 2023 04:58:57 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4RKFC92TsBz1Z1WM; Mon, 7 Aug 2023 19:56:05 +0800 (CST) Received: from huawei.com (10.174.151.185) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 7 Aug 2023 19:58:52 +0800 From: Miaohe Lin To: , , CC: , , Subject: [PATCH] cgroup: clean up if condition in cgroup_pidlist_start() Date: Mon, 7 Aug 2023 19:58:31 +0800 Message-ID: <20230807115831.3590631-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Originating-IP: [10.174.151.185] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,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: INBOX X-GMAIL-THRID: 1773574457072338334 X-GMAIL-MSGID: 1773574457072338334 There's no need to use '<=' when knowing 'l->list[mid] != pid' already. No functional change intended. Signed-off-by: Miaohe Lin --- kernel/cgroup/cgroup-v1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c index 83044312bc41..c487ffef6652 100644 --- a/kernel/cgroup/cgroup-v1.c +++ b/kernel/cgroup/cgroup-v1.c @@ -431,7 +431,7 @@ static void *cgroup_pidlist_start(struct seq_file *s, loff_t *pos) if (l->list[mid] == pid) { index = mid; break; - } else if (l->list[mid] <= pid) + } else if (l->list[mid] < pid) index = mid + 1; else end = mid;