mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] cgroup: clean up if condition in cgroup_pidlist_start()
@ 2023-08-07 11:58 Miaohe Lin
  2023-08-07 18:30 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Miaohe Lin @ 2023-08-07 11:58 UTC (permalink / raw)
  To: tj, hannes, lizefan.x; +Cc: cgroups, linux-kernel, linmiaohe

There's no need to use '<=' when knowing 'l->list[mid] != pid' already.
No functional change intended.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 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;
-- 
2.33.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] cgroup: clean up if condition in cgroup_pidlist_start()
  2023-08-07 11:58 [PATCH] cgroup: clean up if condition in cgroup_pidlist_start() Miaohe Lin
@ 2023-08-07 18:30 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2023-08-07 18:30 UTC (permalink / raw)
  To: Miaohe Lin; +Cc: hannes, lizefan.x, cgroups, linux-kernel

On Mon, Aug 07, 2023 at 07:58:31PM +0800, Miaohe Lin wrote:
> There's no need to use '<=' when knowing 'l->list[mid] != pid' already.
> No functional change intended.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Applied to cgroup/for-6.6.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-07 18:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-07 11:58 [PATCH] cgroup: clean up if condition in cgroup_pidlist_start() Miaohe Lin
2023-08-07 18:30 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®