cgroup: clean up if condition in cgroup_pidlist_start()

Message ID 20230807115831.3590631-1-linmiaohe@huawei.com
State New
Headers
Series cgroup: clean up if condition in cgroup_pidlist_start() |

Commit Message

Miaohe Lin Aug. 7, 2023, 11:58 a.m. UTC
  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(-)
  

Comments

Tejun Heo Aug. 7, 2023, 6:30 p.m. UTC | #1
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.
  

Patch

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;