git: 1eebd6158ccc - main - newbus: Optimize/Simplify kobj_class_compile_common a little
Warner Losh
imp at FreeBSD.org
Wed Apr 21 21:37:34 UTC 2021
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=1eebd6158cccf12f3b057d6a1adf9d40ec59844c
commit 1eebd6158cccf12f3b057d6a1adf9d40ec59844c
Author: Warner Losh <imp at FreeBSD.org>
AuthorDate: 2021-04-21 21:35:54 +0000
Commit: Warner Losh <imp at FreeBSD.org>
CommitDate: 2021-04-21 21:37:24 +0000
newbus: Optimize/Simplify kobj_class_compile_common a little
"i" is not used in this loop at all. There's no need to initialize and
increment it.
Reviewed by: markj@
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D29898
---
sys/kern/subr_kobj.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/kern/subr_kobj.c b/sys/kern/subr_kobj.c
index d001450cba6f..17d23336e333 100644
--- a/sys/kern/subr_kobj.c
+++ b/sys/kern/subr_kobj.c
@@ -112,7 +112,7 @@ kobj_class_compile_common(kobj_class_t cls, kobj_ops_t ops)
/*
* First register any methods which need it.
*/
- for (i = 0, m = cls->methods; m->desc; i++, m++) {
+ for (m = cls->methods; m->desc; m++) {
if (m->desc->id == 0)
m->desc->id = kobj_next_id++;
}
More information about the dev-commits-src-main
mailing list