From d2804c0eeb2b03d7e76f81c492d005c34a383b54 Mon Sep 17 00:00:00 2001 From: visa Date: Thu, 9 Aug 2018 15:02:45 +0000 Subject: [PATCH] Remove redundant "kq == kn->kn_kq" checks. The lists kq_knhash and kq_knlist are dedicated to a single kqueue instance, which makes the filtering by kn_kq unnecessary. OK kettenis@, mpi@ --- sys/kern/kern_event.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 8ee92e8d60d..c141f2ac729 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_event.c,v 1.95 2018/08/07 12:38:15 visa Exp $ */ +/* $OpenBSD: kern_event.c,v 1.96 2018/08/09 15:02:45 visa Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon @@ -590,8 +590,7 @@ kqueue_register(struct kqueue *kq, struct kevent *kev, struct proc *p) if (kev->ident < kq->kq_knlistsize) { SLIST_FOREACH(kn, &kq->kq_knlist[kev->ident], kn_link) { - if (kq == kn->kn_kq && - kev->filter == kn->kn_filter) + if (kev->filter == kn->kn_filter) break; } } @@ -603,7 +602,6 @@ kqueue_register(struct kqueue *kq, struct kevent *kev, struct proc *p) KN_HASH((u_long)kev->ident, kq->kq_knhashmask)]; SLIST_FOREACH(kn, list, kn_link) { if (kev->ident == kn->kn_id && - kq == kn->kn_kq && kev->filter == kn->kn_filter) break; } -- 2.20.1